From: Robin Burchell Date: Sat, 23 Jun 2012 07:15:10 +0000 (+0200) Subject: Remove QQuickImageBase's explicitSourceSize. X-Git-Tag: upstream/5.2.1~1536 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfb39b0a78efcceb117b237d9f97b1d03a7174ba;p=platform%2Fupstream%2Fqtdeclarative.git Remove QQuickImageBase's explicitSourceSize. 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 Change-Id: Idb86686ea5ab711ceb2390e3703e0e04f7d537bb Reviewed-by: John Brooks Reviewed-by: Alan Alpert --- diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp index 735910e..798050d 100644 --- a/src/quick/items/qquickimagebase.cpp +++ b/src/quick/items/qquickimagebase.cpp @@ -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; diff --git a/src/quick/items/qquickimagebase_p_p.h b/src/quick/items/qquickimagebase_p_p.h index 7c2fce1..6e45238 100644 --- a/src/quick/items/qquickimagebase_p_p.h +++ b/src/quick/items/qquickimagebase_p_p.h @@ -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;