aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-01-29 16:26:25 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-01-29 16:26:25 -0600
commit131f7512975e3e0e1363cb787834abee5b79b4e5 (patch)
treebf52d471b4ec2f1b5fc667f6a217ae676e8c0599
parent6b2c01ed6063bd7fd12e192668b738a075dc3a24 (diff)
downloadayatana-indicator-datetime-131f7512975e3e0e1363cb787834abee5b79b4e5.tar.gz
ayatana-indicator-datetime-131f7512975e3e0e1363cb787834abee5b79b4e5.tar.bz2
ayatana-indicator-datetime-131f7512975e3e0e1363cb787834abee5b79b4e5.zip
fix disabled 'Add Event…' menuitem issue reported in testing by seb128; add a test for this regression
-rw-r--r--src/menu.cpp2
-rw-r--r--tests/test-menus.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index 40a94fa..44da7b7 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -321,7 +321,7 @@ private:
// add the 'Add Event…' menuitem
auto menu_item = g_menu_item_new(_("Add Event…"), nullptr);
- const gchar* action_name = "indicator.activate_planner";
+ const gchar* action_name = "indicator.activate-planner";
auto v = g_variant_new_int64(0);
g_menu_item_set_action_and_target_value(menu_item, action_name, v);
g_menu_append_item(menu, menu_item);
diff --git a/tests/test-menus.cpp b/tests/test-menus.cpp
index 27248ad..e9dd7df 100644
--- a/tests/test-menus.cpp
+++ b/tests/test-menus.cpp
@@ -182,6 +182,14 @@ protected:
section = g_menu_model_get_item_link(submenu, Menu::Appointments, G_MENU_LINK_SECTION);
int expected_n = appointments_expected ? 1 : 0;
EXPECT_EQ(expected_n, g_menu_model_get_n_items(section));
+ if (appointments_expected)
+ {
+ gchar* action = nullptr;
+ EXPECT_TRUE(g_menu_model_get_item_attribute(section, 0, G_MENU_ATTRIBUTE_ACTION, "s", &action));
+ EXPECT_STREQ("indicator.activate-planner", action);
+ EXPECT_TRUE(g_action_group_has_action(m_actions->action_group(), "activate-planner"));
+ g_free(action);
+ }
g_clear_object(&section);
// try adding a few appointments and see if the menu updates itself