From d7ad8baeb10ae9ca505156ae715f372a1c18151d Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Thu, 6 Sep 2012 14:58:22 +0200 Subject: 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. --- src/messages-service.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/messages-service.c') 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); } -- cgit v1.2.3