Yuya Nishihara  committed 29c46bc

reporegistry: postpone loading subrepos by QTimer

The other settings are cheap. They can be applied at the initial load
of RepoTreeModel.

Now the progress is displayed again.

  • Participants
  • Parent commits 1b21507

Comments (0)

Files changed (1)

File tortoisehg/hgqt/

+        self._loadSettings()
         sfile = settingsfilename()
+        # start without subrepos because loading them is expensive
         tv.setModel(repotreemodel.RepoTreeModel(sfile, self,
-            showSubrepos=self._isSettingEnabled('showSubrepos'),
-            showNetworkSubrepos=self._isSettingEnabled('showNetworkSubrepos')))
+            showSubrepos=False,
+            showNetworkSubrepos=self._isSettingEnabled('showNetworkSubrepos'),
+            showShortPaths=self._isSettingEnabled('showShortPaths')))
         # Setup a file system watcher to update the reporegistry
         # anytime it is modified by another thg instance
         self._pendingReloadModel = False
         self._activeTabRepo = None
-        self._loadSettings()
         QTimer.singleShot(0, self._initView)
     def _initView(self):
+        if self._isSettingEnabled('showSubrepos'):
+            self.reloadModel()  # delayed loading of subrepos
     def _loadSettings(self):
         defaultmap = {'showPaths': False, 'showSubrepos': True,
             action.setChecked(s.value(key, defaultmap[key]).toBool())
-        # Manually reload the model now, to apply the settings
-        self.reloadModel()
     def _saveSettings(self):
         s = QSettings()
         s.beginGroup('Workbench')  # for compatibility with old release