Commit 90c1c8f5 authored by dt's avatar dt

Cancel a previous update code model

parent ab8fc52d
...@@ -781,8 +781,8 @@ CppModelManager::WorkingCopy CppModelManager::workingCopy() const ...@@ -781,8 +781,8 @@ CppModelManager::WorkingCopy CppModelManager::workingCopy() const
return const_cast<CppModelManager *>(this)->buildWorkingCopyList(); return const_cast<CppModelManager *>(this)->buildWorkingCopyList();
} }
void CppModelManager::updateSourceFiles(const QStringList &sourceFiles) QFuture<void> CppModelManager::updateSourceFiles(const QStringList &sourceFiles)
{ (void) refreshSourceFiles(sourceFiles); } { return refreshSourceFiles(sourceFiles); }
QList<CppModelManager::ProjectInfo> CppModelManager::projectInfos() const QList<CppModelManager::ProjectInfo> CppModelManager::projectInfos() const
{ {
......
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
CppModelManager(QObject *parent); CppModelManager(QObject *parent);
virtual ~CppModelManager(); virtual ~CppModelManager();
virtual void updateSourceFiles(const QStringList &sourceFiles); virtual QFuture<void> updateSourceFiles(const QStringList &sourceFiles);
virtual WorkingCopy workingCopy() const; virtual WorkingCopy workingCopy() const;
virtual QList<ProjectInfo> projectInfos() const; virtual QList<ProjectInfo> projectInfos() const;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <QtCore/QHash> #include <QtCore/QHash>
#include <QtCore/QPointer> #include <QtCore/QPointer>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QFuture>
namespace ProjectExplorer { namespace ProjectExplorer {
class Project; class Project;
...@@ -128,7 +129,7 @@ public: ...@@ -128,7 +129,7 @@ public:
public Q_SLOTS: public Q_SLOTS:
void updateModifiedSourceFiles(); void updateModifiedSourceFiles();
virtual void updateSourceFiles(const QStringList &sourceFiles) = 0; virtual QFuture<void> updateSourceFiles(const QStringList &sourceFiles) = 0;
virtual void GC() = 0; virtual void GC() = 0;
}; };
......
...@@ -403,7 +403,7 @@ void Qt4Project::updateCodeModel() ...@@ -403,7 +403,7 @@ void Qt4Project::updateCodeModel()
if (debug) if (debug)
qDebug()<<"Qt4Project::updateCodeModel()"; qDebug()<<"Qt4Project::updateCodeModel()";
// TODO cancel still running indexing m_codeModelFuture.cancel();
if (!activeTarget() || !activeTarget()->activeBuildConfiguration()) if (!activeTarget() || !activeTarget()->activeBuildConfiguration())
return; return;
...@@ -576,7 +576,7 @@ void Qt4Project::updateCodeModel() ...@@ -576,7 +576,7 @@ void Qt4Project::updateCodeModel()
pinfo.precompiledHeaders = allPrecompileHeaders; pinfo.precompiledHeaders = allPrecompileHeaders;
modelmanager->updateProjectInfo(pinfo); modelmanager->updateProjectInfo(pinfo);
modelmanager->updateSourceFiles(pinfo.sourceFiles); m_codeModelFuture = modelmanager->updateSourceFiles(pinfo.sourceFiles);
} }
} }
......
...@@ -235,6 +235,7 @@ private: ...@@ -235,6 +235,7 @@ private:
QList<Internal::Qt4ProFileNode *> m_partialEvaluate; QList<Internal::Qt4ProFileNode *> m_partialEvaluate;
QMap<QString, Internal::CodeModelInfo> m_codeModelInfo; QMap<QString, Internal::CodeModelInfo> m_codeModelInfo;
QFuture<void> m_codeModelFuture;
friend class Qt4ProjectFile; friend class Qt4ProjectFile;
friend class Internal::Qt4ProjectConfigWidget; friend class Internal::Qt4ProjectConfigWidget;
......
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