67 if index.column() == 1: |
67 if index.column() == 1: |
68 return self.tr( |
68 return self.tr( |
69 "%n item(s)", "", |
69 "%n item(s)", "", |
70 self.rowCount(index.sibling(index.row(), 0))) |
70 self.rowCount(index.sibling(index.row(), 0))) |
71 |
71 |
72 elif role == Qt.ItemDataRole.DecorationRole: |
72 elif ( |
73 if index.column() == 0 and not index.parent().isValid(): |
73 role == Qt.ItemDataRole.DecorationRole and |
74 return UI.PixmapCache.getIcon("history") |
74 index.column() == 0 and |
75 |
75 not index.parent().isValid() |
76 elif role == HistoryModel.DateRole: |
76 ): |
77 if index.column() == 0 and index.internalId() == 0: |
77 return UI.PixmapCache.getIcon("history") |
78 offset = self.__sourceDateRow(index.row()) |
78 |
79 idx = self.sourceModel().index(offset, 0) |
79 elif ( |
80 return idx.data(HistoryModel.DateRole) |
80 role == HistoryModel.DateRole and |
|
81 index.column() == 0 and |
|
82 index.internalId() == 0 |
|
83 ): |
|
84 offset = self.__sourceDateRow(index.row()) |
|
85 idx = self.sourceModel().index(offset, 0) |
|
86 return idx.data(HistoryModel.DateRole) |
81 |
87 |
82 return QAbstractProxyModel.data(self, index, role) |
88 return QAbstractProxyModel.data(self, index, role) |
83 |
89 |
84 def columnCount(self, parent=None): |
90 def columnCount(self, parent=None): |
85 """ |
91 """ |