Commits

Yuya Nishihara committed 1edd572

up

  • Participants
  • Parent commits e869e4f

Comments (0)

Files changed (1)

File graphdele-invalidate.diff

 # HG changeset patch
 # Date 1403359351 -32400
-# Parent ddc25bf4420d413c5a42c207a4662f8eeeaf240b
-graphdelegate: add stub to invalidate cache
-
-TODO: call invalidate() on model change
+# Parent 0ef6ec0805ea13f404a64e360e277978e7204763
+graphdelegate: add stub to invalidate cache on model change
 
 diff --git a/tortoisehg/hgqt/repoview.py b/tortoisehg/hgqt/repoview.py
 --- a/tortoisehg/hgqt/repoview.py
  
          self.setAcceptDrops(True)
          if PYQT_VERSION >= 0x40700:
-@@ -167,6 +167,7 @@ class HgRepoView(QTreeView):
+@@ -166,7 +166,14 @@ class HgRepoView(QTreeView):
+             model.unicodestar = False
          if not QFontMetrics(self.font()).inFont(QString(u'\u2327').at(0)):
              model.unicodexinabox = False
++
++        model.dataChanged.connect(self._graphdelegate.invalidate)
++        model.layoutChanged.connect(self._graphdelegate.invalidate)
++        model.modelReset.connect(self._graphdelegate.invalidate)
++        model.rowsInserted.connect(self._graphdelegate.invalidate)
++        model.rowsRemoved.connect(self._graphdelegate.invalidate)
          self.selectionModel().currentRowChanged.connect(self.onRowChange)
 +        self._graphdelegate.invalidate()
          self._rev_history = []
          self._rev_pos = -1
          self._in_history = False
-@@ -439,6 +440,9 @@ class GraphDelegate(QStyledItemDelegate)
+@@ -439,6 +446,10 @@ class GraphDelegate(QStyledItemDelegate)
          fm = QFontMetrics(QFont())
          self._rowheight = max(fm.height() + 4, 16)
  
++    @pyqtSlot()
 +    def invalidate(self):
 +        pass
 +