Plugins/ViewManagerPlugins/Listspace/Listspace.py

changeset 560
0a621357b213
parent 525
400b72e2602a
child 791
9ec2ac20e54e
diff -r ee695ebbd6e0 -r 0a621357b213 Plugins/ViewManagerPlugins/Listspace/Listspace.py
--- a/Plugins/ViewManagerPlugins/Listspace/Listspace.py	Sat Sep 04 14:59:00 2010 +0200
+++ b/Plugins/ViewManagerPlugins/Listspace/Listspace.py	Sat Sep 04 18:52:07 2010 +0200
@@ -418,17 +418,18 @@
         @param editor editor window to be changed
         @param newName new name to be shown (string)
         """
-        currentRow = self.viewlist.currentRow()
-        index = self.editors.index(editor)
-        txt = os.path.basename(newName)
-        if not QFileInfo(newName).isWritable():
-            txt = self.trUtf8("{0} (ro)").format(txt)
-        itm = self.viewlist.item(index)
-        itm.setText(txt)
-        itm.setToolTip(newName)
-        self.viewlist.setCurrentRow(currentRow)
-        self.changeCaption.emit(newName)
-        
+        if newName:
+            currentRow = self.viewlist.currentRow()
+            index = self.editors.index(editor)
+            txt = os.path.basename(newName)
+            if not QFileInfo(newName).isWritable():
+                txt = self.trUtf8("{0} (ro)").format(txt)
+            itm = self.viewlist.item(index)
+            itm.setText(txt)
+            itm.setToolTip(newName)
+            self.viewlist.setCurrentRow(currentRow)
+            self.changeCaption.emit(newName)
+            
     def _modificationStatusChanged(self, m, editor):
         """
         Protected slot to handle the modificationStatusChanged signal.

eric ide

mercurial