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