[gedit/libgpe: 20/21] Bring back the ui manager update when deactivating a plugin on a window.



commit 0364e8ac006e29025698f18aab69a3df2e649936
Author: Steve Frécinaux <code istique net>
Date:   Wed Nov 4 23:40:59 2009 +0100

    Bring back the ui manager update when deactivating a plugin on a window.
    
    Ensure update of ui manager, because we suspect it does something
    with expected static strings in the type module (when unloaded the
    strings don't exist anymore, and ui manager updates in an idle).
    
    This was implemented in master, but has been removed temporarily.

 gedit/gedit-plugins-engine.c |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/gedit/gedit-plugins-engine.c b/gedit/gedit-plugins-engine.c
index 8d8dd2a..fbde7f4 100644
--- a/gedit/gedit-plugins-engine.c
+++ b/gedit/gedit-plugins-engine.c
@@ -70,6 +70,20 @@ gedit_plugins_engine_init (GeditPluginsEngine *engine)
 }
 
 static void
+gedit_plugins_engine_deactivate_plugin_on_object (GPEEngine     *engine,
+						  GPEPluginInfo *info,
+						  GObject       *object)
+{
+	GPE_ENGINE_CLASS (gedit_plugins_engine_parent_class)->deactivate_plugin_on_object (engine, info, object);
+
+	/* ensure update of ui manager, because we suspect it does something
+	   with expected static strings in the type module (when unloaded the
+	   strings don't exist anymore, and ui manager updates in an idle
+	   func) */
+	gtk_ui_manager_ensure_update (gedit_window_get_ui_manager (GEDIT_WINDOW (object)));
+}
+
+static void
 gedit_plugins_engine_finalize (GObject *object)
 {
 	gedit_debug (DEBUG_PLUGINS);
@@ -81,8 +95,10 @@ static void
 gedit_plugins_engine_class_init (GeditPluginsEngineClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	GPEEngineClass *engine_class = GPE_ENGINE_CLASS (klass);
 
 	object_class->finalize = gedit_plugins_engine_finalize;
+	engine_class->deactivate_plugin_on_object = gedit_plugins_engine_deactivate_plugin_on_object;
 
 	g_type_class_add_private (klass, sizeof (GeditPluginsEnginePrivate));
 }
@@ -143,17 +159,6 @@ save_active_plugin_list (GeditPluginsEngine *engine)
 
 	g_slist_free (active_plugins);
 }
-
-static void
-call_plugin_deactivate (GeditPlugin *plugin, 
-			GeditWindow *window)
-{
-	/* ensure update of ui manager, because we suspect it does something
-	   with expected static strings in the type module (when unloaded the
-	   strings don't exist anymore, and ui manager updates in an idle
-	   func) */
-	gtk_ui_manager_ensure_update (gedit_window_get_ui_manager (window));
-}
 #endif
 
 void 



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