From f02d3ee6061a4db004208acc37c057c7c58e5957 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sun, 25 Mar 2018 21:50:45 +0300 Subject: [PATCH] Replace std::thread with QtConcurrent --- README.md | 1 + src/TextInputWidget.cc | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8c51bb88..375e893e 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Specifically there is support for: - Sending & receiving invites. - Sending & receiving files and emoji (inline widgets for images, audio and file messages). - Typing notifications. +- Username auto-completion. - Message & mention notifications. - Redacting messages. - Read receipts. 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);