diff --git a/theme.cpp b/theme.cpp index c7cc7a3c2..da82b5c34 100644 --- a/theme.cpp +++ b/theme.cpp @@ -906,8 +906,12 @@ bool Theme::useNativeWidgetStyle() const return d->useNativeWidgetStyle; } -bool Theme::findInCache(const QString &key, QPixmap &pix) +bool Theme::findInCache(const QString &key, QPixmap &pix, unsigned int lastModified) { + if (lastModified != 0 && d->useCache() && lastModified > uint(d->pixmapCache->lastModifiedTime())) { + return false; + } + if (d->useCache()) { const QString id = d->keysToCache.value(key); if (d->pixmapsToCache.contains(id)) { @@ -925,16 +929,6 @@ bool Theme::findInCache(const QString &key, QPixmap &pix) return false; } -// BIC FIXME: Should be merged with the other findInCache method above when we break BC -bool Theme::findInCache(const QString &key, QPixmap &pix, unsigned int lastModified) -{ - if (d->useCache() && lastModified > uint(d->pixmapCache->lastModifiedTime())) { - return false; - } - - return findInCache(key, pix); -} - void Theme::insertIntoCache(const QString& key, const QPixmap& pix) { if (d->useCache()) { diff --git a/theme.h b/theme.h index f74a95963..9112cf3a2 100644 --- a/theme.h +++ b/theme.h @@ -261,16 +261,6 @@ class PLASMA_EXPORT Theme : public QObject Q_INVOKABLE QString styleSheet(const QString &css = QString()) const; - /** - * Tries to load pixmap with the specified key from cache. - * - * @param key the name to use in the cache for this image - * @param pix the pixmap object to populate with the resulting data if found - * - * @return true when pixmap was found and loaded from cache, false otherwise - **/ - bool findInCache(const QString &key, QPixmap &pix); - /** * This is an overloaded member provided to check with file timestamp * where cache is still valid. @@ -283,7 +273,7 @@ class PLASMA_EXPORT Theme : public QObject * @return true when pixmap was found and loaded from cache, false otherwise * @since 4.3 **/ - bool findInCache(const QString &key, QPixmap &pix, unsigned int lastModified); + bool findInCache(const QString &key, QPixmap &pix, unsigned int lastModified = 0); /** * Insert specified pixmap into the cache.