Merge lp:~unity-api-team/hud/dbusmenu-safety-valve into lp:hud/14.04

Proposed by Pete Woods
Status: Merged
Approved by: Antti Kaijanmäki
Approved revision: 389
Merged at revision: 389
Proposed branch: lp:~unity-api-team/hud/dbusmenu-safety-valve
Merge into: lp:hud/14.04
Diff against target: 67 lines (+19/-10)
1 file modified
service/DBusMenuCollector.cpp (+19/-10)
To merge this branch: bzr merge lp:~unity-api-team/hud/dbusmenu-safety-valve
Reviewer Review Type Date Requested Status
Antti Kaijanmäki (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+213649@code.launchpad.net

Commit message

Make the DBusMenu safety valve actually work this time

Description of the change

* Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
  * Yes
 * Did you build your software in a clean sbuild/pbuilder chroot or ppa?
  * Yes
 * Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
  * Yes
 * Has your component "TestPlan” been executed successfully on emulator, N4?
  * Yes
 * Has a 5 minute exploratory testing run been executed on N4?
  * Yes
 * If you changed the packaging (debian), did you subscribe a core-dev to this MP?
  * N/A
 * If you changed the UI, did you subscribe the design-reviewers to this MP?
  * No change
 * What components might get impacted by your changes?
  * Unity7
  * Unity8
 * Have you requested review by the teams of these owning components?
  * Yes

Check List:
https://wiki.ubuntu.com/Process/Merges/Checklists/hud

Test Plan:
https://wiki.ubuntu.com/Process/Merges/TestPlan/hud

Silo:
https://launchpad.net/~ci-train-ppa-service/+archive/landing-004/

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'service/DBusMenuCollector.cpp'
2--- service/DBusMenuCollector.cpp 2014-03-26 09:00:05 +0000
3+++ service/DBusMenuCollector.cpp 2014-04-01 13:16:13 +0000
4@@ -23,6 +23,7 @@
5
6 #include <dbusmenuimporter.h>
7 #include <QMenu>
8+#include <stdexcept>
9
10 using namespace hud::common;
11 using namespace hud::service;
12@@ -95,9 +96,9 @@
13 }
14
15 if (limit == 0) {
16- qWarning() << "Hit DBusMenu safety valve for menu at" << m_service
17- << m_path.path();
18- return;
19+ QString error = "Hit DBusMenu safety valve for menu at " + m_service
20+ + " " + m_path.path();
21+ throw std::logic_error(error.toStdString());
22 }
23
24 menu->aboutToShow();
25@@ -121,9 +122,9 @@
26
27 void DBusMenuCollector::hideMenu(QMenu *menu, unsigned int &limit) {
28 if (limit == 0) {
29- qWarning() << "Hit DBusMenu safety valve for menu at" << m_service
30- << m_path.path();
31- return;
32+ QString error = "Hit DBusMenu safety valve for menu at " + m_service
33+ + " " + m_path.path();
34+ throw std::logic_error(error.toStdString());
35 }
36
37 for (int i(0); i < menu->actions().size(); ++i) {
38@@ -150,8 +151,12 @@
39 }
40
41 if (collectorToken.isNull()) {
42- unsigned int limit(50);
43- openMenu(m_menuImporter->menu(), limit);
44+ try {
45+ unsigned int limit(50);
46+ openMenu(m_menuImporter->menu(), limit);
47+ } catch (std::logic_error &e) {
48+ qDebug() << e.what();
49+ }
50
51 if(m_menuImporter.isNull()) {
52 return QList<CollectorToken::Ptr>();
53@@ -169,8 +174,12 @@
54 if(m_menuImporter.isNull()) {
55 return;
56 }
57- unsigned int limit(50);
58- hideMenu(m_menuImporter->menu(), limit);
59+ try {
60+ unsigned int limit(50);
61+ hideMenu(m_menuImporter->menu(), limit);
62+ } catch (std::logic_error &e) {
63+ qDebug() << e.what();
64+ }
65 }
66
67 void DBusMenuCollector::WindowRegistered(uint windowId, const QString &service,

Subscribers

People subscribed via source and target branches