Fixed issues with reopening a project where files were delete while they were opened in an editor.

Sat, 08 Feb 2014 20:09:58 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 08 Feb 2014 20:09:58 +0100
changeset 3261
b8fee972444b
parent 3260
37bbdfba30bc
child 3265
972d6be9dde7

Fixed issues with reopening a project where files were delete while they were opened in an editor.

QScintilla/Editor.py file | annotate | diff | comparison | revisions
ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
--- a/QScintilla/Editor.py	Wed Feb 05 19:09:29 2014 +0100
+++ b/QScintilla/Editor.py	Sat Feb 08 20:09:58 2014 +0100
@@ -6165,6 +6165,11 @@
             self.markerDeleteHandle(handle)
         self.breaks = {}
         
+        if not os.path.exists(self.fileName):
+            # close the file, if it was deleted in the background
+            self.close()
+            return
+        
         # reread the file
         try:
             self.readFile(self.fileName)
--- a/ViewManager/ViewManager.py	Wed Feb 05 19:09:29 2014 +0100
+++ b/ViewManager/ViewManager.py	Sat Feb 08 20:09:58 2014 +0100
@@ -4543,7 +4543,8 @@
         filenames = []
         for editor in self.editors:
             fn = editor.getFileName()
-            if fn is not None and fn not in filenames:
+            if fn is not None and fn not in filenames and os.path.exists(fn):
+                # only return names of existing files
                 filenames.append(fn)
         
         return filenames

eric ide

mercurial