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
=== modified file 'src/menuitem-collector.c'
--- src/menuitem-collector.c 2012-02-03 22:01:35 +0000
+++ src/menuitem-collector.c 2012-02-10 20:37:20 +0000
@@ -278,6 +278,7 @@
278 {type: "appointment-item", label: "appointment-label", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},278 {type: "appointment-item", label: "appointment-label", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},
279 {type: "timezone-item", label: "timezone-name", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},279 {type: "timezone-item", label: "timezone-name", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},
280 /* Indicator Sound */280 /* Indicator Sound */
281 /* x-canonical-sound-menu-player-transport-type */
281 {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},282 {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},
282 {type: "x-canonical-sound-menu-mute-type", label: "label", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},283 {type: "x-canonical-sound-menu-mute-type", label: "label", visible: DBUSMENU_MENUITEM_PROP_VISIBLE, enabled: DBUSMENU_MENUITEM_PROP_ENABLED},
283 /* Indicator User */284 /* Indicator User */
@@ -371,11 +372,13 @@
371 /* Skip the items that are disabled or not visible as they wouldn't372 /* Skip the items that are disabled or not visible as they wouldn't
372 be usable in the application so we don't want to show them and373 be usable in the application so we don't want to show them and
373 act like they're usable in the HUD either */374 act like they're usable in the HUD either */
374 if (!dbusmenu_menuitem_property_get_bool(rootitem, prop_strings->enabled)) {375 if (dbusmenu_menuitem_property_exist(rootitem, prop_strings->enabled) &&
376 !dbusmenu_menuitem_property_get_bool(rootitem, prop_strings->enabled)) {
375 return results;377 return results;
376 }378 }
377379
378 if (!dbusmenu_menuitem_property_get_bool(rootitem, prop_strings->visible)) {380 if (dbusmenu_menuitem_property_exist(rootitem, prop_strings->visible) &&
381 !dbusmenu_menuitem_property_get_bool(rootitem, prop_strings->visible)) {
379 return results;382 return results;
380 }383 }
381 }384 }

Subscribers

People subscribed via source and target branches