diff options
author | hjk <hjk121@nokiamail.com> | 2014-09-11 13:15:44 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-09-19 11:11:30 +0200 |
commit | 9a968b74173625773fb00add5602a6385dafbf04 (patch) | |
tree | 40b868631af0aa27461a0ee59420c5d4ca31ccdd /src/libs/cplusplus/DependencyTable.cpp | |
parent | 0273757c937c1694bb25ad9bd3e78fb0afd4e969 (diff) | |
download | qt-creator-9a968b74173625773fb00add5602a6385dafbf04.tar.gz |
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>
Diffstat (limited to 'src/libs/cplusplus/DependencyTable.cpp')
-rw-r--r-- | src/libs/cplusplus/DependencyTable.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/libs/cplusplus/DependencyTable.cpp b/src/libs/cplusplus/DependencyTable.cpp index 7ce2c162e0..ad5ef8e018 100644 --- a/src/libs/cplusplus/DependencyTable.cpp +++ b/src/libs/cplusplus/DependencyTable.cpp @@ -27,7 +27,6 @@ ** ****************************************************************************/ -#include "DependencyTable.h" #include "CppDocument.h" #include <QDebug> @@ -51,50 +50,8 @@ QStringList DependencyTable::filesDependingOn(const QString &fileName) const return deps; } -QHash<QString, QStringList> DependencyTable::dependencyTable() const -{ - QHash<QString, QStringList> depMap; - - for (int index = 0; index < files.size(); ++index) { - QStringList deps; - for (int i = 0; i < files.size(); ++i) { - const QBitArray &bits = includeMap.at(i); - - if (bits.testBit(index)) - deps.append(files.at(i)); - } - depMap[files.at(index)] = deps; - } - - return depMap; -} - -bool DependencyTable::isValidFor(const Snapshot &snapshot) const -{ - const int documentCount = snapshot.size(); - if (documentCount != files.size()) - return false; - - for (Snapshot::const_iterator it = snapshot.begin(); it != snapshot.end(); ++it) { - QHash<QString, QStringList>::const_iterator i = includesPerFile.find(it.key()); - if (i == includesPerFile.end()) - return false; - - if (i.value() != it.value()->includedFiles()) - return false; - } - - return true; -} - void DependencyTable::build(const Snapshot &snapshot) { - includesPerFile.clear(); - files.clear(); - fileIndex.clear(); - includes.clear(); - includeMap.clear(); - const int documentCount = snapshot.size(); files.resize(documentCount); includeMap.resize(documentCount); |