SF.net SVN: geany:[4145] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Sep 1 17:20:34 UTC 2009


Revision: 4145
          http://geany.svn.sourceforge.net/geany/?rev=4145&view=rev
Author:   ntrel
Date:     2009-09-01 17:20:34 +0000 (Tue, 01 Sep 2009)

Log Message:
-----------
Remove plugin from plugin manager dialog on unloading if it no
longer exists or is incompatible.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/plugins.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-09-01 08:26:00 UTC (rev 4144)
+++ trunk/ChangeLog	2009-09-01 17:20:34 UTC (rev 4145)
@@ -1,3 +1,10 @@
+2009-09-01  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/plugins.c:
+   Remove plugin from plugin manager dialog on unloading if it no
+   longer exists or is incompatible.
+
+
 2009-08-31  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/plugins.c:

Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c	2009-09-01 08:26:00 UTC (rev 4144)
+++ trunk/src/plugins.c	2009-09-01 17:20:34 UTC (rev 4145)
@@ -1034,20 +1034,27 @@
 
 	/* reload plugin module and initialize it if item is checked */
 	p = plugin_new(file_name, state, TRUE);
-	if (state)
-		keybindings_load_keyfile();		/* load shortcuts */
+	if (!p)
+	{
+		/* plugin file may no longer be on disk, or is now incompatible */
+		gtk_list_store_remove(pm_widgets.store, &iter);
+	}
+	else
+	{
+		if (state)
+			keybindings_load_keyfile();		/* load shortcuts */
 
-	/* update model */
-	gtk_list_store_set(pm_widgets.store, &iter,
-		PLUGIN_COLUMN_CHECK, state,
-		PLUGIN_COLUMN_PLUGIN, p, -1);
+		/* update model */
+		gtk_list_store_set(pm_widgets.store, &iter,
+			PLUGIN_COLUMN_CHECK, state,
+			PLUGIN_COLUMN_PLUGIN, p, -1);
 
+		/* set again the sensitiveness of the configure and help buttons */
+		is_active = is_active_plugin(p);
+		gtk_widget_set_sensitive(pm_widgets.configure_button, p->configure != NULL && is_active);
+		gtk_widget_set_sensitive(pm_widgets.help_button, p->help != NULL && is_active);
+	}
 	g_free(file_name);
-
-	/* set again the sensitiveness of the configure and help buttons */
-	is_active = is_active_plugin(p);
-	gtk_widget_set_sensitive(pm_widgets.configure_button, p->configure != NULL && is_active);
-	gtk_widget_set_sensitive(pm_widgets.help_button, p->help != NULL && is_active);
 }
 
 


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