Merge lp:~ted/indicator-appmenu/lp930059 into lp:indicator-appmenu/0.4

Proposed by Ted Gould
Status: Merged
Merged at revision: 158
Proposed branch: lp:~ted/indicator-appmenu/lp930059
Merge into: lp:indicator-appmenu/0.4
Diff against target: 27 lines (+5/-2)
1 file modified
src/menuitem-collector.c (+5/-2)
To merge this branch: bzr merge lp:~ted/indicator-appmenu/lp930059
Reviewer Review Type Date Requested Status
Conor Curran (community) Approve
Review via email: mp+92569@code.launchpad.net

Description of the change

Make sure the properties exist before making decisions based on them.

To post a comment you must log in.
Revision history for this message
Conor Curran (cjcurran) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/menuitem-collector.c'
2--- src/menuitem-collector.c 2012-02-03 22:01:35 +0000
3+++ src/menuitem-collector.c 2012-02-10 20:37:20 +0000
4@@ -278,6 +278,7 @@
5 {type: "appointment-item", label: "appointment-label", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},
6 {type: "timezone-item", label: "timezone-name", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},
7 /* Indicator Sound */
8+ /* x-canonical-sound-menu-player-transport-type */
9 {type: "x-canonical-sound-menu-player-metadata-type", label: "x-canonical-sound-menu-player-metadata-player-name", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},
10 {type: "x-canonical-sound-menu-mute-type", label: "label", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},
11 /* Indicator User */
12@@ -371,11 +372,13 @@
13 /* Skip the items that are disabled or not visible as they wouldn't
14 be usable in the application so we don't want to show them and
15 act like they're usable in the HUD either */
16- if (!dbusmenu_menuitem_property_get_bool(rootitem, prop_strings->enabled)) {
17+ if (dbusmenu_menuitem_property_exist(rootitem, prop_strings->enabled) &&
18+ !dbusmenu_menuitem_property_get_bool(rootitem, prop_strings->enabled)) {
19 return results;
20 }
21
22- if (!dbusmenu_menuitem_property_get_bool(rootitem, prop_strings->visible)) {
23+ if (dbusmenu_menuitem_property_exist(rootitem, prop_strings->visible) &&
24+ !dbusmenu_menuitem_property_get_bool(rootitem, prop_strings->visible)) {
25 return results;
26 }
27 }

Subscribers

People subscribed via source and target branches