Utils: Remove slash normalization in critical path

Should be done by callers, most notably fromUserInput

Change-Id: I0dec8e3ab76d49d0ddf4da3088499e71c536ab83
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-12-06 17:44:42 +01:00
parent b3f82887a3
commit c08317b5a6
2 changed files with 92 additions and 11 deletions

View File

@@ -810,15 +810,11 @@ void FilePath::setPath(QStringView path)
setParts(scheme(), host(), path);
}
void FilePath::setFromString(const QString &unnormalizedFileName)
void FilePath::setFromString(const QString &fileName)
{
static const QStringView qtcDevSlash(u"__qtc_devices__/");
static const QStringView colonSlashSlash(u"://");
QString fileName = unnormalizedFileName;
if (fileName.contains('\\'))
fileName.replace('\\', '/');
const QChar slash('/');
const QStringView fileNameView(fileName);
@@ -926,7 +922,7 @@ FilePath FilePath::fromVariant(const QVariant &variant)
{
if (variant.type() == QVariant::Url)
return FilePath::fromUrl(variant.toUrl());
return FilePath::fromString(variant.toString());
return FilePath::fromUserInput(variant.toString());
}
QVariant FilePath::toVariant() const