aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-15 15:48:40 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-22 09:10:18 +0200
commit8a3f8595569a920cf2fa811704dec97ae31be15d (patch)
tree84496eca2ae5330492ae54c7cf08531471127e3f /src/qml/qml/qqmlobjectcreator.cpp
parent64fb25a2acada6d9f0897b7e8db4583de4d8d2be (diff)
Revert "Decode directory separators in source URLs"
This reverts commit 7ec30c51b287159377761338fe6d3b48706d74ee. We don't want to half-decode directory separators on assignment. This just introduces inconsistency down the line. [ChangeLog][QtQml][Important Behavior Changes] Percent-encoded directory separators in URLs are not automatically decoded on assignment to url properties anymore. This was obviously not a good idea to begin with. Fixes: QTBUG-81244 Change-Id: I1938abbe8aada88beff0d628397674255e8b2472 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index cbf243b9c1..61d287fc88 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -451,10 +451,9 @@ void QQmlObjectCreator::setPropertyValue(const QQmlPropertyData *property, const
break;
case QMetaType::QUrl: {
assertType(QV4::CompiledData::Binding::Type_String);
- QString string = compilationUnit->bindingValueAsString(binding);
- // Encoded dir-separators defeat QUrl processing - decode them first
- string.replace(QLatin1String("%2f"), QLatin1String("/"), Qt::CaseInsensitive);
- QUrl value = string.isEmpty() ? QUrl() : compilationUnit->finalUrl().resolved(QUrl(string));
+ const QString string = compilationUnit->bindingValueAsString(binding);
+ QUrl value = string.isEmpty() ? QUrl()
+ : compilationUnit->finalUrl().resolved(QUrl(string));
// Apply URL interceptor
value = engine->interceptUrl(value, QQmlAbstractUrlInterceptor::UrlString);
property->writeProperty(_qobject, &value, propertyWriteFlags);