diff options
Diffstat (limited to 'src/declarative/qml/v4/qv4bindings.cpp')
-rw-r--r-- | src/declarative/qml/v4/qv4bindings.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/declarative/qml/v4/qv4bindings.cpp b/src/declarative/qml/v4/qv4bindings.cpp index 4e0c1821a5..fb9f8920dd 100644 --- a/src/declarative/qml/v4/qv4bindings.cpp +++ b/src/declarative/qml/v4/qv4bindings.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the QtDeclarative module of the Qt Toolkit. ** @@ -245,7 +245,7 @@ void QV4Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags) QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding); if (parent->context()) QDeclarativeDebugTrace::rangeLocation(QDeclarativeDebugTrace::Binding, - parent->context()->url, line); + parent->context()->url, line, column); parent->run(this, flags); QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Binding); } @@ -420,15 +420,16 @@ inline static QUrl toUrl(Register *reg, int type, QDeclarativeContextData *conte if (vt == QVariant::Url) { base = var->toUrl(); } else if (vt == QVariant::ByteArray) { - base = QUrl(QString::fromUtf8(var->toByteArray())); + // Preserve any valid percent-encoded octets supplied by the source + base.setEncodedUrl(var->toByteArray(), QUrl::TolerantMode); } else if (vt == QVariant::String) { - base = QUrl(var->toString()); + base.setEncodedUrl(var->toString().toUtf8(), QUrl::TolerantMode); } else { if (ok) *ok = false; return QUrl(); } } else if (type == QMetaType::QString) { - base = QUrl(*reg->getstringptr()); + base.setEncodedUrl(reg->getstringptr()->toUtf8(), QUrl::TolerantMode); } else { if (ok) *ok = false; return QUrl(); @@ -974,7 +975,7 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, output.cleanupString(); MARK_CLEAN_REGISTER(instr->unaryop.output); } - output.setint(tmp.toInt32()); + output.setint(tmp.toInt()); } } QML_V4_END_INSTR(ConvertStringToInt, unaryop) @@ -1012,7 +1013,10 @@ void QV4Bindings::run(int instrIndex, quint32 &executedBlocks, output.cleanupString(); MARK_CLEAN_REGISTER(instr->unaryop.output); } - new (output.geturlptr()) QUrl(tmp); + QUrl *urlPtr = output.geturlptr(); + new (urlPtr) QUrl(); + urlPtr->setEncodedUrl(tmp.toUtf8(), QUrl::TolerantMode); + URL_REGISTER(instr->unaryop.output); } } |