Utils: Port some FilePath part accessors to QStringView

Change-Id: Ib5cc262e44c73880b6538eed714365e3d685870a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
hjk
2022-08-04 13:35:42 +02:00
parent 66a9301bd9
commit 11648298c8
15 changed files with 83 additions and 49 deletions

View File

@@ -408,7 +408,7 @@ FilePath FileUtils::commonPath(const FilePaths &paths)
FilePath result;
// Common scheme
const QString &commonScheme = first.scheme();
const QStringView commonScheme = first.scheme();
auto sameScheme = [&commonScheme] (const FilePath &fp) {
return commonScheme == fp.scheme();
};
@@ -417,7 +417,7 @@ FilePath FileUtils::commonPath(const FilePaths &paths)
result.setScheme(commonScheme);
// Common host
const QString &commonHost = first.host();
const QStringView commonHost = first.host();
auto sameHost = [&commonHost] (const FilePath &fp) {
return commonHost == fp.host();
};