forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user