CppTools: Move DependencyTable to Snapshot

It logically depends on the Snapshot and has a related lifetime.
Keeping it in the Snapshot avoids some code compelxity.

Change-Id: I24ee4483b44d9b0d7f2e4d494ae7ea624b949f9c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
hjk
2014-09-11 13:15:44 +02:00
parent 0273757c93
commit 9a968b7417
13 changed files with 35 additions and 133 deletions

View File

@@ -222,10 +222,6 @@ CppModelManager::CppModelManager(QObject *parent)
, m_enableGC(true)
{
qRegisterMetaType<QSet<QString> >();
connect(this, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
this, SIGNAL(globalSnapshotChanged()));
connect(this, SIGNAL(aboutToRemoveFiles(QStringList)),
this, SIGNAL(globalSnapshotChanged()));
connect(this, SIGNAL(sourceFilesRefreshed(QSet<QString>)),
this, SLOT(onSourceFilesRefreshed()));
@@ -731,9 +727,7 @@ QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) co
QList<ProjectPart::Ptr> CppModelManager::projectPartFromDependencies(const QString &fileName) const
{
QSet<ProjectPart::Ptr> parts;
DependencyTable table;
table.build(snapshot());
const QStringList deps = table.filesDependingOn(fileName);
const QStringList deps = snapshot().filesDependingOn(fileName);
foreach (const QString &dep, deps)
parts.unite(QSet<ProjectPart::Ptr>::fromList(m_fileToProjectParts.value(dep)));