diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-08-27 01:05:19 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-08-27 01:05:19 (GMT) |
commit | 7d33c015c9f936eaf5836230a199eab9399b3f58 (patch) | |
tree | 56de67b7d512d70291591e61c30bf9c72d34789e /src/declarative/qml | |
parent | a488a04e5a5af4255d560d5dfa6423caa48ed5f3 (diff) | |
parent | baeb25062194c9ddc36c4536662de46b6b09cd68 (diff) | |
download | Qt-7d33c015c9f936eaf5836230a199eab9399b3f58.zip Qt-7d33c015c9f936eaf5836230a199eab9399b3f58.tar.gz Qt-7d33c015c9f936eaf5836230a199eab9399b3f58.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts:
doc/src/declarative/anchor-layout.qdoc
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmlbindingoptimizations_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcomponent.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlcomponentjs_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcontext.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 17 |
6 files changed, 7 insertions, 22 deletions
diff --git a/src/declarative/qml/qmlbindingoptimizations_p.h b/src/declarative/qml/qmlbindingoptimizations_p.h index ab264c7..4862007 100644 --- a/src/declarative/qml/qmlbindingoptimizations_p.h +++ b/src/declarative/qml/qmlbindingoptimizations_p.h @@ -99,7 +99,7 @@ public: virtual void setEnabled(bool); virtual int propertyIndex(); -private slots: +private Q_SLOTS: virtual void update(); private: diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 3af7137..f9183c8 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -365,7 +365,7 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop, case QVariant::Url: { instr.type = QmlInstruction::StoreUrl; - QUrl u = output->url.resolved(QUrl(string)); + QUrl u = string.isEmpty() ? QUrl() : output->url.resolved(QUrl(string)); instr.storeUrl.propertyIndex = prop.propertyIndex(); instr.storeUrl.value = output->indexForString(u.toString()); } diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 0e141da..c844a32 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -355,7 +355,7 @@ void QmlComponent::loadUrl(const QUrl &url) d->clear(); - if (url.isRelative()) + if (url.isRelative() && !url.isEmpty()) d->url = d->engine->baseUrl().resolved(url); else d->url = url; @@ -487,7 +487,7 @@ QObject *QmlComponent::beginCreate(QmlContext *context) QmlContextPrivate *contextPriv = static_cast<QmlContextPrivate *>(QObjectPrivate::get(context)); QmlContext *ctxt = new QmlContext(context, 0, true); - static_cast<QmlContextPrivate*>(ctxt->d_ptr)->url = d->cc->url; + static_cast<QmlContextPrivate*>(ctxt->d_func())->url = d->cc->url; QmlVME vme; QObject *rv = vme.run(ctxt, d->cc, d->start, d->count); diff --git a/src/declarative/qml/qmlcomponentjs_p.h b/src/declarative/qml/qmlcomponentjs_p.h index 8c69b5f..cee3035 100644 --- a/src/declarative/qml/qmlcomponentjs_p.h +++ b/src/declarative/qml/qmlcomponentjs_p.h @@ -87,7 +87,7 @@ Q_SIGNALS: void isErrorChanged(); void isReadyChanged(); void isLoadingChanged(); -private slots: +private Q_SLOTS: void statusChange(QmlComponent::Status newStatus); }; diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index 61850c3..97ab375 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -422,7 +422,7 @@ void QmlContext::setContextProperty(const QString &name, QObject *value) QUrl QmlContext::resolvedUrl(const QUrl &src) { QmlContext *ctxt = this; - if (src.isRelative()) { + if (src.isRelative() && !src.isEmpty()) { if (ctxt) { while(ctxt) { if(ctxt->d_func()->url.isValid()) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 7923eda..ea00d65 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -266,9 +266,7 @@ QScriptValue QmlEnginePrivate::propertyObject(const QScriptString &propName, if (varobj) { return scriptEngine.newObject(objectClass, scriptEngine.newVariant(QVariant::fromValue(varobj))); } else { - if (var.type() == QVariant::Bool) - return QScriptValue(&scriptEngine, var.toBool()); - return scriptEngine.newVariant(var); + return qScriptValueFromValue(&scriptEngine, var); } } @@ -863,21 +861,14 @@ void QmlContextScriptClass::setProperty(QScriptValue &object, QmlContext *bindContext = static_cast<QmlContext*>(object.data().toQObject()); - int objIdx = (id & QmlScriptClass::ClassIdSelectorMask) >> 24; QObject *obj = bindContext->d_func()->defaultObjects.at(objIdx); - QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); - QScriptValue oldact = scriptEngine->currentContext()->activationObject(); - scriptEngine->currentContext()->setActivationObject(scriptEngine->globalObject()); - QmlMetaProperty prop; prop.restore(id, obj); QVariant v = QmlScriptClass::toVariant(engine, value); prop.write(v); - - scriptEngine->currentContext()->setActivationObject(oldact); } ///////////////////////////////////////////////////////////// @@ -1058,17 +1049,11 @@ void QmlObjectScriptClass::setProperty(QScriptValue &object, QObject *obj = object.data().toQObject(); - QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); - QScriptValue oldact = scriptEngine->currentContext()->activationObject(); - scriptEngine->currentContext()->setActivationObject(scriptEngine->globalObject()); - QmlMetaProperty prop; prop.restore(id, obj); QVariant v = QmlScriptClass::toVariant(engine, value); prop.write(v); - - scriptEngine->currentContext()->setActivationObject(oldact); } |