diff options
author | Milan Crha <mcrha@src.gnome.org> | 2007-08-13 15:27:27 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2007-08-13 15:27:27 +0800 |
commit | 7701d36a65aba3e183fe30e6a0818c5405eb1f46 (patch) | |
tree | 924b3a5c9f89d8505a700f3f356a5cd6e124c4d0 /mail/em-migrate.c | |
parent | 861f9931f9a80cbe85105bdf5c2d11b0b18faf17 (diff) | |
download | gsoc2013-evolution-7701d36a65aba3e183fe30e6a0818c5405eb1f46.tar.gz gsoc2013-evolution-7701d36a65aba3e183fe30e6a0818c5405eb1f46.tar.zst gsoc2013-evolution-7701d36a65aba3e183fe30e6a0818c5405eb1f46.zip |
2007-08-13 mcrha Fix for bug #352346
svn path=/trunk/; revision=33995
Diffstat (limited to 'mail/em-migrate.c')
-rw-r--r-- | mail/em-migrate.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/mail/em-migrate.c b/mail/em-migrate.c index 09aa497b61..82109a1f3c 100644 --- a/mail/em-migrate.c +++ b/mail/em-migrate.c @@ -2639,6 +2639,39 @@ em_migrate_1_4 (const char *evolution_dir, xmlDocPtr filters, xmlDocPtr vfolders return 0; } +static void +em_update_accounts_2_11 (void) +{ + EAccountList *accounts; + EIterator *iter; + gboolean changed = FALSE; + + if (!(accounts = mail_config_get_accounts ())) + return; + + iter = e_list_get_iterator ((EList *) accounts); + while (e_iterator_is_valid (iter)) { + EAccount *account = (EAccount *) e_iterator_get (iter); + + if (g_str_has_prefix (account->source->url, "spool://")) { + if (g_file_test (account->source->url + 8, G_FILE_TEST_IS_DIR)) { + char *str = g_strdup_printf ("spooldir://%s", account->source->url + 8); + + g_free (account->source->url); + account->source->url = str; + changed = TRUE; + } + } + + e_iterator_next (iter); + } + + g_object_unref (iter); + + if (changed) + mail_config_save_accounts (); +} + #endif static int @@ -2777,6 +2810,10 @@ em_migrate (const char *evolution_dir, int major, int minor, int revision, Camel g_free (path); } + + if (major < 2 || (major == 2 && minor < 12)) { + em_update_accounts_2_11 (); + } #endif /* !G_OS_WIN32 */ return 0; } |