Commits

Yuya Nishihara committed d1402c3

reporegistry: unify delayed slot of expand and initial showPaths setting

Originally showPaths (= _updateColumnVisibility) was postponed by QTimer,
so that resizeColumnToContents() is invoked after expand().

Now both showPaths() and expand() are handled by RepoRegistryView, it doesn't
need tricky separate QTimer instances.

Comments (0)

Files changed (1)

tortoisehg/hgqt/reporegistry.py

         tv.dropAccepted.connect(self.dropAccepted)
 
         self.createActions()
-        QTimer.singleShot(0, self.expand)
 
         # Setup a file system watcher to update the reporegistry
         # anytime it is modified by another thg instance
         self._activeTabRepo = None
 
         self._loadSettings()
+        QTimer.singleShot(0, self._initView)
+
+    @pyqtSlot()
+    def _initView(self):
+        self.expand()
+        self._updateColumnVisibility()
 
     def _loadSettings(self):
         s = QSettings()
         # Manually reload the model now, to apply the settings
         self.reloadModel()
 
-        # Allow repo registry to assemble itself before toggling path state
         sp = s.value(wb + 'showPaths').toBool()
         sact['showPaths'].setChecked(sp)
-        QTimer.singleShot(0, self._updateColumnVisibility)
 
     def _saveSettings(self):
         s = QSettings()