218 |
218 |
219 @param sourceIndex reference to a source model index (QModelIndex) |
219 @param sourceIndex reference to a source model index (QModelIndex) |
220 @return proxy model index (QModelIndex) |
220 @return proxy model index (QModelIndex) |
221 """ |
221 """ |
222 self.__load() |
222 self.__load() |
223 url = unicode(sourceIndex.data(HistoryModel.UrlStringRole).toString()) |
223 url = sourceIndex.data(HistoryModel.UrlStringRole).toString() |
224 if url not in self.__historyDict: |
224 if url not in self.__historyDict: |
225 return QModelIndex() |
225 return QModelIndex() |
226 |
226 |
227 sourceOffset = self.sourceModel().rowCount() - sourceIndex.row() |
227 sourceOffset = self.sourceModel().rowCount() - sourceIndex.row() |
228 |
228 |
269 self.__historyDict = {} |
269 self.__historyDict = {} |
270 self.__scaleTime = QDateTime.currentDateTime() |
270 self.__scaleTime = QDateTime.currentDateTime() |
271 |
271 |
272 for sourceRow in range(self.sourceModel().rowCount()): |
272 for sourceRow in range(self.sourceModel().rowCount()): |
273 idx = self.sourceModel().index(sourceRow, 0) |
273 idx = self.sourceModel().index(sourceRow, 0) |
274 url = unicode(idx.data(HistoryModel.UrlStringRole).toString()) |
274 url = idx.data(HistoryModel.UrlStringRole).toString() |
275 if url not in self.__historyDict: |
275 if url not in self.__historyDict: |
276 sourceOffset = self.sourceModel().rowCount() - sourceRow |
276 sourceOffset = self.sourceModel().rowCount() - sourceRow |
277 self.__filteredRows.append( |
277 self.__filteredRows.append( |
278 HistoryData(sourceOffset, self.__frequencyScore(idx))) |
278 HistoryData(sourceOffset, self.__frequencyScore(idx))) |
279 self.__historyDict[url] = sourceOffset |
279 self.__historyDict[url] = sourceOffset |