[geary/wip/uidplus-drafts-726665: 2/3] Check flag when saving drafts



commit 307bea77c447a0f7711cfa530274efa6c6f11cb0
Author: Charles Lindsay <chaz yorba org>
Date:   Wed Mar 19 15:11:01 2014 -0700

    Check flag when saving drafts

 src/client/composer/composer-window.vala |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/client/composer/composer-window.vala b/src/client/composer/composer-window.vala
index d0a83e4..222d0a9 100644
--- a/src/client/composer/composer-window.vala
+++ b/src/client/composer/composer-window.vala
@@ -667,8 +667,16 @@ public class ComposerWindow : Gtk.Window {
         update_from_field();
     }
     
-    public bool should_close() {
+    private bool can_save() {
         if (!editor.can_undo())
+            return false;
+        if (drafts_folder != null && drafts_folder.properties.create_never_returns_id)
+            return false;
+        return true;
+    }
+
+    public bool should_close() {
+        if (!can_save())
             return true;
         
         present();
@@ -1555,7 +1563,7 @@ public class ComposerWindow : Gtk.Window {
     
     // Resets the draft save timeout.
     private void reset_draft_timer() {
-        if (!editor.can_undo())
+        if (!can_save())
             return;
         
         draft_save_label.label = "";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]