changeset 10448:6a20307ef8dc

[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. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 29 Dec 2004 22:48:59 +0000
parents 6feef0a9098a
children 0349cb9aa5a4
files src/account.c src/core.c src/debug.c src/gtkdebug.c src/gtkmain.c src/plugin.h
diffstat 6 files changed, 19 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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);