From 80940eeebd7318d62e8c690a7f7bf70f7cfe3eab Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 16 Jan 2003 19:41:56 +0000 Subject: Add a UID field (to match EAccount), which never changes and can be used * mail-config.h (MailConfigAccount): Add a UID field (to match EAccount), which never changes and can be used by gconf watchers to distinguish an account rename from a deletion and creation. * mail-config.c (account_copy): Create a new UID on the new account. (account_new_from_xml): Read the UID. (If it doesn't have one, make one.) (account_to_xml): Write the UID. * mail-config-druid.c (make_account): add a UID to each account svn path=/trunk/; revision=19496 --- mail/mail-config.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'mail/mail-config.c') diff --git a/mail/mail-config.c b/mail/mail-config.c index f9b3a56ca5..ae02d57616 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -54,6 +54,7 @@ #include #include +#include #include #include #include "mail.h" @@ -207,6 +208,7 @@ account_copy (const MailConfigAccount *account) new = g_new0 (MailConfigAccount, 1); new->name = g_strdup (account->name); + new->uid = e_account_gen_uid (); new->enabled = account->enabled; @@ -242,6 +244,7 @@ account_destroy (MailConfigAccount *account) return; g_free (account->name); + g_free (account->uid); identity_destroy (account->id); service_destroy (account->source); @@ -355,8 +358,13 @@ account_new_from_xml (char *in) account = g_new0 (MailConfigAccount, 1); account->name = xml_get_prop (node, "name"); + account->uid = xml_get_prop (node, "uid"); account->enabled = xml_get_bool (node, "enabled"); + /* temporary pre-1.4 back compat */ + if (!account->uid) + account->uid = e_account_gen_uid (); + node = node->children; while (node != NULL) { if (!strcmp (node->name, "identity")) { @@ -428,7 +436,7 @@ account_new_from_xml (char *in) account->pgp_encrypt_to_self = xml_get_bool (node, "encrypt-to-self"); account->pgp_always_trust = xml_get_bool (node, "always-trust"); account->pgp_always_sign = xml_get_bool (node, "always-sign"); - account->pgp_no_imip_sign = !xml_get_bool (node, "sign-imip"); + account->pgp_no_imip_sign = xml_get_bool (node, "no-imip-sign"); if (node->children) { cur = node->children; @@ -480,6 +488,7 @@ account_to_xml (MailConfigAccount *account) xmlDocSetRootElement (doc, root); xmlSetProp (root, "name", account->name); + xmlSetProp (root, "uid", account->uid); xmlSetProp (root, "enabled", account->enabled ? "true" : "false"); id = xmlNewChild (root, NULL, "identity", NULL); @@ -528,7 +537,7 @@ account_to_xml (MailConfigAccount *account) xmlSetProp (node, "encrypt-to-self", account->pgp_encrypt_to_self ? "true" : "false"); xmlSetProp (node, "always-trust", account->pgp_always_trust ? "true" : "false"); xmlSetProp (node, "always-sign", account->pgp_always_sign ? "true" : "false"); - xmlSetProp (node, "sign-imip", !account->pgp_no_imip_sign ? "true" : "false"); + xmlSetProp (node, "no-imip-sign", account->pgp_no_imip_sign ? "true" : "false"); if (account->pgp_key) xmlNewTextChild (node, NULL, "key-id", account->pgp_key); -- cgit v1.2.3