Fix regression that broke searching in the highlights panel

This commit is contained in:
Kovid Goyal 2020-09-08 08:10:43 +05:30
parent 98c80431c7
commit ce41a1f32c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -249,7 +249,6 @@ class Highlights(QTreeWidget):
return self.num_of_items return self.num_of_items
def find_query(self, query): def find_query(self, query):
cr = self.currentRow()
pat = query.regex pat = query.regex
items = tuple(self.iteritems()) items = tuple(self.iteritems())
count = len(items) count = len(items)
@ -257,7 +256,8 @@ class Highlights(QTreeWidget):
ch = self.current_highlight ch = self.current_highlight
if ch: if ch:
q = ch['uuid'] q = ch['uuid']
for i, h in enumerate(items): for i, item in enumerate(items):
h = item.data(0, Qt.UserRole)
if h['uuid'] == q: if h['uuid'] == q:
cr = i cr = i
if query.backwards: if query.backwards: