aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-10 01:55:21 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-10 01:55:21 +0800
commitc3f9d4cbc992a6abec040ef6c3f2c15de77a5b91 (patch)
tree20d8bda2f3701880ab23569b8df7ec681e956287 /e-util
parentb6df5e631e2dc8748febdaa4ea1291f6232a8e40 (diff)
downloadgsoc2013-evolution-c3f9d4cbc992a6abec040ef6c3f2c15de77a5b91.tar
gsoc2013-evolution-c3f9d4cbc992a6abec040ef6c3f2c15de77a5b91.tar.gz
gsoc2013-evolution-c3f9d4cbc992a6abec040ef6c3f2c15de77a5b91.tar.bz2
gsoc2013-evolution-c3f9d4cbc992a6abec040ef6c3f2c15de77a5b91.tar.lz
gsoc2013-evolution-c3f9d4cbc992a6abec040ef6c3f2c15de77a5b91.tar.xz
gsoc2013-evolution-c3f9d4cbc992a6abec040ef6c3f2c15de77a5b91.tar.zst
gsoc2013-evolution-c3f9d4cbc992a6abec040ef6c3f2c15de77a5b91.zip
If the autogen signature isn't in the list (or isn't the first in the
2004-04-09 Jeffrey Stedfast <fejj@ximian.com> * 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
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog6
-rw-r--r--e-util/e-signature-list.c25
2 files changed, 31 insertions, 0 deletions
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 <fejj@ximian.com>
+
+ * 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 <fejj@ximian.com>
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);