aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-migrate.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-01-27 06:45:48 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-01-27 06:45:48 +0800
commit190eb88cdc6438875a4434030c60346480cf89b1 (patch)
treed1d35b9045e3f68439c2e3bab71197dee359d648 /mail/em-migrate.c
parentffb6a1d2292be2909273e276fba93951ee6276c5 (diff)
downloadgsoc2013-evolution-190eb88cdc6438875a4434030c60346480cf89b1.tar.gz
gsoc2013-evolution-190eb88cdc6438875a4434030c60346480cf89b1.tar.zst
gsoc2013-evolution-190eb88cdc6438875a4434030c60346480cf89b1.zip
Fixes for bug #53251.
2004-01-26 Jeffrey Stedfast <fejj@ximian.com> Fixes for bug #53251. * mail-account-gui.c (mail_account_gui_new): Convert the account drafts/sent folder uris to camel uris. (mail_account_gui_save): Convert drafts/sent camel uris into mailer uris when setting them on the account. Also, don't compare against file: anymore since those uris don't exist anymore. * em-migrate.c (em_upgrade_accounts_1_4): Update the drafts/sent folder uris. svn path=/trunk/; revision=24452
Diffstat (limited to 'mail/em-migrate.c')
-rw-r--r--mail/em-migrate.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index 6ef3a3acf6..7e81d66047 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -54,7 +54,9 @@
#include <gal/util/e-xml-utils.h>
#include "e-util/e-bconf-map.h"
+#include "e-util/e-account-list.h"
+#include "mail-config.h"
#include "mail-component.h" /* for em_uri_from_camel() */
#include "em-migrate.h"
#include "mail-vfolder.h"
@@ -1750,6 +1752,42 @@ em_upgrade_xml_1_4 (xmlDocPtr doc)
}
static int
+em_upgrade_accounts_1_4 (void)
+{
+ EAccountList *accounts;
+ EIterator *iter;
+
+ if (!(accounts = mail_config_get_accounts ()))
+ return 0;
+
+ iter = e_list_get_iterator ((EList *) accounts);
+ while (e_iterator_is_valid (iter)) {
+ EAccount *account = (EAccount *) e_iterator_get (iter);
+ char *url;
+
+ if (account->drafts_folder_uri) {
+ url = upgrade_xml_uris_1_4 (account->drafts_folder_uri);
+ g_free (account->drafts_folder_uri);
+ account->drafts_folder_uri = url;
+ }
+
+ if (account->sent_folder_uri) {
+ url = upgrade_xml_uris_1_4 (account->sent_folder_uri);
+ g_free (account->sent_folder_uri);
+ account->sent_folder_uri = url;
+ }
+
+ e_iterator_next (iter);
+ }
+
+ g_object_unref (iter);
+
+ mail_config_save_accounts ();
+
+ return 0;
+}
+
+static int
em_migrate_pop_uid_caches_1_4 (const char *evolution_dir, CamelException *ex)
{
GString *oldpath, *newpath;
@@ -2124,6 +2162,9 @@ em_migrate_1_4 (const char *evolution_dir, xmlDocPtr filters, xmlDocPtr vfolders
camel_object_unref (session);
+ if (em_upgrade_accounts_1_4 () == -1)
+ return -1;
+
if (em_upgrade_xml_1_4 (filters) == -1)
return -1;