diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-09-06 14:58:22 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-09-06 14:58:22 +0200 |
commit | d7ad8baeb10ae9ca505156ae715f372a1c18151d (patch) | |
tree | 983169439609579a6ca5cd69e63e21c2a3321333 | |
parent | 10d194fc1b4630a43317d9ecc919c62c4f95d48c (diff) | |
download | ayatana-indicator-messages-d7ad8baeb10ae9ca505156ae715f372a1c18151d.tar.gz ayatana-indicator-messages-d7ad8baeb10ae9ca505156ae715f372a1c18151d.tar.bz2 ayatana-indicator-messages-d7ad8baeb10ae9ca505156ae715f372a1c18151d.zip |
messages-service: fix merge error
Check whether no apps are left in remove_section instead of remove_application,
so that it is also done when an AppSection emits "destroy". This is a result
of improper merging of the watch-desktop-files and hide-indicator branches.
-rw-r--r-- | src/messages-service.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 437f046..7cc037b 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -152,6 +152,11 @@ remove_section (AppSection *section, g_signal_handlers_disconnect_by_func (section, remove_section, NULL); g_hash_table_remove (applications, id); + + if (g_hash_table_size (applications) == 0 && + g_menu_model_get_n_items (G_MENU_MODEL (toplevel_menu)) == 1) { + g_menu_remove (toplevel_menu, 0); + } } static AppSection * @@ -243,13 +248,6 @@ remove_application (const char *desktop_id) g_warning ("could not remove '%s', it's not registered", desktop_id); } - g_hash_table_remove (applications, id); - - if (g_hash_table_size (applications) == 0 && - g_menu_model_get_n_items (G_MENU_MODEL (toplevel_menu)) == 1) { - g_menu_remove (toplevel_menu, 0); - } - g_free (id); g_object_unref (appinfo); } |