Limit pixmap cache size to 2047MB; fix #555

also, fix any invalid values loaded from config
This commit is contained in:
Fabio Bas 2015-01-16 17:11:38 +01:00
parent 8e396cadc2
commit 24c6e4a81d
3 changed files with 9 additions and 2 deletions

View file

@ -52,8 +52,9 @@ GeneralSettingsPage::GeneralSettingsPage()
pixmapCacheLabel = new QLabel;
pixmapCacheEdit = new QSpinBox;
pixmapCacheEdit->setMinimum(64);
pixmapCacheEdit->setMaximum(8192);
pixmapCacheEdit->setMinimum(PIXMAPCACHE_SIZE_MIN);
// 2047 is the max value to avoid overflowing of QPixmapCache::setCacheLimit(int size)
pixmapCacheEdit->setMaximum(PIXMAPCACHE_SIZE_MAX);
pixmapCacheEdit->setSingleStep(64);
pixmapCacheEdit->setValue(settingsCache->getPixmapCacheSize());
pixmapCacheEdit->setSuffix(" MB");