mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 03:56:13 +02:00
...
This commit is contained in:
parent
24ea3c4327
commit
ec8b8bbe69
1 changed files with 9 additions and 3 deletions
|
|
@ -55,7 +55,7 @@ def __init__(self):
|
|||
self.cover_pool.start_threads()
|
||||
self.details_pool = DetailsThreadPool(DetailsThread, 4)
|
||||
self.details_pool.start_threads()
|
||||
|
||||
|
||||
self.sort_col = 2
|
||||
self.sort_order = Qt.AscendingOrder
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ def get_result(self, index):
|
|||
return self.matches[row]
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def has_results(self):
|
||||
return len(self.matches) > 0
|
||||
|
||||
|
|
@ -221,7 +221,12 @@ def sort(self, col, order, reset=True):
|
|||
self.reset()
|
||||
|
||||
def reorder_matches(self):
|
||||
self.matches = sorted(self.matches, key=lambda x: self.all_matches.index(x))
|
||||
def keygen(x):
|
||||
try:
|
||||
return self.all_matches.index(x)
|
||||
except:
|
||||
return 100000
|
||||
self.matches = sorted(self.matches, key=keygen)
|
||||
|
||||
|
||||
class SearchFilter(SearchQueryParser):
|
||||
|
|
@ -327,5 +332,6 @@ def get_matches(self, location, query):
|
|||
matches.add(sr)
|
||||
break
|
||||
except ValueError: # Unicode errors
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return matches
|
||||
|
|
|
|||
Loading…
Reference in a new issue