changeset 5981:81564bb4db68

[gaim-migrate @ 6429] Saving and loading the current plugin list should work once again. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 02 Jul 2003 06:00:22 +0000
parents 34341fd4f11e
children 35d3c1ac5ece
files src/gtkplugin.c src/gtkplugin.h src/gtkprefs.c src/plugin.c
diffstat 4 files changed, 35 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkplugin.c	Tue Jul 01 12:43:39 2003 +0000
+++ b/src/gtkplugin.c	Wed Jul 02 06:00:22 2003 +0000
@@ -21,6 +21,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include "gtkplugin.h"
+#include "debug.h"
+#include "prefs.h"
+
 #include <string.h>
 
 GtkWidget *
@@ -41,3 +44,27 @@
 
 	return ui_info->get_config_frame(plugin);
 }
+
+void
+gaim_gtk_plugins_save(void)
+{
+	GList *pl;
+	GList *files = NULL;
+	GaimPlugin *p;
+
+	for (pl = gaim_plugins_get_loaded(); pl != NULL; pl = pl->next) {
+		p = pl->data;
+
+		if (p->info->type != GAIM_PLUGIN_PROTOCOL &&
+			p->info->type != GAIM_PLUGIN_LOADER) {
+
+			files = g_list_append(files, p->path);
+
+			gaim_debug(GAIM_DEBUG_INFO, "gtkplugin",
+					   "Adding %s to save list.\n", p->path);
+		}
+	}
+
+	gaim_prefs_set_string_list("/gaim/gtk/plugins/loaded", files);
+	g_list_free(files);
+}
--- a/src/gtkplugin.h	Tue Jul 01 12:43:39 2003 +0000
+++ b/src/gtkplugin.h	Wed Jul 02 06:00:22 2003 +0000
@@ -58,4 +58,9 @@
  */
 GtkWidget *gaim_gtk_plugin_get_config_frame(GaimPlugin *plugin);
 
+/**
+ * Saves all loaded plugins.
+ */
+void gaim_gtk_plugins_save(void);
+
 #endif /* _GAIM_GTK_PLUGIN_H_ */
--- a/src/gtkprefs.c	Tue Jul 01 12:43:39 2003 +0000
+++ b/src/gtkprefs.c	Wed Jul 02 06:00:22 2003 +0000
@@ -1704,6 +1704,8 @@
 	
 	gtk_label_set_markup(GTK_LABEL(plugin_description), buf);
 	gtk_tree_path_free(path);
+
+	gaim_gtk_plugins_save();
 }
 
 static void
@@ -2811,6 +2813,7 @@
 	gaim_prefs_add_bool("/gaim/gtk/logging/individual_logs", FALSE);
 
 	/* Plugins */
+	gaim_prefs_add_string_list("/gaim/gtk/plugins", NULL);
 	gaim_prefs_add_string_list("/gaim/gtk/plugins/loaded", NULL);
 
 	/* Smiley Themes */
--- a/src/plugin.c	Tue Jul 01 12:43:39 2003 +0000
+++ b/src/plugin.c	Wed Jul 02 06:00:22 2003 +0000
@@ -130,26 +130,6 @@
 
 #endif /* GAIM_PLUGINS */
 
-static void
-update_plugin_prefs(void)
-{
-	GList *pl;
-	GList *files = NULL;
-	GaimPlugin *p;
-
-	for (pl = gaim_plugins_get_loaded(); pl != NULL; pl = pl->next) {
-		p = pl->data;
-
-		if(p->info->type != GAIM_PLUGIN_PROTOCOL &&
-				p->info->type != GAIM_PLUGIN_LOADER) {
-			files = g_list_append(files, p->path);
-		}
-	}
-
-	gaim_prefs_set_string_list("/plugins/loaded", files);
-	g_list_free(files);
-}
-
 static gint
 compare_prpl(GaimPlugin *a, GaimPlugin *b)
 {
@@ -299,7 +279,6 @@
 	}
 
 	loaded_plugins = g_list_append(loaded_plugins, plugin);
-	update_plugin_prefs();
 
 	plugin->loaded = TRUE;
 
@@ -321,7 +300,6 @@
 	g_return_val_if_fail(plugin != NULL, FALSE);
 
 	loaded_plugins = g_list_remove(loaded_plugins, plugin);
-	update_plugin_prefs();
 
 	g_return_val_if_fail(gaim_plugin_is_loaded(plugin), FALSE);