CMake: Fix project tree displaying "." folders

Task-number: QTCREATORBUG-14994
Change-Id: Iea5a820083b8fc1974a749992f937965285370b6
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Robert Loehning
2015-08-31 17:35:50 +02:00
committed by Daniel Teske
parent a80f4d179b
commit 0a1ad894d5

View File

@@ -467,6 +467,8 @@ ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *
FileName path = rootNode->path().parentDir();
QDir rootParentDir(path.toString());
QString relativePath = rootParentDir.relativeFilePath(directory);
if (relativePath == QLatin1String("."))
relativePath.clear();
QStringList parts = relativePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
ProjectExplorer::FolderNode *parent = rootNode;
foreach (const QString &part, parts) {