diff options
author | Albert Astals Cid <albert.astals@canonical.com> | 2017-02-03 10:10:52 +0100 |
---|---|---|
committer | Albert Astals Cid <albert.astals@canonical.com> | 2017-02-03 12:19:41 +0000 |
commit | ecd4c83ef764f086f2e101b4201484f3d828c0e3 (patch) | |
tree | 8278868ab2e8aa4c8cf60c72d5baaefae7831da6 /src/quick/util | |
parent | b0ced704bcaeb6dc71622c9ce87b78f3b5bd827c (diff) |
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 <robin.burchell@crimson.no>
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickpixmapcache.cpp | 4 | ||||
-rw-r--r-- | src/quick/util/qquickpixmapcache_p.h | 2 |
2 files changed, 3 insertions, 3 deletions
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); diff --git a/src/quick/util/qquickpixmapcache_p.h b/src/quick/util/qquickpixmapcache_p.h index a867771755..93d5a1cf56 100644 --- a/src/quick/util/qquickpixmapcache_p.h +++ b/src/quick/util/qquickpixmapcache_p.h @@ -175,7 +175,7 @@ public: bool connectDownloadProgress(QObject *, int); static void purgeCache(); - static bool isCached(const QUrl &url, const QSize &requestSize); + static bool isCached(const QUrl &url, const QSize &requestSize, const QQuickImageProviderOptions &options); static const QLatin1String itemGrabberScheme; |