Setup pixmap cache in a proper place

There is no need to reset the cache limit to previous value as
QPixmapCache is an application wide cache.
Also raise the cache size to 64MB.
This commit is contained in:
Chocobo1 2019-08-28 15:07:18 +08:00
commit 7e0daf1663
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
2 changed files with 17 additions and 26 deletions

View file

@ -77,24 +77,6 @@ namespace
};
#ifdef QBT_PIXMAP_CACHE_FOR_FILE_ICONS
struct Q_DECL_UNUSED PixmapCacheSetup
{
static const int PixmapCacheForIconsSize = 2 * 1024 * 1024; // 2 MiB for file icons
PixmapCacheSetup()
{
QPixmapCache::setCacheLimit(QPixmapCache::cacheLimit() + PixmapCacheForIconsSize);
}
~PixmapCacheSetup()
{
Q_ASSERT(QPixmapCache::cacheLimit() > PixmapCacheForIconsSize);
QPixmapCache::setCacheLimit(QPixmapCache::cacheLimit() - PixmapCacheForIconsSize);
}
};
PixmapCacheSetup pixmapCacheSetup;
class CachingFileIconProvider : public UnifiedFileIconProvider
{
public: