From 9c40dfea0dbd2c0691c52d65e93f7494f15346bd Mon Sep 17 00:00:00 2001 From: Albert S Date: Mon, 12 Aug 2019 22:59:05 +0200 Subject: [PATCH] mainwindow: wait till search is completed before launching new one --- gui/mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 415d3b8..816f67f 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -153,6 +153,8 @@ void MainWindow::lineEditReturnPressed() } //TODO: validate q; ui->lblSearchResults->setText("Searching..."); + searchWatcher.cancel(); + searchWatcher.waitForFinished(); QFuture> searchFuture = QtConcurrent::run([&, q]() { SqliteSearch searcher(db); return searcher.search(q);