aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/em-migrate.c36
-rw-r--r--mail/mail-config.c11
3 files changed, 44 insertions, 11 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 50c773abc0..6b2f7b6bc3 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
2004-04-09 Chris Toshok <toshok@ximian.com>
* importers/pine-importer.c (import_contact): use
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);
}
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 54a19d049d..93aaa4f99d 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -315,9 +315,7 @@ gconf_mime_types_changed (GConfClient *client, guint cnxn_id,
void
mail_config_init (void)
{
- ESignature *sig = NULL;
char *filename;
- EIterator *it;
if (config)
return;
@@ -358,15 +356,6 @@ mail_config_init (void)
config->accounts = e_account_list_new (config->gconf);
config->signatures = e_signature_list_new (config->gconf);
-
- /* if the list is empty, add an "Autogenerated" signature item */
- it = e_list_get_iterator ((EList *) config->signatures);
- if (!e_iterator_is_valid (it)) {
- sig = e_signature_new ();
- sig->name = g_strdup ("Autogenerated");
- sig->autogen = TRUE;
- mail_config_add_signature (sig);
- }
}