CppTools: Move ProjectPart in its own header file

Also extracting inline HeaderPath class and change projects list in vector
because the size is  larger than a pointer.

Change-Id: I885fdff3fe9bccc877634d1615249755f5b674fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2016-01-13 14:12:15 +01:00
parent 42d570a3fe
commit 2b4cadf1fe
34 changed files with 532 additions and 372 deletions

View File

@@ -142,7 +142,7 @@ public:
// The members below are cached/(re)calculated from the projects and/or their project parts
bool m_dirty;
QStringList m_projectFiles;
ProjectPart::HeaderPaths m_headerPaths;
ProjectPartHeaderPaths m_headerPaths;
QByteArray m_definedMacros;
// Editor integration
@@ -412,16 +412,16 @@ QStringList CppModelManager::internalProjectFiles() const
return files;
}
ProjectPart::HeaderPaths CppModelManager::internalHeaderPaths() const
ProjectPartHeaderPaths CppModelManager::internalHeaderPaths() const
{
ProjectPart::HeaderPaths headerPaths;
ProjectPartHeaderPaths headerPaths;
QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(d->m_projectToProjectsInfo);
while (it.hasNext()) {
it.next();
const ProjectInfo pinfo = it.value();
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
foreach (const ProjectPart::HeaderPath &path, part->headerPaths) {
const ProjectPart::HeaderPath hp(QDir::cleanPath(path.path), path.type);
foreach (const ProjectPartHeaderPath &path, part->headerPaths) {
const ProjectPartHeaderPath hp(QDir::cleanPath(path.path), path.type);
if (!headerPaths.contains(hp))
headerPaths += hp;
}
@@ -1168,7 +1168,7 @@ QStringList CppModelManager::projectFiles()
return d->m_projectFiles;
}
ProjectPart::HeaderPaths CppModelManager::headerPaths()
ProjectPartHeaderPaths CppModelManager::headerPaths()
{
QMutexLocker locker(&d->m_projectMutex);
ensureUpdated();
@@ -1176,7 +1176,7 @@ ProjectPart::HeaderPaths CppModelManager::headerPaths()
return d->m_headerPaths;
}
void CppModelManager::setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths)
void CppModelManager::setHeaderPaths(const ProjectPartHeaderPaths &headerPaths)
{
QMutexLocker locker(&d->m_projectMutex);
d->m_headerPaths = headerPaths;