Commits

Yuya Nishihara committed cadac03

mqdock: reorder code to rebuild queueListWidget for later change

  • Participants
  • Parent commits 4ce20a4

Comments (0)

Files changed (1)

tortoisehg/hgqt/mq.py

             self.queueListWidget.setCurrentItem(self.reselectPatchItem)
 
     def _reload(self):
-        item = self.queueListWidget.currentItem()
-        if item:
-            wasselected = item._thgpatch
-        else:
-            wasselected = None
-        self.queueListWidget.clear()
-
         if self.repo is None:
+            self.queueListWidget.clear()
             self.qqueueComboWidget.setEnabled(False)
             self.qqueueConfigBtn.setEnabled(False)
             self.guardSelBtn.setEnabled(False)
                           Qt.ItemIsEnabled)
             items.append(item)
 
+        item = self.queueListWidget.currentItem()
+        if item:
+            wasselected = item._thgpatch
+        else:
+            wasselected = None
+
+        self.queueListWidget.clear()
         for item in reversed(items):
             self.queueListWidget.addItem(item)
             if item._thgpatch == wasselected: