SF.net SVN: geany:[4917] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sat May 15 13:14:38 UTC 2010


Revision: 4917
          http://geany.svn.sourceforge.net/geany/?rev=4917&view=rev
Author:   eht16
Date:     2010-05-15 13:14:38 +0000 (Sat, 15 May 2010)

Log Message:
-----------
Explicitly disconnect menus from GeanyMenuButtonAction on quit to not trigger updating the menus on each item removal.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/templates.c
    trunk/src/toolbar.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-05-15 12:56:42 UTC (rev 4916)
+++ trunk/ChangeLog	2010-05-15 13:14:38 UTC (rev 4917)
@@ -12,6 +12,9 @@
  * src/toolbar.c:
    Improve adding/removing of the special separator between menubar and
    toolbar when the toolbar is appended to the menubar.
+ * src/toolbar.c, src/templates.c:
+   Explicitly disconnect menus from GeanyMenuButtonAction on quit to
+   not trigger updating the menus on each item removal.
 
 
 2010-05-15  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>

Modified: trunk/src/templates.c
===================================================================
--- trunk/src/templates.c	2010-05-15 12:56:42 UTC (rev 4916)
+++ trunk/src/templates.c	2010-05-15 13:14:38 UTC (rev 4917)
@@ -709,6 +709,11 @@
 	gint i;
 	GList *children, *item;
 
+	/* disconnect the menu from the action widget, so destroying the items below doesn't
+	 * trigger rebuilding of the menu on each item destroy */
+	geany_menu_button_action_set_menu(
+		GEANY_MENU_BUTTON_ACTION(toolbar_get_action_by_name("New")), NULL);
+
 	for (i = 0; i < GEANY_MAX_TEMPLATES; i++)
 	{
 		g_free(templates[i]);
@@ -725,8 +730,6 @@
 	}
 	g_list_free(children);
 
-	geany_menu_button_action_set_menu(
-		GEANY_MENU_BUTTON_ACTION(toolbar_get_action_by_name("New")), NULL);
 	g_object_unref(new_with_template_menu);
 	new_with_template_menu = NULL;
 }

Modified: trunk/src/toolbar.c
===================================================================
--- trunk/src/toolbar.c	2010-05-15 12:56:42 UTC (rev 4916)
+++ trunk/src/toolbar.c	2010-05-15 13:14:38 UTC (rev 4917)
@@ -517,8 +517,9 @@
 
 void toolbar_finalize(void)
 {
-	g_object_unref(geany_menu_button_action_get_menu(
-					GEANY_MENU_BUTTON_ACTION(toolbar_get_action_by_name("Open"))));
+	GeanyMenubuttonAction *open_action = GEANY_MENU_BUTTON_ACTION(toolbar_get_action_by_name("Open"));
+	g_object_unref(geany_menu_button_action_get_menu(open_action));
+	geany_menu_button_action_set_menu(open_action, NULL);
 
 	/* unref'ing the GtkUIManager object will destroy all its widgets unless they were ref'ed */
 	g_object_unref(uim);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list