aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-migrate.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-10 03:47:46 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-10 03:47:46 +0800
commit733ac62d82bab03f3cc32e042cfa56a5e3138869 (patch)
tree0c74a76cae3184f2f3041289649dce830a4d33a8 /mail/em-migrate.c
parent154d0ce43fbf4ef89a7068ccde99db8cef933c69 (diff)
downloadgsoc2013-evolution-733ac62d82bab03f3cc32e042cfa56a5e3138869.tar.gz
gsoc2013-evolution-733ac62d82bab03f3cc32e042cfa56a5e3138869.tar.zst
gsoc2013-evolution-733ac62d82bab03f3cc32e042cfa56a5e3138869.zip
Don't bother adding the autogen sig here, e-signature-list.c handles this
2004-04-09 Jeffrey Stedfast <fejj@ximian.com> * mail-config.c (mail_config_init): Don't bother adding the autogen sig here, e-signature-list.c handles this now. * em-migrate.c (em_upgrade_accounts_1_4): Migrate the signature uids. Fixes bug #56726. svn path=/trunk/; revision=25404
Diffstat (limited to 'mail/em-migrate.c')
-rw-r--r--mail/em-migrate.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index d2cd7f31f3..e84309006c 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -55,6 +55,7 @@
#include "e-util/e-bconf-map.h"
#include "e-util/e-account-list.h"
+#include "e-util/e-signature-list.h"
#include "mail-config.h"
#include "em-utils.h"
@@ -1842,6 +1843,33 @@ em_upgrade_xml_1_4 (xmlDocPtr doc, gboolean vfolders_xml)
return upgrade_xml_uris (doc, upgrade_xml_uris_1_4);
}
+static char *
+get_nth_sig (int id)
+{
+ ESignatureList *list;
+ ESignature *sig;
+ EIterator *iter;
+ char *uid = NULL;
+ int i = 0;
+
+ list = mail_config_get_signatures ();
+ iter = e_list_get_iterator ((EList *) list);
+
+ while (e_iterator_is_valid (iter) && i < id) {
+ e_iterator_next (iter);
+ i++;
+ }
+
+ if (i == id && e_iterator_is_valid (iter)) {
+ sig = (ESignature *) e_iterator_get (iter);
+ uid = g_strdup (sig->uid);
+ }
+
+ g_object_unref (iter);
+
+ return uid;
+}
+
static int
em_upgrade_accounts_1_4 (void)
{
@@ -1868,6 +1896,14 @@ em_upgrade_accounts_1_4 (void)
account->sent_folder_uri = url;
}
+ if (account->id->sig_uid && !strncmp (account->id->sig_uid, "::", 2)) {
+ int sig_id;
+
+ sig_id = strtol (account->id->sig_uid + 2, NULL, 10);
+ g_free (account->id->sig_uid);
+ account->id->sig_uid = get_nth_sig (sig_id);
+ }
+
e_iterator_next (iter);
}