Commits

Yuya Nishihara  committed 906df3b

fold graph role removal

  • Participants
  • Parent commits d8ee857

Comments (0)

Files changed (3)

File graphdele-portrenderer.diff

 diff --git a/tortoisehg/hgqt/repomodel.py b/tortoisehg/hgqt/repomodel.py
 --- a/tortoisehg/hgqt/repomodel.py
 +++ b/tortoisehg/hgqt/repomodel.py
-@@ -90,24 +90,6 @@ def get_color(n, ignore=()):
+@@ -76,8 +76,7 @@ ALLCOLUMNS = tuple(name for name, _text 
+ UNAPPLIED_PATCH_COLOR = '#999999'
+ HIDDENREV_COLOR = '#666666'
+ 
+-GraphRole = Qt.UserRole + 0
+-GraphNodeRole = Qt.UserRole + 1
++GraphNodeRole = Qt.UserRole + 0
+ 
+ def get_color(n, ignore=()):
+     """
+@@ -90,24 +89,6 @@ def get_color(n, ignore=()):
          colors = COLORS
      return colors[n % len(colors)]
  
  def _parsebranchcolors(value):
      r"""Parse tortoisehg.branchcolors setting
  
-@@ -200,8 +182,7 @@ class HgRepoListModel(QAbstractTableMode
+@@ -200,8 +181,7 @@ class HgRepoListModel(QAbstractTableMode
          self._cache = []
          self.graph = None
          self.timerHandle = None
          self.rowcount = 0
          self.repo = repo
          self.revset = revset
-@@ -393,149 +374,12 @@ class HgRepoListModel(QAbstractTableMode
+@@ -393,149 +373,12 @@ class HgRepoListModel(QAbstractTableMode
              self._branch_colors[branch] = get_color(len(self._branch_colors))
          return self._branch_colors[branch]
  
      def invalidateCache(self):
          self._cache = []
  
-@@ -619,8 +463,6 @@ class HgRepoListModel(QAbstractTableMode
+@@ -545,8 +388,7 @@ class HgRepoListModel(QAbstractTableMode
+         + [(Qt.ForegroundRole, c) for c in xrange(len(ALLCOLUMNS))]
+         + [(Qt.DecorationRole, DescColumn),
+            (Qt.DecorationRole, ChangesColumn),
+-           (Qt.FontRole, DescColumn),
+-           (GraphRole, GraphColumn)]))
++           (Qt.FontRole, DescColumn)]))
+ 
+     def data(self, index, role=Qt.DisplayRole):
+         if not index.isValid():
+@@ -619,8 +461,6 @@ class HgRepoListModel(QAbstractTableMode
                  font = QFont()
                  font.setBold(True)
                  return font

File repom-nographrole.diff

-# HG changeset patch
-# Date 1395569644 -32400
-# Parent 12e910f706b83c7df007d951e7c9c85eaa9d8383
-
-diff --git a/tortoisehg/hgqt/repomodel.py b/tortoisehg/hgqt/repomodel.py
---- a/tortoisehg/hgqt/repomodel.py
-+++ b/tortoisehg/hgqt/repomodel.py
-@@ -76,9 +76,8 @@ ALLCOLUMNS = tuple(name for name, _text 
- UNAPPLIED_PATCH_COLOR = '#999999'
- HIDDENREV_COLOR = '#666666'
- 
--GraphRole = Qt.UserRole + 0
--GraphNodeRole = Qt.UserRole + 1
--RawContextRole = Qt.UserRole + 2
-+GraphNodeRole = Qt.UserRole + 0
-+RawContextRole = Qt.UserRole + 1
- 
- def get_color(n, ignore=()):
-     """
-@@ -367,9 +366,8 @@ class HgRepoListModel(QAbstractTableMode
-     _roleoffsets = {
-         Qt.DisplayRole: 0,
-         Qt.ForegroundRole: len(ALLCOLUMNS),
--        GraphRole: len(ALLCOLUMNS) * 2,
-         GraphNodeRole: -1,  # no cache
--        RawContextRole: len(ALLCOLUMNS) * 2 + 1,
-+        RawContextRole: len(ALLCOLUMNS) * 2,
-         }
- 
-     def data(self, index, role=Qt.DisplayRole):
-@@ -403,7 +401,7 @@ class HgRepoListModel(QAbstractTableMode
-                                for _i in xrange(graphlen - cachelen))
-         data = self._cache[row]
-         offset = self._roleoffsets[role]
--        if role in (GraphRole, GraphNodeRole, RawContextRole):
-+        if role in (GraphNodeRole, RawContextRole):
-             idx = offset  # row-based
-         else:
-             idx = index.column() + offset
-@@ -439,8 +437,6 @@ class HgRepoListModel(QAbstractTableMode
-                 return nullvariant
-             if column in (GraphColumn, BranchColumn):
-                 return QVariant(QColor(self.namedbranch_color(ctx.branch())))
--        elif role == GraphRole:
--            return nullvariant  # TODO: delete
-         elif role == GraphNodeRole:
-             return gnode
-         elif role == RawContextRole:
 repom-graphcolor.diff
 repom-dataroles.diff
 graphdele-portrenderer.diff
-repom-nographrole.diff
 graphdele-roleref.diff
 graphdele-sizehint.diff
 graphdele-paintdirect.diff