Utils: Make OsType addition less visible

Change-Id: I092930ef6b0ed6876e32ed6b0c78d6bd58becddc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-08-04 16:35:31 +02:00
parent 3e8f6bbf82
commit 56a8c59845
4 changed files with 26 additions and 11 deletions

View File

@@ -740,14 +740,22 @@ QString FilePath::displayName(const QString &args) const
\sa toString, fromUserInput
*/
FilePath FilePath::fromString(const QString &filepath, OsType osType)
FilePath FilePath::fromString(const QString &filepath)
{
FilePath fn;
fn.setFromString(filepath, osType);
fn.setFromString(filepath);
return fn;
}
bool isWindowsDriveLetter(QChar ch) {
FilePath FilePath::fromStringAndOs(const QString &filepath, OsType osType)
{
FilePath fn;
fn.setFromStringAndOs(filepath, osType);
return fn;
}
bool isWindowsDriveLetter(QChar ch)
{
return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
}
@@ -817,7 +825,12 @@ void FilePath::setRootAndPath(QStringView path, OsType osType)
}
}
void FilePath::setFromString(const QString &filename, OsType osType)
void FilePath::setFromString(const QString &fileName)
{
setFromStringAndOs(fileName, HostOsInfo::hostOs());
}
void FilePath::setFromStringAndOs(const QString &filename, OsType osType)
{
static const QLatin1String qtcDevSlash("__qtc_devices__/");
static const QLatin1String colonSlashSlash("://");