From dbd121a0797fd3845eee7ffdd197def5212d8d31 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 12 Mar 2015 15:34:09 +0100 Subject: [PATCH] Set data of existing item. --- qutebrowser/completion/models/urlmodel.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qutebrowser/completion/models/urlmodel.py b/qutebrowser/completion/models/urlmodel.py index 05a5e57c8..2f6727895 100644 --- a/qutebrowser/completion/models/urlmodel.py +++ b/qutebrowser/completion/models/urlmodel.py @@ -78,13 +78,13 @@ class UrlCompletionModel(base.BaseCompletionModel): if item.url: if self._history.historyContains(item.url): for i in range(self._history_cat.rowCount()): - name = self._history_cat.child(i, 0) - if not name: + name_item = self._history_cat.child(i, 0) + atime_item = self._history_cat.child(i, 2) + if not name_item: continue - if name.text() == item.url: - self._history_cat.setChild( - i, 2, QStandardItem(self._fmt_atime(item.atime))) - name.setData(int(item.atime), base.Role.sort) + if name_item.text() == item.url: + atime_item.setText(self._fmt_atime(item.atime)) + name_item.setData(int(item.atime), base.Role.sort) break else: self.new_item(self._history_cat, item.url, "",