1. TortoiseHg
  2. TortoiseHg
  3. thg


Yuya Nishihara  committed 09ac2bd

grep: give appropriate defaults to model APIs of MatchModel

  • Participants
  • Parent commits 5d93e52
  • Branches default

Comments (0)

Files changed (1)

File tortoisehg/hgqt/grep.py

View file
  • Ignore whitespace
         self.headers = (_('File'), _('Line'), _('Rev'), _('User'),
                         _('Match Text'))
-    def rowCount(self, parent):
+    def rowCount(self, parent=QModelIndex()):
         return len(self.rows)
-    def columnCount(self, parent):
+    def columnCount(self, parent=QModelIndex()):
         return len(self.headers)
-    def data(self, index, role):
+    def data(self, index, role=Qt.DisplayRole):
         if not index.isValid():
             return QVariant()
         if role == Qt.DisplayRole:
             return QVariant(self.rows[index.row()][index.column()])
         return QVariant()
-    def headerData(self, col, orientation, role):
+    def headerData(self, col, orientation, role=Qt.DisplayRole):
         if role != Qt.DisplayRole or orientation != Qt.Horizontal:
             return QVariant()