forked from qt-creator/qt-creator
CppEditor: Do not insert empty project part lists
... in CppModelManager::projectPart().
Amends 96c21b0e36
.
Change-Id: I7e0dac258a4b4576a6ab772cb7074068a1bea726
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -1653,7 +1653,10 @@ QList<ProjectPart::ConstPtr> CppModelManager::projectPart(const FilePath &fileNa
|
||||
}
|
||||
const FilePath canonicalPath = fileName.canonicalPath();
|
||||
QWriteLocker locker(&d->m_projectLock);
|
||||
auto it = d->m_fileToProjectParts.insert(fileName, d->m_fileToProjectParts.value(canonicalPath));
|
||||
const auto it = d->m_fileToProjectParts.constFind(canonicalPath);
|
||||
if (it == d->m_fileToProjectParts.constEnd())
|
||||
return {};
|
||||
d->m_fileToProjectParts.insert(fileName, it.value());
|
||||
return it.value();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user