Commits

Yuya Nishihara committed 200d293

reporegistry: handle showPaths like other QAction settings

  • Participants
  • Parent commits ee2b858

Comments (0)

Files changed (1)

tortoisehg/hgqt/reporegistry.py

         # Allow repo registry to assemble itself before toggling path state
         sp = s.value(wb + 'showPaths').toBool()
         sact['showPaths'].setChecked(sp)
-        QTimer.singleShot(0, lambda: self.showPaths(sp))
+        QTimer.singleShot(0, self._updateColumnVisibility)
 
     def _saveSettings(self):
         s = QSettings()
 
     def _setupSettingActions(self):
         settingtable = [
-            ('showPaths', _('Show Paths'), self.showPaths),
+            ('showPaths', _('Show Paths'), self._updateColumnVisibility),
             ('showSubrepos', _('Show Subrepos on Registry'), self.reloadModel),
             ('showNetworkSubrepos', _('Show Subrepos for remote repositories'),
              self.reloadModel),
             # and scrolling to it if necessary
             self.scrollTo(it)
 
-    def showPaths(self, show):
+    @pyqtSlot()
+    def _updateColumnVisibility(self):
+        show = self._isSettingEnabled('showPaths')
         self.tview.setColumnHidden(1, not show)
         self.tview.setHeaderHidden(not show)
         if show: