[gedit] FileSaveAll: Only save modified documents



commit a3120f3a0e77f4d87ce15e1cf7edf7463cf231ac
Author: Volker Sobek <reklov live com>
Date:   Fri Nov 22 17:33:18 2013 +0100

    FileSaveAll: Only save modified documents
    
    _gedit_cmd_file_save_documents_list: Move the check if saving is
    needed, so it applies to all documents, not just untitled and readonly
    ones.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=379778

 gedit/gedit-commands-file.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 66a9b69..63b9e9e 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -1026,20 +1026,20 @@ _gedit_cmd_file_save_documents_list (GeditWindow *window,
                    (state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW) ||
                    (state == GEDIT_TAB_STATE_GENERIC_NOT_EDITABLE))
                {
-                       /* FIXME: manage the case of local readonly files owned by the
-                          user is running gedit - Paolo (Dec. 8, 2005) */
-                       if (gedit_document_is_untitled (doc) ||
-                           gedit_document_get_readonly (doc))
+                       if (_gedit_document_needs_saving (doc))
                        {
-                               if (_gedit_document_needs_saving (doc))
-                               {
-                                       tabs_to_save_as = g_slist_prepend (tabs_to_save_as,
+                               /* FIXME: manage the case of local readonly files owned by the
+                                  user is running gedit - Paolo (Dec. 8, 2005) */
+                               if (gedit_document_is_untitled (doc) ||
+                                   gedit_document_get_readonly (doc))
+                               {
+                                       tabs_to_save_as = g_slist_prepend (tabs_to_save_as,
                                                                           t);
-                               }
-                       }
-                       else
-                       {
-                               _gedit_cmd_file_save_tab (t, window);
+                               }
+                               else
+                               {
+                                       _gedit_cmd_file_save_tab (t, window);
+                               }
                        }
                }
                else


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