diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index fcbce895bf57ec096c1cd8733f2b5bbd4a611760..a55a9e95eb1f23893ad0637f9420a775f5cf9ed8 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -466,6 +466,12 @@ static void find_helper(QFutureInterface<Utils::FileSearchResult> &future, future.setProgressRange(0, files.size()); for (int i = 0; i < files.size(); ++i) { + if (future.isPaused()) + future.waitForResume(); + + if (future.isCanceled()) + break; + const QString &fileName = files.at(i); future.setProgressValueAndText(i, QFileInfo(fileName).fileName()); diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 8aa6bdf767254cbae5a8387f25739bb8415f653e..4d5f0bd2c4de513f7bc178c0ed119a0405736501 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -56,6 +56,8 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/progressmanager/progressmanager.h> +#include <extensionsystem/pluginmanager.h> + #include <utils/qtcassert.h> #include <TranslationUnit.h> @@ -588,6 +590,13 @@ Document::Ptr CppPreprocessor::switchDocument(Document::Ptr doc) } +CppTools::CppModelManagerInterface *CppTools::CppModelManagerInterface::instance() +{ + ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance(); + return pluginManager->getObject<CppTools::CppModelManagerInterface>(); + +} + /*! \class CppTools::CppModelManager diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.h b/src/plugins/cpptools/cppmodelmanagerinterface.h index 0a2ba32e3808361550b774cbc8acd42cea339bc1..4bb7a109cb4b0163ffb82916b9c275bd13b49466 100644 --- a/src/plugins/cpptools/cppmodelmanagerinterface.h +++ b/src/plugins/cpptools/cppmodelmanagerinterface.h @@ -81,6 +81,8 @@ public: CppModelManagerInterface(QObject *parent = 0) : QObject(parent) {} virtual ~CppModelManagerInterface() {} + static CppModelManagerInterface *instance(); + virtual void GC() = 0; virtual void updateSourceFiles(const QStringList &sourceFiles) = 0; diff --git a/src/plugins/cpptools/cppsemanticsearch.cpp b/src/plugins/cpptools/cppsemanticsearch.cpp index 9d35f7aed48c8846271210a02a2e1b5dc35af333..bc8510625bbe0c834a5dc61d802896a890ff441e 100644 --- a/src/plugins/cpptools/cppsemanticsearch.cpp +++ b/src/plugins/cpptools/cppsemanticsearch.cpp @@ -272,6 +272,12 @@ static void semanticSearch_helper(QFutureInterface<Utils::FileSearchResult> &fut int progress = 0; foreach (Document::Ptr doc, snapshot) { + if (future.isPaused()) + future.waitForResume(); + + if (future.isCanceled()) + break; + const QString fileName = doc->fileName(); QByteArray source;