From c3f9d4cbc992a6abec040ef6c3f2c15de77a5b91 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 9 Apr 2004 17:55:21 +0000 Subject: If the autogen signature isn't in the list (or isn't the first in the 2004-04-09 Jeffrey Stedfast * 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. svn path=/trunk/; revision=25397 --- e-util/ChangeLog | 6 ++++++ e-util/e-signature-list.c | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 1c430aa365..ef53a1a481 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,9 @@ +2004-04-09 Jeffrey Stedfast + + * 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. + 2004-04-07 Jeffrey Stedfast Probably fixes bug #56623 and others? diff --git a/e-util/e-signature-list.c b/e-util/e-signature-list.c index 2ada5c45a7..c948dbf65b 100644 --- a/e-util/e-signature-list.c +++ b/e-util/e-signature-list.c @@ -149,12 +149,24 @@ e_signature_list_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); } +static void +add_autogen (ESignatureList *list) +{ + ESignature *autogen; + + autogen = e_signature_new (); + autogen->name = g_strdup ("Autogenerated"); + autogen->autogen = TRUE; + + e_list_append (E_LIST (list), autogen); +} static void gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) { ESignatureList *signature_list = user_data; GSList *list, *l, *n, *new_sigs = NULL; + gboolean have_autogen = FALSE; ESignature *signature; EList *old_sigs; EIterator *iter; @@ -179,6 +191,9 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, if (e_signature_set_from_xml (signature, l->data)) g_signal_emit (signature_list, signals[SIGNATURE_CHANGED], 0, signature); + if (!have_autogen) + have_autogen = signature->autogen; + break; } } @@ -186,6 +201,11 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, g_object_unref (iter); } + if (!have_autogen) { + add_autogen (signature_list); + have_autogen = TRUE; + } + if (!found) { /* Must be a new signature */ signature = e_signature_new_from_xml (l->data); @@ -196,6 +216,11 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, g_free (uid); } + if (!have_autogen) { + add_autogen (signature_list); + have_autogen = TRUE; + } + if (new_sigs != NULL) { /* Now emit signals for each added signature. */ l = g_slist_reverse (new_sigs); -- cgit v1.2.3