[gnome-panel] panel: Correctly reload menu on changes



commit 247628370cadb3a4998a697b87780f8a990cd3c7
Author: Vincent Untz <vuntz gnome org>
Date:   Fri Jul 22 12:00:41 2011 +0200

    panel: Correctly reload menu on changes
    
    With the new API, we have to explicitly reload the menu.

 gnome-panel/menu.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gnome-panel/menu.c b/gnome-panel/menu.c
index a2d69c8..4077940 100644
--- a/gnome-panel/menu.c
+++ b/gnome-panel/menu.c
@@ -1180,6 +1180,7 @@ handle_gmenu_tree_changed (GMenuTree *tree,
 {
 	guint idle_id;
 	GList *list, *l;
+	GError *error = NULL;
 
 	/* Remove existing items */
 	list = gtk_container_get_children (GTK_CONTAINER (menu));
@@ -1191,6 +1192,11 @@ handle_gmenu_tree_changed (GMenuTree *tree,
 				"panel-menu-tree-directory",
 				NULL, NULL);
 
+	if (!gmenu_tree_load_sync (tree, &error)) {
+		g_warning ("Failed to load applications: %s", error->message);
+		g_clear_error (&error);
+	}
+
 	g_object_set_data (G_OBJECT (menu),
 			   "panel-menu-needs-loading",
 			   GUINT_TO_POINTER (TRUE));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]