define model before nested functions
[sface.git] / sface / rspecwindow.py
index 17bef6a..45c2508 100644 (file)
@@ -24,6 +24,8 @@ class RSpecView(QTreeView):
         self.collapseAll()
         self.expandToDepth(0)
 
+        model = self.model()
+
         def recursiveExpand(index):
             parent = index.parent()
             if parent and parent.isValid():
@@ -40,7 +42,6 @@ class RSpecView(QTreeView):
                 child_index = index.child(r, 0)
                 search(child_index)
             
-        model = self.model()
         root_rows = model.rowCount()
         for r in range(root_rows):
             index = model.index(r, 0)