eric6/Debugger/VariablesViewer.py

branch
Variables Viewer
changeset 6979
c272ec33ea11
parent 6978
720247f98e1f
child 6988
87ad87ef1910
--- a/eric6/Debugger/VariablesViewer.py	Sat Apr 27 22:06:38 2019 +0200
+++ b/eric6/Debugger/VariablesViewer.py	Sat Apr 27 22:16:35 2019 +0200
@@ -349,7 +349,16 @@
             row = parent.parent.childs.index(parent)
             parentIdx = self.createIndex(row, 0, parent)
         
-        if itemStartIndex == -2:
+        if itemStartIndex == -3:
+            # Item doesn't exist any more
+            parentIdx = self.parent(parentIdx)
+            self.beginRemoveRows(parentIdx, row, row)
+            del parent.parent.childs[row]
+            self.endRemoveRows()
+            parent.parent.childCount -= 1
+            return
+            
+        elif itemStartIndex == -2:
             parent.currentCount = parent.absolutCount
             # Remove items which are left over at the end of child list
             self.__cleanupParentList(parent, parentIdx)
@@ -357,11 +366,11 @@
             
         elif itemStartIndex == -1:
             parent.methodCount = len(vlist)
-            parent.currentCount = parent.absolutCount
-            idx = parent.childCount
+            idx = parent.childCount = parent.currentCount + 1
+            parent.currentCount += 1 + len(vlist)
         else:
+            idx = parent.currentCount + 1
             parent.currentCount += len(vlist)
-            idx = itemStartIndex
         
         # Sort items for Python versions where dict doesn't retain order
         vlist.sort(key=lambda x: x[0])
@@ -481,6 +490,7 @@
         
         # Little quirk: Refresh all visible items to clear the changed marker
         if parentIdx == QModelIndex():
+            self.rootNode.currentCount = -1
             idxStart = self.index(0, 0, QModelIndex())
             idxEnd = self.index(0, 2, QModelIndex())
             self.dataChanged.emit(idxStart, idxEnd)

eric ide

mercurial