mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 22:43:41 +02:00
Don't start a search if there is nothing to search for.
This commit is contained in:
parent
a827ea3ada
commit
673385edf8
1 changed files with 8 additions and 1 deletions
|
|
@ -48,9 +48,16 @@ def do_search(self, checked=False):
|
|||
self.running_threads = []
|
||||
self.results = Queue()
|
||||
self.abort = Event()
|
||||
# Clear the visible results.
|
||||
self.results_view.model().clear_results()
|
||||
|
||||
# Don't start a search if there is nothing to search for.
|
||||
query = unicode(self.search_edit.text())
|
||||
if not query.strip():
|
||||
return
|
||||
|
||||
for n in self.store_plugins:
|
||||
t = SearchThread(unicode(self.search_edit.text()), (n, self.store_plugins[n]), self.results, self.abort, self.TIMEOUT)
|
||||
t = SearchThread(query, (n, self.store_plugins[n]), self.results, self.abort, self.TIMEOUT)
|
||||
self.running_threads.append(t)
|
||||
t.start()
|
||||
if self.running_threads:
|
||||
|
|
|
|||
Loading…
Reference in a new issue