diff options
author | Ted Gould <ted@gould.cx> | 2010-04-15 15:13:19 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-04-15 15:13:19 -0500 |
commit | 7c83491f5a7691f6a768670febfa9b4c9f428c2d (patch) | |
tree | 1438d2f765d7353cf4278c7f320d81ca12c1c135 /src/messages-service.c | |
parent | a05571c978dba6f33773a664bbb1672038fbad93 (diff) | |
download | ayatana-indicator-messages-7c83491f5a7691f6a768670febfa9b4c9f428c2d.tar.gz ayatana-indicator-messages-7c83491f5a7691f6a768670febfa9b4c9f428c2d.tar.bz2 ayatana-indicator-messages-7c83491f5a7691f6a768670febfa9b4c9f428c2d.zip |
Removing the shortcuts when removing the application entry.
Diffstat (limited to 'src/messages-service.c')
-rw-r--r-- | src/messages-service.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 88da0e0..53532dd 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -756,11 +756,19 @@ server_removed (IndicateListener * listener, IndicateListenerServer * server, gc /* If there is a menu item, let's get rid of it. */ if (sltp->menuitem != NULL) { - dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(sltp->menuitem), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + /* If there are shortcuts remove them */ + GList * shortcuts = app_menu_item_get_items(sltp->menuitem); + while (shortcuts != NULL) { + dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(shortcuts->data), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + dbusmenu_menuitem_child_delete(DBUSMENU_MENUITEM(data), DBUSMENU_MENUITEM(shortcuts->data)); + shortcuts = g_list_next(shortcuts); + } + + dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(sltp->menuitem), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); dbusmenu_menuitem_child_delete(DBUSMENU_MENUITEM(data), DBUSMENU_MENUITEM(sltp->menuitem)); g_object_unref(G_OBJECT(sltp->menuitem)); } - + /* If there is a separator, let's get rid of it. */ if (sltp->separator != NULL) { dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(sltp->separator), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); |