aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-02-25 18:39:42 +0800
committerMilan Crha <mcrha@src.gnome.org>2009-02-25 18:39:42 +0800
commit9b965c07677ae03ef282163bdc8a0a270aececb0 (patch)
tree862824984205130437b447643d01c21e038a64d8
parentcfe3be08ff7f356bd5feedfdcfc63838f5fdd712 (diff)
downloadgsoc2013-evolution-9b965c07677ae03ef282163bdc8a0a270aececb0.tar
gsoc2013-evolution-9b965c07677ae03ef282163bdc8a0a270aececb0.tar.gz
gsoc2013-evolution-9b965c07677ae03ef282163bdc8a0a270aececb0.tar.bz2
gsoc2013-evolution-9b965c07677ae03ef282163bdc8a0a270aececb0.tar.lz
gsoc2013-evolution-9b965c07677ae03ef282163bdc8a0a270aececb0.tar.xz
gsoc2013-evolution-9b965c07677ae03ef282163bdc8a0a270aececb0.tar.zst
gsoc2013-evolution-9b965c07677ae03ef282163bdc8a0a270aececb0.zip
** Fix for bug #551470
2009-02-25 Milan Crha <mcrha@redhat.com> ** Fix for bug #551470 * e-composer-private.h: * e-msg-composer.c: (add_signature_delim), (get_signature_html), (set_editor_text): Do not force adding "-- \n" above the signature. svn path=/trunk/; revision=37322
-rw-r--r--composer/ChangeLog8
-rw-r--r--composer/e-composer-private.h2
-rw-r--r--composer/e-msg-composer.c24
3 files changed, 30 insertions, 4 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 3d731d7ed2..b05eae427f 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-25 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #551470
+
+ * e-composer-private.h:
+ * e-msg-composer.c: (add_signature_delim), (get_signature_html),
+ (set_editor_text): Do not force adding "-- \n" above the signature.
+
2009-02-12 Milan Crha <mcrha@redhat.com>
** Fix for bug #567089
diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h
index f68b32c414..ec6626e004 100644
--- a/composer/e-composer-private.h
+++ b/composer/e-composer-private.h
@@ -58,6 +58,8 @@
COMPOSER_GCONF_PREFIX "/request_receipt"
#define COMPOSER_GCONF_TOP_SIGNATURE_KEY \
COMPOSER_GCONF_PREFIX "/top_signature"
+#define COMPOSER_GCONF_NO_SIGNATURE_DELIM_KEY \
+ COMPOSER_GCONF_PREFIX "/no_signature_delim"
#define COMPOSER_GCONF_SEND_HTML_KEY \
COMPOSER_GCONF_PREFIX "/send_html"
#define COMPOSER_GCONF_SPELL_LANGUAGES_KEY \
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 12a33cea4f..f06dc85b72 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1266,6 +1266,19 @@ decode_signature_name (const gchar *name)
return dname;
}
+static gboolean
+add_signature_delim (void)
+{
+ gboolean res;
+ GConfClient *client = gconf_client_get_default ();
+
+ res = !gconf_client_get_bool (client, COMPOSER_GCONF_NO_SIGNATURE_DELIM_KEY, NULL);
+
+ g_object_unref (client);
+
+ return res;
+}
+
#define CONVERT_SPACES CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES
static gchar *
@@ -1274,7 +1287,7 @@ get_signature_html (EMsgComposer *composer)
EComposerHeaderTable *table;
gchar *text = NULL, *html = NULL;
ESignature *signature;
- gboolean format_html;
+ gboolean format_html, add_delim;
table = e_msg_composer_get_header_table (composer);
signature = e_composer_header_table_get_signature (table);
@@ -1282,6 +1295,8 @@ get_signature_html (EMsgComposer *composer)
if (!signature)
return NULL;
+ add_delim = add_signature_delim ();
+
if (!signature->autogen) {
if (!signature->filename)
return NULL;
@@ -1309,7 +1324,8 @@ get_signature_html (EMsgComposer *composer)
name = id->name ? camel_text_to_html (id->name, CONVERT_SPACES, 0) : NULL;
organization = id->organization ? camel_text_to_html (id->organization, CONVERT_SPACES, 0) : NULL;
- text = g_strdup_printf ("-- <BR>%s%s%s%s%s%s%s%s",
+ text = g_strdup_printf ("%s%s%s%s%s%s%s%s%s",
+ add_delim ? "-- <BR>" : "",
name ? name : "",
(address && *address) ? " &lt;<A HREF=\"mailto:" : "",
address ? address : "",
@@ -1342,7 +1358,7 @@ get_signature_html (EMsgComposer *composer)
"</TD></TR></TABLE>",
encoded_uid ? encoded_uid : "",
format_html ? "" : "<PRE>\n",
- format_html || (!strncmp ("-- \n", text, 4) || strstr (text, "\n-- \n")) ? "" : "-- \n",
+ format_html || !add_delim || (!strncmp ("-- \n", text, 4) || strstr (text, "\n-- \n")) ? "" : "-- \n",
text,
format_html ? "" : "</PRE>\n");
g_free (text);
@@ -1390,7 +1406,7 @@ set_editor_text (EMsgComposer *composer,
tmp = get_signature_html (composer);
if (tmp) {
/* Minimizing the damage. Make it just a part of the body instead of a signature */
- html = strstr (tmp, "-- \n");
+ html = add_signature_delim () ? strstr (tmp, "-- \n") : NULL;
if (html) {
/* That two consecutive - symbols followed by a space */
*(html+1) = ' ';