# HG changeset patch # User Christian Hammond # Date 1054549293 0 # Node ID 132a30783c3d1dcf4b69ca78fcf1356b8ebd5543 # Parent 7867ae4836acf8efb1ecf300969f2c5497045404 [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 diff -r 7867ae4836ac -r 132a30783c3d src/account.c --- 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(); } diff -r 7867ae4836ac -r 132a30783c3d src/main.c --- 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