One time pixmap cache update

Code will now perform a one time check on starting to see if the cache
has been updated to the new 2048 default. If the update has not been set
we update. After this time if the user lowers the level, it will not
reset back to 2048 by default.
This commit is contained in:
Matt Lowe 2015-02-20 21:43:02 +01:00
parent 06e5327595
commit c5bc3ea4dd

View file

@ -23,7 +23,16 @@ SettingsCache::SettingsCache()
picDownload = settings->value("personal/picturedownload", true).toBool();
picDownloadHq = settings->value("personal/picturedownloadhq", true).toBool();
pixmapCacheSize = settings->value("personal/pixmapCacheSize", PIXMAPCACHE_SIZE_DEFAULT).toInt();
// we only want to reset the cache once, then its up to the user
bool updateCache = settings->value("update/pixmapCacheSize", false).toBool();
if (!updateCache) {
pixmapCacheSize = PIXMAPCACHE_SIZE_DEFAULT;
settings->setValue("personal/pixmapCacheSize", pixmapCacheSize);
settings->setValue("update/pixmapCacheSize", true);
}
else
pixmapCacheSize = settings->value("personal/pixmapCacheSize", PIXMAPCACHE_SIZE_DEFAULT).toInt();
//sanity check
if(pixmapCacheSize < PIXMAPCACHE_SIZE_MIN || pixmapCacheSize > PIXMAPCACHE_SIZE_MAX)
pixmapCacheSize = PIXMAPCACHE_SIZE_DEFAULT;