SF.net SVN: geany:[4569] branches/geany-0.18.1

ntrel at users.sourceforge.net ntrel at xxxxx
Thu Jan 28 13:00:59 UTC 2010


Revision: 4569
          http://geany.svn.sourceforge.net/geany/?rev=4569&view=rev
Author:   ntrel
Date:     2010-01-28 13:00:47 +0000 (Thu, 28 Jan 2010)

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

Modified Paths:
--------------
    branches/geany-0.18.1/ChangeLog
    branches/geany-0.18.1/src/plugins.c

Modified: branches/geany-0.18.1/ChangeLog
===================================================================
--- branches/geany-0.18.1/ChangeLog	2010-01-28 12:48:53 UTC (rev 4568)
+++ branches/geany-0.18.1/ChangeLog	2010-01-28 13:00:47 UTC (rev 4569)
@@ -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-27  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/geany.h:

Modified: branches/geany-0.18.1/src/plugins.c
===================================================================
--- branches/geany-0.18.1/src/plugins.c	2010-01-28 12:48:53 UTC (rev 4568)
+++ branches/geany-0.18.1/src/plugins.c	2010-01-28 13:00:47 UTC (rev 4569)
@@ -1057,20 +1057,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