diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-06-11 23:46:39 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-06-11 23:46:39 (GMT) |
commit | 74c18979b927ba3dd82ed3f5ca362428c61c2675 (patch) | |
tree | 9d3588bf393535034b6af21d6ba9c7201bc22ac5 /src | |
parent | f10791eb1c45b090f60a2c2ecca3cc5fd237278e (diff) | |
download | Qt-74c18979b927ba3dd82ed3f5ca362428c61c2675.zip Qt-74c18979b927ba3dd82ed3f5ca362428c61c2675.tar.gz Qt-74c18979b927ba3dd82ed3f5ca362428c61c2675.tar.bz2 |
More explicit QUrl <-> QString conversion.
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/extra/qmlsqlconnection.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxanimatedimageitem.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxanimatedimageitem.h | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxhighlightfilter.cpp | 7 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 6 | ||||
-rw-r--r-- | src/declarative/fx/qfxwebview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlbindablevalue.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompositetypemanager.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlscript.cpp | 10 |
11 files changed, 20 insertions, 21 deletions
diff --git a/src/declarative/extra/qmlsqlconnection.cpp b/src/declarative/extra/qmlsqlconnection.cpp index b65fe35..a329f3c 100644 --- a/src/declarative/extra/qmlsqlconnection.cpp +++ b/src/declarative/extra/qmlsqlconnection.cpp @@ -415,7 +415,7 @@ QSqlDatabase QmlSqlConnection::database() const qmlContext(this)) { // SQLITE uses files for databases, hence use relative pathing // if possible. - QUrl url = qmlContext(this)->resolvedUrl(d->databaseName); + QUrl url = qmlContext(this)->resolvedUrl(QUrl(d->databaseName)); if (url.isRelative() || url.scheme() == QLatin1String("file")) db.setDatabaseName(url.toLocalFile()); else diff --git a/src/declarative/fx/qfxanimatedimageitem.cpp b/src/declarative/fx/qfxanimatedimageitem.cpp index 604481c..d22959a 100644 --- a/src/declarative/fx/qfxanimatedimageitem.cpp +++ b/src/declarative/fx/qfxanimatedimageitem.cpp @@ -152,7 +152,7 @@ int QFxAnimatedImageItem::frameCount() const return d->_movie->frameCount(); } -void QFxAnimatedImageItem::setSource(const QString &url) +void QFxAnimatedImageItem::setSource(const QUrl &url) { Q_D(QFxAnimatedImageItem); if (url == d->url) diff --git a/src/declarative/fx/qfxanimatedimageitem.h b/src/declarative/fx/qfxanimatedimageitem.h index a0d14c4..5d115d7 100644 --- a/src/declarative/fx/qfxanimatedimageitem.h +++ b/src/declarative/fx/qfxanimatedimageitem.h @@ -73,7 +73,7 @@ public: int frameCount() const; // Extends QFxImage's src property*/ - virtual void setSource(const QString&); + virtual void setSource(const QUrl&); Q_SIGNALS: void playingChanged(); diff --git a/src/declarative/fx/qfxhighlightfilter.cpp b/src/declarative/fx/qfxhighlightfilter.cpp index 3d5f413..2c6fb0a 100644 --- a/src/declarative/fx/qfxhighlightfilter.cpp +++ b/src/declarative/fx/qfxhighlightfilter.cpp @@ -58,7 +58,6 @@ public: QFxHighlightFilterPrivate() : xOffset(0), yOffset(0), tiled(false) {} - QString source; QUrl url; int xOffset; int yOffset; @@ -130,7 +129,7 @@ QFxHighlightFilter::~QFxHighlightFilter() */ QUrl QFxHighlightFilter::source() const { - return d->source; + return d->url; } void QFxHighlightFilter::imageLoaded() @@ -140,7 +139,7 @@ void QFxHighlightFilter::imageLoaded() if (!img.isNull()) d->tex.setImage(img.toImage()); #endif - emit sourceChanged(d->source); + emit sourceChanged(d->url); update(); } @@ -158,7 +157,7 @@ void QFxHighlightFilter::setSource(const QUrl &f) if (!f.isEmpty()) QFxPixmap::get(qmlEngine(this), d->url, this, SLOT(imageLoaded())); else - emit sourceChanged(d->source); + emit sourceChanged(d->url); } /*! diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 648b0fb..079d691 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -901,11 +901,11 @@ void QFxItem::qmlLoaded() QFxItem *qmlChild = qobject_cast<QFxItem *>(obj); if (qmlChild) { qmlChild->setItemParent(this); - d->_qmlChildren.insert(d->_qml, qmlChild); + d->_qmlChildren.insert(d->_qml.toString(), qmlChild); d->qmlItem = qmlChild; } else { delete qmlChild; - d->_qml = QString(); + d->_qml = QUrl(); } delete d->_qmlcomp; d->_qmlcomp = 0; @@ -1962,7 +1962,7 @@ void QFxItem::newChild(const QString &type) { Q_D(QFxItem); - QUrl url = qmlContext(this)->resolvedUri(type); + QUrl url = qmlContext(this)->resolvedUri(QUrl(type)); if (url.isEmpty()) return; diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp index d15502b..dc7f60e 100644 --- a/src/declarative/fx/qfxwebview.cpp +++ b/src/declarative/fx/qfxwebview.cpp @@ -1065,7 +1065,7 @@ QFxWebView *QFxWebPage::view() QObject *QFxWebPage::createPlugin(const QString &, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues) { - QUrl comp = qmlContext(view())->resolvedUri(url.toString()); + QUrl comp = qmlContext(view())->resolvedUri(url); return new QWidget_Dummy_Plugin(comp,view(),paramNames,paramValues); } diff --git a/src/declarative/qml/qmlbindablevalue.cpp b/src/declarative/qml/qmlbindablevalue.cpp index e1b6961..f2cfcf8 100644 --- a/src/declarative/qml/qmlbindablevalue.cpp +++ b/src/declarative/qml/qmlbindablevalue.cpp @@ -136,7 +136,7 @@ void QmlBindableValue::update() QVariant value = this->value(); if (d->property.propertyType() == QVariant::Url && value.canConvert(QVariant::String) && !value.isNull()) - value.setValue(context()->resolvedUrl(value.toString())); + value.setValue(context()->resolvedUrl(QUrl(value.toString()))); d->property.write(value); } diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 3123254..41cbc19 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -281,7 +281,7 @@ bool QmlCompiler::compileStoreInstruction(QmlInstruction &instr, case QVariant::Url: { instr.type = QmlInstruction::StoreUrl; - QUrl u = output->url.resolved(string); + QUrl u = output->url.resolved(QUrl(string)); instr.storeUrl.propertyIndex = prop.propertyIndex(); instr.storeUrl.value = output->indexForString(u.toString()); } diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp index a5e302c..9950b48 100644 --- a/src/declarative/qml/qmlcompositetypemanager.cpp +++ b/src/declarative/qml/qmlcompositetypemanager.cpp @@ -109,7 +109,7 @@ QmlCompositeTypeData::toCompiledComponent(QmlEngine *engine) status = Error; errors = compiler.errors(); for(int ii = 0; ii < errors.count(); ++ii) - errors[ii].setUrl(url); + errors[ii].setUrl(compiledComponent->url); compiledComponent->release(); compiledComponent = 0; } @@ -336,7 +336,7 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit) unit->status = QmlCompositeTypeData::Error; { QmlError error; - error.setUrl(unit->url); + error.setUrl(QUrl(unit->url)); error.setDescription(tr("Type %1 unavailable").arg(QLatin1String(type))); unit->errors << error; } diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 2c1d324..23ab744 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -1128,7 +1128,7 @@ QVariant QmlExpression::value() for (int i = context()->d_func()->scopeChain.size() - 1; i > -1; --i) { scriptEngine->currentContext()->pushScope(context()->d_func()->scopeChain.at(i)); } - QScriptValue svalue = scriptEngine->evaluate(expression(), d->fileName, d->line); + QScriptValue svalue = scriptEngine->evaluate(expression(), d->fileName.toString(), d->line); if (scriptEngine->hasUncaughtException()) { if (scriptEngine->uncaughtException().isError()){ QScriptValue exception = scriptEngine->uncaughtException(); diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp index e422f37..ab095b1 100644 --- a/src/declarative/util/qmlscript.cpp +++ b/src/declarative/util/qmlscript.cpp @@ -66,7 +66,7 @@ class QmlScriptPrivate : public QObjectPrivate public: QmlScriptPrivate() : reply(0) {} - void addScriptToEngine(const QString &, const QString &fileName=QString()); + void addScriptToEngine(const QString &, const QString &source=QString()); QString script; QNetworkReply *reply; @@ -156,7 +156,7 @@ void QmlScript::setSource(const QUrl &source) QFile file(d->url.toLocalFile()); file.open(QIODevice::ReadOnly); QByteArray ba = file.readAll(); - d->addScriptToEngine(QString::fromUtf8(ba), d->url); + d->addScriptToEngine(QString::fromUtf8(ba), file.fileName()); } else #endif { @@ -173,13 +173,13 @@ void QmlScript::replyFinished() Q_D(QmlScript); if (!d->reply->error()) { QByteArray ba = d->reply->readAll(); - d->addScriptToEngine(QString::fromUtf8(ba), d->url); + d->addScriptToEngine(QString::fromUtf8(ba), d->url.toString()); } d->reply->deleteLater(); d->reply = 0; } -void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &fileName) +void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &source) { #ifdef Q_ENABLE_PERFORMANCE_LOG QFxPerfTimer<QFxPerf::AddScript> pt; @@ -202,7 +202,7 @@ void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &f currentContext->setActivationObject(context->d_func()->scopeChain.at(0)); - QScriptValue val = scriptEngine->evaluate(script, fileName); + QScriptValue val = scriptEngine->evaluate(script, source); if (scriptEngine->hasUncaughtException()) { if (scriptEngine->uncaughtException().isError()){ QScriptValue exception = scriptEngine->uncaughtException(); |