Remove QQuickImageBase's explicitSourceSize.
authorRobin Burchell <robin+qt@viroteck.net>
Sat, 23 Jun 2012 07:15:10 +0000 (09:15 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 2 Jul 2012 04:09:21 +0000 (06:09 +0200)
The only case where this really did anything was in resetSourceSize() to avoid
resetting if it had not been set already, but this logic is already in
setSourceSize too, so it's really not useful.

Done-with: John Brooks <john.brooks@dereferenced.net>
Change-Id: Idb86686ea5ab711ceb2390e3703e0e04f7d537bb
Reviewed-by: John Brooks <john.brooks@dereferenced.net>
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
src/quick/items/qquickimagebase.cpp
src/quick/items/qquickimagebase_p_p.h

index 735910e..798050d 100644 (file)
@@ -118,7 +118,6 @@ void QQuickImageBase::setSourceSize(const QSize& size)
         return;
 
     d->sourcesize = size;
-    d->explicitSourceSize = true;
     emit sourceSizeChanged();
     if (isComponentComplete())
         load();
@@ -135,14 +134,7 @@ QSize QQuickImageBase::sourceSize() const
 
 void QQuickImageBase::resetSourceSize()
 {
-    Q_D(QQuickImageBase);
-    if (!d->explicitSourceSize)
-        return;
-    d->explicitSourceSize = false;
-    d->sourcesize = QSize();
-    emit sourceSizeChanged();
-    if (isComponentComplete())
-        load();
+    setSourceSize(QSize());
 }
 
 bool QQuickImageBase::cache() const
@@ -209,7 +201,7 @@ void QQuickImageBase::load()
             options |= QQuickPixmap::Cache;
         d->pix.clear(this);
         pixmapChange();
-        d->pix.load(qmlEngine(this), d->url, d->explicitSourceSize ? sourceSize() : QSize(), options);
+        d->pix.load(qmlEngine(this), d->url, d->sourcesize, options);
 
         if (d->pix.isLoading()) {
             d->progress = 0.0;
index 7c2fce1..6e45238 100644 (file)
@@ -69,7 +69,6 @@ public:
     QQuickImageBasePrivate()
       : status(QQuickImageBase::Null),
         progress(0.0),
-        explicitSourceSize(false),
         async(false),
         cache(true),
         mirror(false)
@@ -81,7 +80,6 @@ public:
     QUrl url;
     qreal progress;
     QSize sourcesize;
-    bool explicitSourceSize : 1;
     bool async : 1;
     bool cache : 1;
     bool mirror: 1;