[Commits] [SCM] claws branch, master, updated. 3.11.1-41-g9f4528e
claws at claws-mail.org
claws at claws-mail.org
Tue Dec 9 11:47:06 CET 2014
The branch, master has been updated
via 9f4528e13ec256b719d4d9cbd1c5a836f69aee0b (commit)
from e19ba17f9461f3bd5840ba9646bf00121dfefc63 (commit)
Summary of changes:
src/compose.c | 10 ++++++++++
1 file changed, 10 insertions(+)
- Log -----------------------------------------------------------------
commit 9f4528e13ec256b719d4d9cbd1c5a836f69aee0b
Author: Paul <paul at claws-mail.org>
Date: Tue Dec 9 10:46:49 2014 +0000
when cancelling a msg written with an external editor, get rid of the draft copy. thanks to Darko Koruga.
diff --git a/src/compose.c b/src/compose.c
index 8f51d55..8f89975 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -9379,6 +9379,8 @@ static gboolean compose_input_cb(GIOChannel *source, GIOCondition condition,
if (buf[0] == '0') { /* success */
GtkTextView *text = GTK_TEXT_VIEW(compose->text);
GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
+ GtkTextIter start, end;
+ gchar *chars;
gtk_text_buffer_set_text(buffer, "", -1);
compose_insert_file(compose, compose->exteditor_file);
@@ -9387,6 +9389,14 @@ static gboolean compose_input_cb(GIOChannel *source, GIOCondition condition,
if (claws_unlink(compose->exteditor_file) < 0)
FILE_OP_ERROR(compose->exteditor_file, "unlink");
+
+ buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(compose->text));
+ gtk_text_buffer_get_start_iter(buffer, &start);
+ gtk_text_buffer_get_end_iter(buffer, &end);
+ chars = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
+ if (chars && strlen(chars) > 0)
+ compose->modified = TRUE;
+ g_free(chars);
} else if (buf[0] == '1') { /* failed */
g_warning("Couldn't exec external editor\n");
if (claws_unlink(compose->exteditor_file) < 0)
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list