CppTools: Rework handling of ProjectInfo changes

(a) The code model manager figures out by itself which files were added
    or removed from the project.

    If this was done successfully, check also the timestamp of the
    common files and reindex if necessary.

(b) A full reindexing is only triggered if the project configuration
    changes (defines, includes, framework paths).

(c) If project files were removed, the garbage collector is called.

Task-number: QTCREATORBUG-9730
Change-Id: Ib855614b070880576233a3525813617c967a72f3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-07-10 14:46:08 +02:00
parent 74a94e656e
commit 8ea14767af
8 changed files with 418 additions and 33 deletions

View File

@@ -72,7 +72,7 @@ public:
virtual QList<ProjectInfo> projectInfos() const;
virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const;
virtual QFuture<void> updateProjectInfo(const ProjectInfo &pinfo);
virtual QFuture<void> updateProjectInfo(const ProjectInfo &newProjectInfo);
virtual QList<CppTools::ProjectPart::Ptr> projectPart(const QString &fileName) const;
virtual CPlusPlus::Snapshot snapshot() const;
@@ -141,6 +141,8 @@ public:
return m_definedMacros;
}
static QStringList timeStampModifiedFiles(const QList<Document::Ptr> documentsToCheck);
signals:
void aboutToRemoveFiles(const QStringList &files);
void gcFinished(); // Needed for tests.
@@ -160,6 +162,9 @@ private slots:
private:
void delayedGC();
void replaceSnapshot(const CPlusPlus::Snapshot &newSnapshot);
void removeFilesFromSnapshot(const QSet<QString> &removedFiles);
void removeProjectInfoFilesAndIncludesFromSnapshot(const ProjectInfo &projectInfo);
WorkingCopy buildWorkingCopyList();
void ensureUpdated();