diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-06-10 04:57:51 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-06-10 04:57:51 (GMT) |
commit | 4dc4cfac667389efda4a43df5ff8cfa4ba305a2f (patch) | |
tree | 5c937ab2e510edb7a359b225132544d938a884a9 /src/declarative/extra | |
parent | 29496148abe8506fbf50c99e9a210095c5115a14 (diff) | |
download | Qt-4dc4cfac667389efda4a43df5ff8cfa4ba305a2f.zip Qt-4dc4cfac667389efda4a43df5ff8cfa4ba305a2f.tar.gz Qt-4dc4cfac667389efda4a43df5ff8cfa4ba305a2f.tar.bz2 |
Support URLs directly (not just as strings), so they are correctly resolved.
URLs expressed as strings (possible relative) are resolved relative to
the component in which the string expression is converted to a url value.
All items are converted to use QUrl properties, except SqlConnection, where
the databasename is only a special-case URL (this may need further consideration).
Diffstat (limited to 'src/declarative/extra')
-rw-r--r-- | src/declarative/extra/qmlxmllistmodel.cpp | 8 | ||||
-rw-r--r-- | src/declarative/extra/qmlxmllistmodel.h | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp index a7f5d72..62ede80 100644 --- a/src/declarative/extra/qmlxmllistmodel.cpp +++ b/src/declarative/extra/qmlxmllistmodel.cpp @@ -270,7 +270,7 @@ public: , queryId(-1), roleObjects(this) {} bool isClassComplete; - QString src; + QUrl src; QString query; QString namespaces; int size; @@ -388,13 +388,13 @@ QString QmlXmlListModel::toString(int role) const return d->roleNames.at(index); } -QString QmlXmlListModel::source() const +QUrl QmlXmlListModel::source() const { Q_D(const QmlXmlListModel); return d->src; } -void QmlXmlListModel::setSource(const QString &src) +void QmlXmlListModel::setSource(const QUrl &src) { Q_D(QmlXmlListModel); if (d->src != src) { @@ -483,7 +483,7 @@ void QmlXmlListModel::reload() emit progressChanged(d->progress); emit statusChanged(d->status); - QNetworkRequest req((QUrl(d->src))); + QNetworkRequest req(d->src); req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); d->reply = qmlContext(this)->engine()->networkAccessManager()->get(req); QObject::connect(d->reply, SIGNAL(finished()), this, SLOT(requestFinished())); diff --git a/src/declarative/extra/qmlxmllistmodel.h b/src/declarative/extra/qmlxmllistmodel.h index 052a0c2..bdbba47 100644 --- a/src/declarative/extra/qmlxmllistmodel.h +++ b/src/declarative/extra/qmlxmllistmodel.h @@ -93,7 +93,7 @@ class Q_DECLARATIVE_EXPORT QmlXmlListModel : public QListModelInterface, public Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) - Q_PROPERTY(QString source READ source WRITE setSource) + Q_PROPERTY(QUrl source READ source WRITE setSource) Q_PROPERTY(QString query READ query WRITE setQuery) Q_PROPERTY(QString namespaceDeclarations READ namespaceDeclarations WRITE setNamespaceDeclarations) Q_PROPERTY(QmlList<XmlListModelRole *> *roles READ roleObjects) @@ -109,8 +109,8 @@ public: QmlList<XmlListModelRole *> *roleObjects(); - QString source() const; - void setSource(const QString&); + QUrl source() const; + void setSource(const QUrl&); QString query() const; void setQuery(const QString&); |