diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 0ee14ab5ff5..93e1aab014d 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -139,6 +139,7 @@ #include #include #include +#include #include /*! @@ -368,6 +369,7 @@ public: #ifdef WITH_JOURNALD JournaldWatcher *m_journalWatcher; #endif + QThreadPool m_threadPool; }; ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() : @@ -1852,6 +1854,11 @@ void ProjectExplorerPlugin::updateContextMenuActions() dd->updateContextMenuActions(); } +QThreadPool *ProjectExplorerPlugin::sharedThreadPool() +{ + return &(dd->m_threadPool); +} + /*! This function is connected to the ICore::coreOpened signal. If there was no session explicitly loaded, it creates an empty new diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index d9aef1e31e2..82aa38e98f1 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -37,6 +37,7 @@ QT_BEGIN_NAMESPACE class QPoint; class QAction; +class QThreadPool; QT_END_NAMESPACE namespace Core { @@ -154,6 +155,8 @@ public: static void updateContextMenuActions(); + static QThreadPool *sharedThreadPool(); + private: static bool coreAboutToClose(); diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index aa74485653a..2808a6dd602 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -1800,7 +1800,9 @@ void QmakeProFileNode::asyncUpdate() m_readerExact->setExact(false); m_parseFutureWatcher.waitForFinished(); EvalInput input = evalInput(); - QFuture future = QtConcurrent::run(&QmakeProFileNode::asyncEvaluate, this, input); + QFuture future = Utils::runAsync(ProjectExplorerPlugin::sharedThreadPool(), + &QmakeProFileNode::asyncEvaluate, + this, input); m_parseFutureWatcher.setFuture(future); }