diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-03-25 21:50:45 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-03-25 21:50:45 +0300 |
commit | f02d3ee6061a4db004208acc37c057c7c58e5957 (patch) | |
tree | 5d4f09c4293129f5c471ed23197768447b0d95f8 /src | |
parent | Show avatars in the completion popup (diff) | |
download | nheko-f02d3ee6061a4db004208acc37c057c7c58e5957.tar.xz |
Replace std::thread with QtConcurrent
Diffstat (limited to 'src')
-rw-r--r-- | src/TextInputWidget.cc | 7 |
1 files changed, 2 insertions, 5 deletions
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 <http://www.gnu.org/licenses/>. */ -#include <thread> - #include <QAbstractTextDocumentLayout> #include <QApplication> #include <QBuffer> @@ -29,6 +27,7 @@ #include <QMimeType> #include <QPainter> #include <QStyleOption> +#include <QtConcurrent> #include <variant.hpp> @@ -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<int, std::pair<std::string, std::string>> items; auto get_name = [](auto membership) { @@ -476,8 +475,6 @@ TextInputWidget::TextInputWidget(QWidget *parent) emit input_->resultsRetrieved(results); }); - - worker.detach(); }); sendMessageBtn_ = new FlatButton(this); |