diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-08-26 02:43:47 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-08-26 02:43:47 (GMT) |
commit | 70fd3ba7e743c67ab3f64a9e22d11642139e6254 (patch) | |
tree | f70f062a193df68051ec009920fff501a08e5fbf | |
parent | a02e7ec7114923416dce405c670ba8da58893aca (diff) | |
parent | 642440f41c5cd4b5f0ee66101b3ca32859293d29 (diff) | |
download | Qt-70fd3ba7e743c67ab3f64a9e22d11642139e6254.zip Qt-70fd3ba7e743c67ab3f64a9e22d11642139e6254.tar.gz Qt-70fd3ba7e743c67ab3f64a9e22d11642139e6254.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | src/declarative/fx/qfxwebview.cpp | 14 | ||||
-rw-r--r-- | src/declarative/fx/qfxwebview.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcomponent.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcontext.cpp | 2 |
5 files changed, 14 insertions, 8 deletions
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp index 7247837..04a4eef 100644 --- a/src/declarative/fx/qfxwebview.cpp +++ b/src/declarative/fx/qfxwebview.cpp @@ -325,6 +325,12 @@ QUrl QFxWebView::url() const void QFxWebView::setUrl(const QUrl &url) { + if (url.isEmpty()) { + // Make absolute. + setUrl(QUrl("about:blank")); + return; + } + Q_D(QFxWebView); if (url == page()->mainFrame()->url()) return; @@ -333,7 +339,7 @@ void QFxWebView::setUrl(const QUrl &url) d->idealwidth>0 ? d->idealwidth : width(), d->idealheight>0 ? d->idealheight : height())); - Q_ASSERT(url.isEmpty() || !url.isRelative()); + Q_ASSERT(!url.isRelative()); if (isComponentComplete()) page()->mainFrame()->load(url); @@ -1174,15 +1180,15 @@ private: QFxWebView *webview; }; -QFxWebView *QFxWebPage::view() +QFxWebView *QFxWebPage::viewItem() { return static_cast<QFxWebView*>(parent()); } QObject *QFxWebPage::createPlugin(const QString &, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues) { - QUrl comp = qmlContext(view())->resolvedUrl(url); - return new QWidget_Dummy_Plugin(comp,view(),paramNames,paramValues); + QUrl comp = qmlContext(viewItem())->resolvedUrl(url); + return new QWidget_Dummy_Plugin(comp,viewItem(),paramNames,paramValues); } QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxwebview.h b/src/declarative/fx/qfxwebview.h index 40c86b4..d7c9fd0 100644 --- a/src/declarative/fx/qfxwebview.h +++ b/src/declarative/fx/qfxwebview.h @@ -70,7 +70,7 @@ public: protected: QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues); private: - QFxWebView *view(); + QFxWebView *viewItem(); }; diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index bbcc64d..4f96d12 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..e277d91 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; 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()) |