diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-08-27 16:13:36 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-08-27 16:13:36 +0200 |
commit | 5c88df7dcff3fcb98507a9b1c073bb5b23e1487d (patch) | |
tree | 26925c361ee590c56132e6f5ed4122b3d1f70008 /src | |
parent | fab67a704ed6f189014a1988e641194e0f4babb1 (diff) | |
download | ayatana-indicator-messages-5c88df7dcff3fcb98507a9b1c073bb5b23e1487d.tar.gz ayatana-indicator-messages-5c88df7dcff3fcb98507a9b1c073bb5b23e1487d.tar.bz2 ayatana-indicator-messages-5c88df7dcff3fcb98507a9b1c073bb5b23e1487d.zip |
IdoMenuItem: don't try to set state on stateless actions
Diffstat (limited to 'src')
-rw-r--r-- | src/app-section.c | 7 | ||||
-rw-r--r-- | src/ido-menu-item.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/app-section.c b/src/app-section.c index 0487fbb..d4bc3dd 100644 --- a/src/app-section.c +++ b/src/app-section.c @@ -346,6 +346,7 @@ app_section_set_app_info (AppSection *self, for (i = 0; nicks[i] != NULL; i++) { gchar *name; GSimpleAction *action; + GMenuItem *item; name = indicator_desktop_shortcuts_nick_get_name(priv->ids, nicks[i]); @@ -354,8 +355,12 @@ app_section_set_app_info (AppSection *self, g_simple_action_group_insert (priv->static_shortcuts, G_ACTION (action)); g_object_unref (action); - g_menu_append (priv->menu, name, nicks[i]); + item = g_menu_item_new (name, nicks[i]); + g_menu_item_set_attribute (item, "x-canonical-type", "s", "IdoMenuItem"); + g_menu_item_set_attribute (item, "x-canonical-icon", "s", ""); /* empty to get indentation */ + g_menu_append_item (priv->menu, item); + g_object_unref (item); g_free(name); } diff --git a/src/ido-menu-item.c b/src/ido-menu-item.c index 391f0df..c2a8309 100644 --- a/src/ido-menu-item.c +++ b/src/ido-menu-item.c @@ -132,10 +132,12 @@ ido_menu_item_set_action_name (IdoMenuItem *self, &enabled, ¶m_type, NULL, NULL, &state)) { gtk_widget_set_sensitive (GTK_WIDGET (self), enabled); - ido_menu_item_set_state (self, state); if (state) - g_variant_unref (state); + { + ido_menu_item_set_state (self, state); + g_variant_unref (state); + } } else { |