changeset 15446:87c3704b5c7a

no tracking for modification of a new editor file without name * file-editor-tab.cc: check for UNNAMED_FILE before adding file name to the tracker list
author Torsten <ttl@justmail.de>
date Sun, 23 Sep 2012 20:00:44 +0200
parents 6823ad7a25b1
children 137de4fbeaf6
files libgui/src/m-editor/file-editor-tab.cc
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc
+++ b/libgui/src/m-editor/file-editor-tab.cc
@@ -145,11 +145,14 @@
 void
 file_editor_tab::set_file_name (const QString& fileName)
 {
-  // update tracked file
-  QStringList trackedFiles = _file_system_watcher.files ();
-  if (!trackedFiles.isEmpty ())
-    _file_system_watcher.removePath (_file_name);
-  _file_system_watcher.addPath (fileName);
+  if (fileName != UNNAMED_FILE)
+    {
+      // update tracked file if wie really hae a file on disk
+      QStringList trackedFiles = _file_system_watcher.files ();
+      if (!trackedFiles.isEmpty ())
+        _file_system_watcher.removePath (_file_name);
+        _file_system_watcher.addPath (fileName);
+    }
   _file_name = fileName;
 
   // update lexer after _file_name change