changeset 5665:132a30783c3d

[gaim-migrate @ 6081] We're going to shuffle around the init sequence in main.c again. Importing accounts should no longer screw things up, and there's better protection against invalid protocol IDs causing an account to have to be hand-editted. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 02 Jun 2003 10:21:33 +0000
parents 7867ae4836ac
children 44870684dba3
files src/account.c src/main.c
diffstat 2 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/account.c	Mon Jun 02 10:10:37 2003 +0000
+++ b/src/account.c	Mon Jun 02 10:21:33 2003 +0000
@@ -33,6 +33,7 @@
 
 #include "account.h"
 #include "prefs.h"
+#include "prpl.h"
 
 typedef enum
 {
@@ -248,10 +249,21 @@
 void
 gaim_account_set_protocol(GaimAccount *account, GaimProtocol protocol)
 {
+	GaimPlugin *plugin;
+
 	g_return_if_fail(account != NULL);
 
+	plugin = gaim_find_prpl(protocol);
+
+	g_return_if_fail(plugin != NULL);
+
 	account->protocol = protocol;
 
+	if (account->protocol_id != NULL)
+		g_free(account->protocol_id);
+
+	account->protocol_id = g_strdup(plugin->info->id);
+
 	schedule_accounts_save();
 }
 
--- a/src/main.c	Mon Jun 02 10:10:37 2003 +0000
+++ b/src/main.c	Mon Jun 02 10:21:33 2003 +0000
@@ -887,13 +887,6 @@
 	gaim_prefs_init();
 	gaim_gtk_prefs_init();
 
-	if (!gaim_prefs_load()) {
-		load_prefs();
-		gaim_prefs_sync();
-	}
-
-	gaim_gtk_debug_init();
-
 	plugin_search_paths[0] = LIBDIR;
 	plugin_search_paths[1] = gaim_user_dir();
 	plugin_search_paths[2] = g_strdup_printf("%s/plugins", gaim_user_dir());
@@ -906,6 +899,13 @@
 
 	gaim_plugins_probe(NULL);
 
+	if (!gaim_prefs_load()) {
+		load_prefs();
+		gaim_prefs_sync();
+	}
+
+	gaim_gtk_debug_init();
+
 	gaim_accounts_load();
 
 #ifdef _WIN32