CompilationDatabase: Add folders to Project view

Change-Id: I4cd480535c203aa923b27596ea4ca74f83c12a9e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-10-30 14:21:34 +01:00
parent 595824d17b
commit 7f67e987ea
3 changed files with 92 additions and 26 deletions

View File

@@ -346,6 +346,13 @@ QString FileUtils::resolvePath(const QString &baseDir, const QString &fileName)
return QDir::cleanPath(baseDir + QLatin1Char('/') + fileName);
}
FileName FileUtils::commonPath(const FileName &oldCommonPath, const FileName &fileName)
{
FileName newCommonPath = oldCommonPath;
while (!newCommonPath.isEmpty() && !fileName.isChildOf(newCommonPath))
newCommonPath = newCommonPath.parentDir();
return canonicalPath(newCommonPath);
}
QByteArray FileReader::fetchQrc(const QString &fileName)
{