[gaim-migrate @ 11713]

Wed, 29 Dec 2004 22:48:59 +0000

author
Mark Doliner <markdoliner@pidgin.im>
date
Wed, 29 Dec 2004 22:48:59 +0000
changeset 10448
4415ffba12e9
parent 10447
887380ec66f5
child 10449
4174c2957405

[gaim-migrate @ 11713]
Fix the problem with accounts.xml being loaded before the plugins were
probed. This fixes the Yahoo! crash mentioned by the guy on gaim-devel
and a guy in #gaim, and a few other obscure problems.

Plugins are probed* by the core now instead of the UI. Less work for
UI implementors means less code duplication and makes it more likely
someone will write a new UI.

*Probing loads the PRPLs and any loader plugins (perl, tcl, etc.), and
makes plugin information available everywhere else.

src/account.c file | annotate | diff | comparison | revisions
src/core.c file | annotate | diff | comparison | revisions
src/debug.c file | annotate | diff | comparison | revisions
src/gtkdebug.c file | annotate | diff | comparison | revisions
src/gtkmain.c file | annotate | diff | comparison | revisions
src/plugin.h file | annotate | diff | comparison | revisions
--- a/src/account.c	Wed Dec 29 21:53:59 2004 +0000
+++ b/src/account.c	Wed Dec 29 22:48:59 2004 +0000
@@ -312,6 +312,10 @@
 			continue;
 
 		str_type = xmlnode_get_attrib(child, "type");
+		if (str_type == NULL)
+			/* Ignore this setting */
+			continue;
+
 		if (!strcmp(str_type, "string"))
 			type = GAIM_PREF_STRING;
 		else if (!strcmp(str_type, "int"))
--- a/src/core.c	Wed Dec 29 21:53:59 2004 +0000
+++ b/src/core.c	Wed Dec 29 22:48:59 2004 +0000
@@ -78,6 +78,8 @@
 	/* Initialize all static protocols. */
 	static_proto_init();
 
+	gaim_plugins_probe(NULL);
+
 	if (ops != NULL)
 	{
 		if (ops->ui_prefs_init != NULL)
@@ -136,7 +138,7 @@
 	gaim_prefs_uninit();
 	gaim_sound_uninit();
 
-	gaim_debug(GAIM_DEBUG_INFO, "main", "Unloading all plugins\n");
+	gaim_debug_info("main", "Unloading all plugins\n");
 	gaim_plugins_destroy_all();
 
 	ops = gaim_core_get_ui_ops();
--- a/src/debug.c	Wed Dec 29 21:53:59 2004 +0000
+++ b/src/debug.c	Wed Dec 29 22:48:59 2004 +0000
@@ -51,12 +51,12 @@
 
 	if (debug_enabled) {
 		gchar *arg_s, *ts_s;
-		gboolean timestamps;
 
 		arg_s = g_strdup_vprintf(format, args);
 
-		timestamps = gaim_prefs_get_bool("/core/debug/timestamps");;
-		if ((category != NULL) && (timestamps)) {
+		if ((category != NULL) &&
+			(gaim_prefs_exists("/core/debug/timestamps")) &&
+			(gaim_prefs_get_bool("/core/debug/timestamps"))) {
 			gchar mdate[64];
 
 			time_t mtime = time(NULL);
--- a/src/gtkdebug.c	Wed Dec 29 21:53:59 2004 +0000
+++ b/src/gtkdebug.c	Wed Dec 29 22:48:59 2004 +0000
@@ -513,4 +513,3 @@
 
 	return &handle;
 }
-
--- a/src/gtkmain.c	Wed Dec 29 21:53:59 2004 +0000
+++ b/src/gtkmain.c	Wed Dec 29 22:48:59 2004 +0000
@@ -75,6 +75,7 @@
 static SnDisplay *sn_display = NULL;
 #endif
 
+/* TODO: Get this out of here? */
 int docklet_count = 0;
 
 #if HAVE_SIGNAL_H
@@ -588,6 +589,13 @@
 		return 1;
 	}
 
+	/*
+	 * We're done piddling around with command line arguments.
+	 * Fire up this baby.
+	 */
+
+	gaim_debug_set_enabled(debug_enabled);
+
 #ifdef _WIN32
 	wgaim_init(hint);
 #endif
@@ -608,11 +616,6 @@
 		abort();
 	}
 
-	gaim_debug_set_enabled(debug_enabled);
-
-	/* TODO: Do this in gaim_core_init() instead of here */
-	gaim_plugins_probe(NULL);
-
 	/* TODO: Remove this check.  Maybe in 2005.  --KingAnt, 25 Jul 2004 */
 	gaimrc = g_build_filename(gaim_home_dir(), ".gaimrc", NULL);
 	accountsxml = g_build_filename(gaim_user_dir(), "accounts.xml", NULL);
--- a/src/plugin.h	Wed Dec 29 21:53:59 2004 +0000
+++ b/src/plugin.h	Wed Dec 29 22:48:59 2004 +0000
@@ -367,7 +367,7 @@
 /**
  * Add a new directory to search for plugins
  *
- * @param paths The new search path.
+ * @param path The new search path.
  */
 void gaim_plugins_add_search_path(const char *path);
 

mercurial