Add convenience functions for creating ProjectExplorer::HeaderPaths

Change-Id: I7b1f63caca6b70ba4ec1b1870b83cbf20aa6564a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-08-24 15:30:04 +02:00
parent 5805208cec
commit 25ff15a1fb
22 changed files with 116 additions and 122 deletions

View File

@@ -76,10 +76,8 @@ HeaderPath RawProjectPart::frameworkDetectionHeuristic(const HeaderPath &header)
{
QString path = trimTrailingSlashes(header.path);
if (path.endsWith(".framework")) {
path = path.left(path.lastIndexOf(QLatin1Char('/')));
return {path, HeaderPathType::Framework};
}
if (path.endsWith(".framework"))
return HeaderPath::makeFramework(path.left(path.lastIndexOf('/')));
return header;
}
@@ -123,8 +121,7 @@ void RawProjectPart::setHeaderPaths(const HeaderPaths &headerPaths)
void RawProjectPart::setIncludePaths(const QStringList &includePaths)
{
this->headerPaths = Utils::transform<QVector>(includePaths, [](const QString &path) {
HeaderPath hp(path, HeaderPathType::User);
return RawProjectPart::frameworkDetectionHeuristic(hp);
return RawProjectPart::frameworkDetectionHeuristic(HeaderPath::makeUser(path));
});
}