From ecd4c83ef764f086f2e101b4201484f3d828c0e3 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 3 Feb 2017 10:10:52 +0100 Subject: Allow to pass all the relevant info to QQuickPixmap::isCached If we don't allow to pass the QQuickImageProviderOptions to the isCached we are missing one of the three components that identify if the pixmap is actually cached. Old code is ok for the QQuickAnimatedImagePrivate use case since it always creates QQuickPixmap with the default QQuickImageProviderOptions options, but if someone else wants to use QQuickPixmap::isCached they will need to be able to pass the options part of the cache key. Change-Id: I3153ad9ed30e7332b5cb4896dcebd408f2bd9afe Reviewed-by: Robin Burchell --- src/quick/util/qquickpixmapcache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quick/util/qquickpixmapcache.cpp') diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index be6d4d18bd..be27cba989 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -1541,9 +1541,9 @@ void QQuickPixmap::clear(QObject *obj) } } -bool QQuickPixmap::isCached(const QUrl &url, const QSize &requestSize) +bool QQuickPixmap::isCached(const QUrl &url, const QSize &requestSize, const QQuickImageProviderOptions &options) { - QQuickPixmapKey key = { &url, &requestSize, QQuickImageProviderOptions() }; + QQuickPixmapKey key = { &url, &requestSize, options }; QQuickPixmapStore *store = pixmapStore(); return store->m_cache.contains(key); -- cgit v1.2.3