aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlfile.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-08-15 10:35:53 +0200
committerLars Knoll <lars.knoll@qt.io>2016-10-10 14:11:47 +0000
commit4ee2bc4e9c05d8daec8b04412a0b7c0264fbc1a4 (patch)
tree03b0dd07b6b087b5bdaded499961ee1492d408ae /src/qml/qml/qqmlfile.cpp
parent11e0e5574a529e337e43ab15fca357b109ea2834 (diff)
Turn the no-network support into a configurable feature
Change-Id: Ic70f60c124fe166b37fbe9b853735be3c5e0d46d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlfile.cpp')
-rw-r--r--src/qml/qml/qqmlfile.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/qml/qml/qqmlfile.cpp b/src/qml/qml/qqmlfile.cpp
index 4769402855..4e4db086b0 100644
--- a/src/qml/qml/qqmlfile.cpp
+++ b/src/qml/qml/qqmlfile.cpp
@@ -68,7 +68,7 @@ static char assets_string[] = "assets";
class QQmlFilePrivate;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
class QQmlFileNetworkReply : public QObject
{
Q_OBJECT
@@ -117,12 +117,12 @@ public:
Error error;
QString errorString;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
QQmlFileNetworkReply *reply;
#endif
};
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
int QQmlFileNetworkReply::finishedIndex = -1;
int QQmlFileNetworkReply::downloadProgressIndex = -1;
int QQmlFileNetworkReply::networkFinishedIndex = -1;
@@ -205,11 +205,11 @@ void QQmlFileNetworkReply::networkDownloadProgress(qint64 a, qint64 b)
{
emit downloadProgress(a, b);
}
-#endif // QT_NO_NETWORK
+#endif // qml_network
QQmlFilePrivate::QQmlFilePrivate()
: error(None)
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
, reply(0)
#endif
{
@@ -233,7 +233,7 @@ QQmlFile::QQmlFile(QQmlEngine *e, const QString &url)
QQmlFile::~QQmlFile()
{
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
delete d->reply;
#endif
delete d;
@@ -273,7 +273,7 @@ QQmlFile::Status QQmlFile::status() const
{
if (d->url.isEmpty() && d->urlString.isEmpty())
return Null;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
else if (d->reply)
return Loading;
#endif
@@ -333,7 +333,7 @@ void QQmlFile::load(QQmlEngine *engine, const QUrl &url)
d->error = QQmlFilePrivate::NotFound;
}
} else {
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
d->reply = new QQmlFileNetworkReply(engine, d, url);
#else
d->error = QQmlFilePrivate::NotFound;
@@ -364,7 +364,7 @@ void QQmlFile::load(QQmlEngine *engine, const QString &url)
d->error = QQmlFilePrivate::NotFound;
}
} else {
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
QUrl qurl(url);
d->url = qurl;
d->urlString = QString();
@@ -388,7 +388,7 @@ void QQmlFile::clear(QObject *)
clear();
}
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
bool QQmlFile::connectFinished(QObject *object, const char *method)
{
if (!d || !d->reply) {