mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-02 00:47:48 -07:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user