changeset 19838:dfa608a9c36e

fix issue when saving a new modified file while closing * file-editor-tab.cc (show_dialog): fix wrong window modality; (check_file_modified): removed not working code for bringing tab on top; (save_file_as): show modal dialog for saving unnamed files * file-editor.cc (check_closing): removed obsolete code
author Torsten <ttl@justmail.de>
date Sat, 21 Feb 2015 14:46:43 +0100
parents 415864f5b85f
children 0093b9987ee0
files libgui/src/m-editor/file-editor-tab.cc libgui/src/m-editor/file-editor.cc
diffstat 2 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Sat Feb 21 13:33:28 2015 +0100
+++ b/libgui/src/m-editor/file-editor-tab.cc	Sat Feb 21 14:46:43 2015 +0100
@@ -1236,7 +1236,7 @@
     dlg->exec ();
   else
     {
-      dlg->setWindowModality (Qt::WindowModal);
+      dlg->setWindowModality (Qt::NonModal);
       dlg->show ();
     }
 }
@@ -1247,9 +1247,6 @@
   int decision = QMessageBox::Yes;
   if (_edit_area->isModified ())
     {
-      activateWindow ();
-      raise ();
-      setFocus ();
       // File is modified but not saved, ask user what to do.  The file
       // editor tab can't be made parent because it may be deleted depending
       // upon the response.  Instead, change the _edit_area to read only.
@@ -1628,7 +1625,7 @@
                this, SLOT (handle_save_file_as_answer (const QString&)));
     }
 
-  show_dialog (fileDialog, false);
+  show_dialog (fileDialog, ! valid_file_name ());
 }
 
 void
--- a/libgui/src/m-editor/file-editor.cc	Sat Feb 21 13:33:28 2015 +0100
+++ b/libgui/src/m-editor/file-editor.cc	Sat Feb 21 14:46:43 2015 +0100
@@ -83,7 +83,7 @@
        p != editor_tab_map.end (); p++)
     {
       QString file_name = p->first;
-      if (!file_name.isEmpty () && file_name.at (file_name.size () - 1) != '/')
+      if (!file_name.isEmpty ())
         fetFileNames.append (p->first);  // do not append unnamed files
     }