aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-signature-list.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-13 01:43:33 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-13 01:43:33 +0800
commit739cb175076f824663a308a217fd797896988cff (patch)
tree595671144edde0e6d6b25c2c4ebbb27fbc57e744 /e-util/e-signature-list.c
parent85c5b26c407159e9bba4ad4d5e8e14a103a1d188 (diff)
downloadgsoc2013-evolution-739cb175076f824663a308a217fd797896988cff.tar.gz
gsoc2013-evolution-739cb175076f824663a308a217fd797896988cff.tar.zst
gsoc2013-evolution-739cb175076f824663a308a217fd797896988cff.zip
Really fixes bug #56623
2004-04-12 Jeffrey Stedfast <fejj@ximian.com> Really fixes bug #56623 * e-signature-list.c (gconf_signatures_changed): If we've had to "fix" any signatures by adding a uid, set the resave state on the list (only cared about if this is at initial load time). (e_signature_list_construct): If we've set any uids in signatures_changed(), then save the signature list back out. svn path=/trunk/; revision=25416
Diffstat (limited to 'e-util/e-signature-list.c')
-rw-r--r--e-util/e-signature-list.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/e-util/e-signature-list.c b/e-util/e-signature-list.c
index 90a8cd70f1..8f651f54df 100644
--- a/e-util/e-signature-list.c
+++ b/e-util/e-signature-list.c
@@ -27,6 +27,8 @@
#include <string.h>
+#include "e-uid.h"
+
#include "e-util-marshal.h"
#include "e-signature-list.h"
@@ -34,6 +36,7 @@
struct _ESignatureListPrivate {
GConfClient *gconf;
guint notify_id;
+ gboolean resave;
};
enum {
@@ -167,6 +170,7 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry,
ESignatureList *signature_list = user_data;
GSList *list, *l, *n, *new_sigs = NULL;
gboolean have_autogen = FALSE;
+ gboolean resave = FALSE;
ESignature *signature;
EList *old_sigs;
EIterator *iter;
@@ -204,11 +208,17 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry,
if (!have_autogen) {
add_autogen (signature_list);
have_autogen = TRUE;
+ resave = TRUE;
}
if (!found) {
/* Must be a new signature */
signature = e_signature_new_from_xml (l->data);
+ if (!signature->uid) {
+ signature->uid = e_uid_new ();
+ resave = TRUE;
+ }
+
e_list_append (E_LIST (signature_list), signature);
new_sigs = g_slist_prepend (new_sigs, signature);
}
@@ -219,6 +229,7 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry,
if (!have_autogen) {
add_autogen (signature_list);
have_autogen = TRUE;
+ resave = TRUE;
}
if (new_sigs != NULL) {
@@ -243,6 +254,8 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry,
g_object_unref (iter);
g_object_unref (old_sigs);
+
+ signature_list->priv->resave = resave;
}
static void *
@@ -311,6 +324,11 @@ e_signature_list_construct (ESignatureList *signature_list, GConfClient *gconf)
gconf_signatures_changed (signature_list->priv->gconf,
signature_list->priv->notify_id,
NULL, signature_list);
+
+ if (signature_list->priv->resave) {
+ e_signature_list_save (signature_list);
+ signature_list->priv->resave = FALSE;
+ }
}
@@ -422,7 +440,6 @@ e_signature_list_find (ESignatureList *signatures, e_signature_find_t type, cons
{
const ESignature *signature = NULL;
EIterator *it;
- char *val;
/* this could use a callback for more flexibility ...
... but this makes the common cases easier */
@@ -437,7 +454,6 @@ e_signature_list_find (ESignatureList *signatures, e_signature_find_t type, cons
signature = (const ESignature *) e_iterator_get (it);
- val = NULL;
switch (type) {
case E_SIGNATURE_FIND_NAME:
found = strcmp (signature->name, key) == 0;