Commit 6e5d4b89 authored by Eike Ziller's avatar Eike Ziller

CppTools/Editor: Use Utils::runAsync

Change-Id: Ifcc2a34e3478eb84f95221b79e39f7a670e6b2e0
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 6dbbc961
......@@ -43,9 +43,9 @@
#include <utils/proxyaction.h>
#include <utils/qtcassert.h>
#include <utils/runextensions.h>
#include <utils/tooltip/tooltip.h>
#include <QtConcurrentRun>
#include <QVarLengthArray>
using namespace CPlusPlus;
......@@ -256,7 +256,7 @@ void FunctionDeclDefLinkFinder::startFindLinkAt(
// handle the rest in a thread
m_watcher.reset(new QFutureWatcher<QSharedPointer<FunctionDeclDefLink> >());
connect(m_watcher.data(), SIGNAL(finished()), this, SLOT(onFutureDone()));
m_watcher->setFuture(QtConcurrent::run(&findLinkHelper, result, refactoringChanges));
m_watcher->setFuture(Utils::runAsync(findLinkHelper, result, refactoringChanges));
}
FunctionDeclDefLink::FunctionDeclDefLink()
......
......@@ -40,8 +40,8 @@
#include <cplusplus/TranslationUnit.h>
#include <utils/qtcassert.h>
#include <utils/runextensions.h>
#include <QtConcurrentRun>
#include <QTextBlock>
#include <QTextCursor>
#include <QTextEdit>
......@@ -350,7 +350,7 @@ void CppUseSelectionsUpdater::handleSymbolCaseAsynchronously(const Document::Ptr
m_findUsesCursorPosition = m_editorWidget->position();
const Params params = Params(m_editorWidget->textCursor(), document, snapshot);
m_findUsesWatcher->setFuture(QtConcurrent::run(&findUses, params));
m_findUsesWatcher->setFuture(Utils::runAsync(findUses, params));
}
void CppUseSelectionsUpdater::handleSymbolCaseSynchronously(const Document::Ptr document,
......
......@@ -203,9 +203,9 @@ BuiltinEditorDocumentProcessor::~BuiltinEditorDocumentProcessor()
void BuiltinEditorDocumentProcessor::run()
{
m_parserFuture = QtConcurrent::run(&runParser,
parser(),
CppModelManager::instance()->workingCopy());
m_parserFuture = Utils::runAsync(runParser,
parser(),
CppModelManager::instance()->workingCopy());
}
BaseEditorDocumentParser::Ptr BuiltinEditorDocumentProcessor::parser()
......
......@@ -353,7 +353,7 @@ QFuture<void> BuiltinIndexingSupport::refreshSourceFiles(const QSet<QString> &so
params.workingCopy = mgr->workingCopy();
params.sourceFiles = sourceFiles;
QFuture<void> result = QtConcurrent::run(&parse, params);
QFuture<void> result = Utils::runAsync(parse, params);
if (m_synchronizer.futures().size() > 10) {
QList<QFuture<void> > futures = m_synchronizer.futures();
......
......@@ -32,9 +32,9 @@
#include <cplusplus/TypeOfExpression.h>
#include <QSet>
#include <QFuture>
#include <QtConcurrentRun>
#include <QSet>
#include <QThreadPool>
namespace CppTools {
......
......@@ -365,7 +365,7 @@ void CppFindReferences::findAll_helper(SearchResult *search, Symbol *symbol,
SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
const WorkingCopy workingCopy = m_modelManager->workingCopy();
QFuture<Usage> result;
result = QtConcurrent::run(&find_helper, workingCopy, context, symbol);
result = Utils::runAsync(find_helper, workingCopy, context, symbol);
createWatcher(result, search);
FutureProgress *progress = ProgressManager::addTask(result, tr("Searching for Usages"),
......@@ -669,7 +669,7 @@ void CppFindReferences::findMacroUses(const Macro &macro, const QString &replace
}
QFuture<Usage> result;
result = QtConcurrent::run(&findMacroUses_helper, workingCopy, snapshot, macro);
result = Utils::runAsync(findMacroUses_helper, workingCopy, snapshot, macro);
createWatcher(result, search);
FutureProgress *progress = ProgressManager::addTask(result, tr("Searching for Usages"),
......
......@@ -200,8 +200,7 @@ void SemanticInfoUpdater::updateDetached(const SemanticInfo::Source source)
return;
}
d->m_future = QtConcurrent::run<SemanticInfoUpdaterPrivate, void, const SemanticInfo::Source>
(&SemanticInfoUpdaterPrivate::update_helper, d.data(), source);
d->m_future = Utils::runAsync(&SemanticInfoUpdaterPrivate::update_helper, d.data(), source);
}
SemanticInfo SemanticInfoUpdater::semanticInfo() const
......
......@@ -106,7 +106,7 @@ public:
const QScopedPointer<SymbolSearcher> symbolSearcher(
indexingSupport->createSymbolSearcher(searchParameters, QSet<QString>() << testFile));
QFuture<Core::SearchResultItem> search
= QtConcurrent::run(&SymbolSearcher::runSearch, symbolSearcher.data());
= Utils::runAsync(&SymbolSearcher::runSearch, symbolSearcher.data());
search.waitForFinished();
ResultDataList results = ResultData::fromSearchResultList(search.results());
QCOMPARE(results, expectedResults);
......
......@@ -145,7 +145,7 @@ void SymbolsFindFilter::startSearch(SearchResult *search)
SymbolSearcher *symbolSearcher = m_manager->indexingSupport()->createSymbolSearcher(parameters, projectFileNames);
connect(watcher, SIGNAL(finished()),
symbolSearcher, SLOT(deleteLater()));
watcher->setFuture(QtConcurrent::run(&SymbolSearcher::runSearch, symbolSearcher));
watcher->setFuture(Utils::runAsync(&SymbolSearcher::runSearch, symbolSearcher));
FutureProgress *progress = ProgressManager::addTask(watcher->future(), tr("Searching for Symbol"),
Core::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment