mainwindow: wait till search is completed before launching new one
This commit is contained in:
parent
ae178e34e5
commit
9c40dfea0d
@ -153,6 +153,8 @@ void MainWindow::lineEditReturnPressed()
|
|||||||
}
|
}
|
||||||
//TODO: validate q;
|
//TODO: validate q;
|
||||||
ui->lblSearchResults->setText("Searching...");
|
ui->lblSearchResults->setText("Searching...");
|
||||||
|
searchWatcher.cancel();
|
||||||
|
searchWatcher.waitForFinished();
|
||||||
QFuture<QVector<SearchResult>> searchFuture = QtConcurrent::run([&, q]() {
|
QFuture<QVector<SearchResult>> searchFuture = QtConcurrent::run([&, q]() {
|
||||||
SqliteSearch searcher(db);
|
SqliteSearch searcher(db);
|
||||||
return searcher.search(q);
|
return searcher.search(q);
|
||||||
|
Loading…
Reference in New Issue
Block a user