aboutsummaryrefslogtreecommitdiff
path: root/tests/indicator-fixture.h
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-11-04 18:27:35 -0600
committerTed Gould <ted@gould.cx>2014-11-04 18:27:35 -0600
commitd40397906cb1e04cb225598ae0faacb8019ebf90 (patch)
tree2a70975d70cca1015f982cf131a40045fedc34cf /tests/indicator-fixture.h
parentc4530fde870f6c7838d3d5dee2a63a885d8f896a (diff)
downloadayatana-indicator-sound-d40397906cb1e04cb225598ae0faacb8019ebf90.tar.gz
ayatana-indicator-sound-d40397906cb1e04cb225598ae0faacb8019ebf90.tar.bz2
ayatana-indicator-sound-d40397906cb1e04cb225598ae0faacb8019ebf90.zip
Parse through sections as well
Diffstat (limited to 'tests/indicator-fixture.h')
-rw-r--r--tests/indicator-fixture.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h
index f2039f7..4b510a0 100644
--- a/tests/indicator-fixture.h
+++ b/tests/indicator-fixture.h
@@ -176,9 +176,14 @@ class IndicatorFixture : public ::testing::Test
if (menuLocation + 1 == menuEnd)
return getMenuAttributeVal(*menuLocation, menu, attribute, value);
- auto submenu = std::shared_ptr<GMenuModel>(g_menu_model_get_item_link(menu.get(), *menuLocation, G_MENU_LINK_SUBMENU), [](GMenuModel * modelptr) {
+ auto clearfunc = [](GMenuModel * modelptr) {
g_clear_object(&modelptr);
- });
+ };
+
+ auto submenu = std::shared_ptr<GMenuModel>(g_menu_model_get_item_link(menu.get(), *menuLocation, G_MENU_LINK_SUBMENU), clearfunc);
+
+ if (submenu == nullptr)
+ submenu = std::shared_ptr<GMenuModel>(g_menu_model_get_item_link(menu.get(), *menuLocation, G_MENU_LINK_SECTION), clearfunc);
if (submenu == nullptr)
return nullptr;