From 360f0d00088cc84791e7a197b20a325bfdac9eb3 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 20 Apr 2012 09:27:01 +1000 Subject: Use QUrl constructor directly. setEncodedUrl is deprecated, and no longer required as the new QUrl makes this behavior default. This is a partial revert of 3aa53b8bc383ebcdf8dc922b2670170ec012949f. Change-Id: I14f29cbe2a2e2cd9c41f7afc92b1cb66b53996bb Reviewed-by: Matthew Vogt --- src/qml/qml/qqmlcompiler.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/qml/qml/qqmlcompiler.cpp') diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index 54577f9b92..8c47c7c0c5 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -407,14 +407,6 @@ bool QQmlCompiler::testLiteralAssignment(QQmlScript::Property *prop, return true; } -static QUrl urlFromUserString(const QString &data) -{ - QUrl u; - // Preserve any valid percent-encoded octets supplied by the source - u.setEncodedUrl(data.toUtf8(), QUrl::TolerantMode); - return u; -} - /*! Generate a store instruction for assigning literal \a v to property \a prop. @@ -522,7 +514,7 @@ void QQmlCompiler::genLiteralAssignment(QQmlScript::Property *prop, { Instruction::StoreUrl instr; QString string = v->value.asString(); - QUrl u = string.isEmpty() ? QUrl() : output->url.resolved(urlFromUserString(string)); + QUrl u = string.isEmpty() ? QUrl() : output->url.resolved(QUrl(string)); instr.propertyIndex = prop->index; instr.value = output->indexForUrl(u); output->addInstruction(instr); @@ -721,7 +713,7 @@ void QQmlCompiler::genLiteralAssignment(QQmlScript::Property *prop, } else if (type == qMetaTypeId >()) { Instruction::StoreUrlQList instr; QString string = v->value.asString(); - QUrl u = string.isEmpty() ? QUrl() : output->url.resolved(urlFromUserString(string)); + QUrl u = string.isEmpty() ? QUrl() : output->url.resolved(QUrl(string)); instr.propertyIndex = prop->index; instr.value = output->indexForUrl(u); output->addInstruction(instr); -- cgit v1.2.3