From 9e366165ae6a83402134379fcc150770338ddfb6 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Mon, 28 Sep 2009 19:19:03 +0200 Subject: [PATCH] Fixes NB#138240, do not delete content of the email body when switching between from: in accounts with and without signature --- src/hildon2/modest-msg-edit-window.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hildon2/modest-msg-edit-window.c b/src/hildon2/modest-msg-edit-window.c index b9e5022..b7d2d78 100644 --- a/src/hildon2/modest-msg-edit-window.c +++ b/src/hildon2/modest-msg-edit-window.c @@ -4059,6 +4059,8 @@ update_signature (ModestMsgEditWindow *self, &match_start, &match_end, NULL)) { iter = match_start; } + } else { + gtk_text_buffer_get_end_iter (priv->text_buffer, &iter); } g_free (signature); } @@ -4066,7 +4068,9 @@ update_signature (ModestMsgEditWindow *self, priv->last_from_account = modest_selector_picker_get_active_id (MODEST_SELECTOR_PICKER (priv->from_field)); signature = modest_account_mgr_get_signature_from_recipient (mgr, new_account, &has_new_signature); if (has_new_signature) { - gchar *full_signature = g_strconcat (MODEST_TEXT_UTILS_SIGNATURE_MARKER, "\n", + + gchar *full_signature = g_strconcat ((gtk_text_iter_starts_line (&iter)) ? "" : "\n", + MODEST_TEXT_UTILS_SIGNATURE_MARKER, "\n", signature, NULL); gtk_text_buffer_insert (priv->text_buffer, &iter, full_signature, -1); g_free (full_signature); -- 1.7.9.5