diff options
author | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2016-02-16 17:40:12 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2016-03-04 13:09:51 +0000 |
commit | c7ac28fa354b96de37dc6cde5e3728da8daaacbb (patch) | |
tree | ba34e8d5e14700a5e786ffbc78204e436cabf2e9 /src/quick/items/qquickborderimage.cpp | |
parent | 9456832163d3476e8f81440dd2978092a9000b72 (diff) |
QtLite: no_network option for QtDeclarative
This patch adds the support for a no_network option for
QtDeclarative, and the necessary #ifndef all around the
code.
no_network changes the interface of some classes, therefore
using it breaks source compatibility.
Change-Id: Iff612fb07041b8a7db99bd595bf038efaac2dd8a
Reviewed-by: Risto Avila <risto.avila@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickborderimage.cpp')
-rw-r--r-- | src/quick/items/qquickborderimage.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp index 66f414d816..5f8dd7b989 100644 --- a/src/quick/items/qquickborderimage.cpp +++ b/src/quick/items/qquickborderimage.cpp @@ -43,7 +43,9 @@ #include <QtQml/qqmlinfo.h> #include <QtQml/qqmlfile.h> #include <QtQml/qqmlengine.h> +#ifndef QT_NO_NETWORK #include <QtNetwork/qnetworkreply.h> +#endif #include <QtCore/qfile.h> #include <QtCore/qmath.h> #include <QtGui/qguiapplication.h> @@ -169,9 +171,11 @@ QQuickBorderImage::QQuickBorderImage(QQuickItem *parent) QQuickBorderImage::~QQuickBorderImage() { +#ifndef QT_NO_NETWORK Q_D(QQuickBorderImage); if (d->sciReply) d->sciReply->deleteLater(); +#endif } /*! @@ -270,10 +274,12 @@ void QQuickBorderImage::setSource(const QUrl &url) if (url == d->url) return; +#ifndef QT_NO_NETWORK if (d->sciReply) { d->sciReply->deleteLater(); d->sciReply = 0; } +#endif d->url = url; d->sciurl = QUrl(); @@ -311,6 +317,7 @@ void QQuickBorderImage::load() setGridScaledImage(QQuickGridScaledImage(&file)); return; } else { +#ifndef QT_NO_NETWORK if (d->progress != 0.0) { d->progress = 0.0; emit progressChanged(d->progress); @@ -320,6 +327,7 @@ void QQuickBorderImage::load() d->sciReply = qmlEngine(this)->networkAccessManager()->get(req); qmlobject_connect(d->sciReply, QNetworkReply, SIGNAL(finished()), this, QQuickBorderImage, SLOT(sciRequestFinished())) +#endif } } else { QQuickPixmap::Options options; @@ -529,6 +537,7 @@ void QQuickBorderImage::requestFinished() pixmapChange(); } +#ifndef QT_NO_NETWORK #define BORDERIMAGE_MAX_REDIRECT 16 void QQuickBorderImage::sciRequestFinished() @@ -558,6 +567,7 @@ void QQuickBorderImage::sciRequestFinished() setGridScaledImage(sci); } } +#endif // QT_NO_NETWORK void QQuickBorderImage::doUpdate() { |