mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-29 06:43:41 +02:00
Fix #1880379: Search in managing series has a bug
This commit is contained in:
parent
534afd82db
commit
25ed039ba8
1 changed files with 7 additions and 5 deletions
|
|
@ -21,12 +21,13 @@
|
|||
|
||||
class NameTableWidgetItem(QTableWidgetItem):
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, sort_key):
|
||||
QTableWidgetItem.__init__(self)
|
||||
self.initial_value = ''
|
||||
self.current_value = ''
|
||||
self.is_deleted = False
|
||||
self.is_placeholder = False
|
||||
self.sort_key = sort_key
|
||||
|
||||
def data(self, role):
|
||||
if role == Qt.DisplayRole:
|
||||
|
|
@ -79,10 +80,12 @@ def reset_placeholder(self):
|
|||
self.setText(self.text_before_placeholder)
|
||||
|
||||
def __ge__(self, other):
|
||||
return sort_key(unicode_type(self.text())) >= sort_key(unicode_type(other.text()))
|
||||
return (self.sort_key(unicode_type(self.text())) >=
|
||||
self.sort_key(unicode_type(other.text())))
|
||||
|
||||
def __lt__(self, other):
|
||||
return sort_key(unicode_type(self.text())) < sort_key(unicode_type(other.text()))
|
||||
return (self.sort_key(unicode_type(self.text())) <
|
||||
self.sort_key(unicode_type(other.text())))
|
||||
|
||||
|
||||
class CountTableWidgetItem(QTableWidgetItem):
|
||||
|
|
@ -204,7 +207,6 @@ def __init__(self, window, cat_name, tag_to_match, get_book_ids, sorter,
|
|||
ac = le.findChild(QAction, QT_HIDDEN_CLEAR_ACTION)
|
||||
if ac is not None:
|
||||
ac.triggered.connect(self.clear_search)
|
||||
le.returnPressed.connect(self.do_search)
|
||||
self.search_box.textChanged.connect(self.search_text_changed)
|
||||
self.search_button.clicked.connect(self.do_search)
|
||||
self.search_button.setDefault(True)
|
||||
|
|
@ -301,7 +303,7 @@ def fill_in_table(self, tags, tag_to_match, ttm_is_first_letter):
|
|||
|
||||
self.table.setRowCount(len(tags))
|
||||
for row,tag in enumerate(tags):
|
||||
item = NameTableWidgetItem()
|
||||
item = NameTableWidgetItem(self.sorter)
|
||||
item.set_is_deleted(self.all_tags[tag]['is_deleted'])
|
||||
_id = self.all_tags[tag]['key']
|
||||
item.setData(Qt.UserRole, _id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue