aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-10 03:47:06 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-10 03:47:06 +0800
commit154d0ce43fbf4ef89a7068ccde99db8cef933c69 (patch)
tree271e0bebfbb08feb77596b2d477d709f588fb2a7 /e-util
parent2658330b37900a4d90775b2d61cf88983f8343a6 (diff)
downloadgsoc2013-evolution-154d0ce43fbf4ef89a7068ccde99db8cef933c69.tar
gsoc2013-evolution-154d0ce43fbf4ef89a7068ccde99db8cef933c69.tar.gz
gsoc2013-evolution-154d0ce43fbf4ef89a7068ccde99db8cef933c69.tar.bz2
gsoc2013-evolution-154d0ce43fbf4ef89a7068ccde99db8cef933c69.tar.lz
gsoc2013-evolution-154d0ce43fbf4ef89a7068ccde99db8cef933c69.tar.xz
gsoc2013-evolution-154d0ce43fbf4ef89a7068ccde99db8cef933c69.tar.zst
gsoc2013-evolution-154d0ce43fbf4ef89a7068ccde99db8cef933c69.zip
If we fail to set a sig_uid then try to extract the old style signature id
2004-04-09 Jeffrey Stedfast <fejj@ximian.com> * e-account.c (xml_set_identity): If we fail to set a sig_uid then try to extract the old style signature id and assume the migration code will fix us up (if not, nothing bad will happen anyway). svn path=/trunk/; revision=25403
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog4
-rw-r--r--e-util/e-account.c16
-rw-r--r--e-util/e-signature-list.c2
3 files changed, 21 insertions, 1 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index ef53a1a481..eb632ceb22 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,5 +1,9 @@
2004-04-09 Jeffrey Stedfast <fejj@ximian.com>
+ * e-account.c (xml_set_identity): If we fail to set a sig_uid then
+ try to extract the old style signature id and assume the migration
+ code will fix us up (if not, nothing bad will happen anyway).
+
* e-signature-list.c (gconf_signatures_changed): If the autogen
signature isn't in the list (or isn't the first in the list), add
it to the head of the list.
diff --git a/e-util/e-account.c b/e-util/e-account.c
index c899170e58..37132017f0 100644
--- a/e-util/e-account.c
+++ b/e-util/e-account.c
@@ -282,6 +282,22 @@ xml_set_identity (xmlNodePtr node, EAccountIdentity *id)
changed |= xml_set_content (node, &id->organization);
else if (!strcmp (node->name, "signature")) {
changed |= xml_set_prop (node, "uid", &id->sig_uid);
+ if (!id->sig_uid) {
+ /* set a fake sig uid so the migrate code can handle this */
+ gboolean autogen = FALSE;
+ int sig_id = 0;
+
+ xml_set_bool (node, "auto", &autogen);
+ xml_set_int (node, "default", &sig_id);
+
+ if (autogen) {
+ id->sig_uid = g_strdup ("::0");
+ changed = TRUE;
+ } else if (sig_id) {
+ id->sig_uid = g_strdup_printf ("::%d", sig_id + 1);
+ changed = TRUE;
+ }
+ }
}
}
diff --git a/e-util/e-signature-list.c b/e-util/e-signature-list.c
index c948dbf65b..90a8cd70f1 100644
--- a/e-util/e-signature-list.c
+++ b/e-util/e-signature-list.c
@@ -430,7 +430,7 @@ e_signature_list_find (ESignatureList *signatures, e_signature_find_t type, cons
if (!key)
return NULL;
- for (it = e_list_get_iterator ((EList *)signatures);
+ for (it = e_list_get_iterator ((EList *) signatures);
e_iterator_is_valid (it);
e_iterator_next (it)) {
int found = 0;