From dfb39b0a78efcceb117b237d9f97b1d03a7174ba Mon Sep 17 00:00:00 2001 From: Robin Burchell <robin+qt@viroteck.net> Date: Sat, 23 Jun 2012 09:15:10 +0200 Subject: [PATCH] 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 <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 | 12 ++---------- src/quick/items/qquickimagebase_p_p.h | 2 -- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp index 735910e7ff..798050d776 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 7c2fce1e79..6e452387ae 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; -- GitLab