mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
24ea3c4327
commit
ec8b8bbe69
@ -55,7 +55,7 @@ class Matches(QAbstractItemModel):
|
|||||||
self.cover_pool.start_threads()
|
self.cover_pool.start_threads()
|
||||||
self.details_pool = DetailsThreadPool(DetailsThread, 4)
|
self.details_pool = DetailsThreadPool(DetailsThread, 4)
|
||||||
self.details_pool.start_threads()
|
self.details_pool.start_threads()
|
||||||
|
|
||||||
self.sort_col = 2
|
self.sort_col = 2
|
||||||
self.sort_order = Qt.AscendingOrder
|
self.sort_order = Qt.AscendingOrder
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ class Matches(QAbstractItemModel):
|
|||||||
return self.matches[row]
|
return self.matches[row]
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def has_results(self):
|
def has_results(self):
|
||||||
return len(self.matches) > 0
|
return len(self.matches) > 0
|
||||||
|
|
||||||
@ -221,7 +221,12 @@ class Matches(QAbstractItemModel):
|
|||||||
self.reset()
|
self.reset()
|
||||||
|
|
||||||
def reorder_matches(self):
|
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):
|
class SearchFilter(SearchQueryParser):
|
||||||
@ -327,5 +332,6 @@ class SearchFilter(SearchQueryParser):
|
|||||||
matches.add(sr)
|
matches.add(sr)
|
||||||
break
|
break
|
||||||
except ValueError: # Unicode errors
|
except ValueError: # Unicode errors
|
||||||
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return matches
|
return matches
|
||||||
|
Loading…
x
Reference in New Issue
Block a user