forked from qt-creator/qt-creator
Utils: Replace FilePath part setters
... by a combined version. This will make it easier to store the parts in one QString object. Change-Id: Ie85a77e3957c78a30e49998fe2e617af35a8ad17 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -392,7 +392,7 @@ FilePath FileUtils::commonPath(const FilePaths &paths)
|
||||
};
|
||||
if (!allOf(others, sameScheme))
|
||||
return result;
|
||||
result.setScheme(commonScheme);
|
||||
result.setParts(commonScheme, {}, {});
|
||||
|
||||
// Common host
|
||||
const QStringView commonHost = first.host();
|
||||
@@ -401,7 +401,7 @@ FilePath FileUtils::commonPath(const FilePaths &paths)
|
||||
};
|
||||
if (!allOf(others, sameHost))
|
||||
return result;
|
||||
result.setHost(commonHost);
|
||||
result.setParts(commonScheme, commonHost, {});
|
||||
|
||||
// Common path
|
||||
QString commonPath;
|
||||
@@ -413,7 +413,7 @@ FilePath FileUtils::commonPath(const FilePaths &paths)
|
||||
commonPath += segment + '/';
|
||||
if (!allOf(others, sameBasePath))
|
||||
return result;
|
||||
result.setPath(commonPath.chopped(1));
|
||||
result.setParts(commonScheme, commonHost, commonPath.chopped(1));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user