commit ea4011632f33c8ccc5929ffc157e3f6255fe9d95
parent 4b9f6e2b6316a1efff97dc3f41836cfeeb04e220
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Tue, 13 Dec 2016 00:55:24 +0100
Honor autosave_encrypted preference when using external editor.
Patch by Ashish Gupta <ashmew2@gmail.com>.
Diffstat:
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/compose.c b/src/compose.c
@@ -9493,6 +9493,14 @@ static gboolean compose_ext_editor_kill(Compose *compose)
return TRUE;
}
+static gboolean compose_can_autosave(Compose *compose)
+{
+ if (compose->privacy_system && compose->use_encryption)
+ return prefs_common.autosave && prefs_common.autosave_encrypted;
+ else
+ return prefs_common.autosave;
+}
+
static gboolean compose_input_cb(GIOChannel *source, GIOCondition condition,
gpointer data)
{
@@ -9521,7 +9529,10 @@ static gboolean compose_input_cb(GIOChannel *source, GIOCondition condition,
gtk_text_buffer_set_text(buffer, "", -1);
compose_insert_file(compose, compose->exteditor_file);
compose_changed_cb(NULL, compose);
- compose_draft((gpointer)compose, COMPOSE_AUTO_SAVE);
+
+ /* Check if we should save the draft or not */
+ if (compose_can_autosave(compose))
+ compose_draft((gpointer)compose, COMPOSE_AUTO_SAVE);
if (claws_unlink(compose->exteditor_file) < 0)
FILE_OP_ERROR(compose->exteditor_file, "unlink");
@@ -10382,14 +10393,6 @@ void compose_close_toolbar(Compose *compose)
compose_close_cb(NULL, compose);
}
-static gboolean compose_can_autosave(Compose *compose)
-{
- if (compose->privacy_system && compose->use_encryption)
- return prefs_common.autosave && prefs_common.autosave_encrypted;
- else
- return prefs_common.autosave;
-}
-
static void compose_close_cb(GtkAction *action, gpointer data)
{
Compose *compose = (Compose *)data;