diff options
author | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-02-19 04:26:22 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-02-19 04:26:22 +0800 |
commit | b6b8dc64442a51921ac8067af9a69b007c2fb876 (patch) | |
tree | 22798abde391778e559b78d79d4ab0723b16d6dd /mail/mail-config.c | |
parent | 2f46886814d35618ad234e474a00a6ca977a13c3 (diff) | |
download | gsoc2013-evolution-b6b8dc64442a51921ac8067af9a69b007c2fb876.tar.gz gsoc2013-evolution-b6b8dc64442a51921ac8067af9a69b007c2fb876.tar.zst gsoc2013-evolution-b6b8dc64442a51921ac8067af9a69b007c2fb876.zip |
fixes to my last commit
svn path=/trunk/; revision=19933
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r-- | mail/mail-config.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c index 418959f2df..02a72ea672 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -606,29 +606,28 @@ mail_config_get_default_account (void) uid = gconf_client_get_string (config->gconf, "/apps/evolution/mail/default_account", NULL); iter = e_list_get_iterator ((EList *) config->accounts); - - while (e_iterator_is_valid (iter)) { - account = (EAccount *) e_iterator_get (iter); - - if (!strcmp (account->uid, uid)) { - g_object_unref (iter); - g_free (uid); + if (uid != NULL) { + while (e_iterator_is_valid (iter)) { + account = (EAccount *) e_iterator_get (iter); - return account; + if (!strcmp (account->uid, uid)) { + g_object_unref (iter); + g_free (uid); + + return account; + } + + e_iterator_next (iter); } - e_iterator_next (iter); - } - - if (account == NULL) { - /* Looks like we have no default, so make the first account - the default */ - e_iterator_reset (iter); - account = (EAccount *) e_iterator_get (iter); - - gconf_client_set_string (config->gconf, "/apps/evolution/mail/default_account", account->uid, NULL); + g_free (uid); } + /* Looks like we have no default, so make the first account + the default */ + e_iterator_reset (iter); + account = (EAccount *) e_iterator_get (iter); + gconf_client_set_string (config->gconf, "/apps/evolution/mail/default_account", account->uid, NULL); g_object_unref (iter); return account; |