From f02d3ee6061a4db004208acc37c057c7c58e5957 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sun, 25 Mar 2018 21:50:45 +0300 Subject: Replace std::thread with QtConcurrent --- src/TextInputWidget.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/TextInputWidget.cc b/src/TextInputWidget.cc index e184d8b4..fde4a061 100644 --- a/src/TextInputWidget.cc +++ b/src/TextInputWidget.cc @@ -15,8 +15,6 @@ * along with this program. If not, see . */ -#include - #include #include #include @@ -29,6 +27,7 @@ #include #include #include +#include #include @@ -437,7 +436,7 @@ TextInputWidget::TextInputWidget(QWidget *parent) if (q.isEmpty() || currState_.isNull()) return; - std::thread worker([this, q = q.toLower().toStdString()]() { + QtConcurrent::run([this, q = q.toLower().toStdString()]() { std::multimap> items; auto get_name = [](auto membership) { @@ -476,8 +475,6 @@ TextInputWidget::TextInputWidget(QWidget *parent) emit input_->resultsRetrieved(results); }); - - worker.detach(); }); sendMessageBtn_ = new FlatButton(this); -- cgit 1.4.1