Expose QPixmapCache's cache limit size as an user preference

This commit is contained in:
Fabio Bas 2014-12-24 16:16:34 +01:00
parent 776d809f2f
commit b96104bed4
6 changed files with 42 additions and 5 deletions

View file

@ -23,6 +23,7 @@ SettingsCache::SettingsCache()
picDownload = settings->value("personal/picturedownload", true).toBool();
picDownloadHq = settings->value("personal/picturedownloadhq", false).toBool();
pixmapCacheSize = settings->value("personal/pixmapCacheSize", PIXMAPCACHE_SIZE_DEFAULT).toInt();
picUrl = settings->value("personal/picUrl", PIC_URL_DEFAULT).toString();
picUrlHq = settings->value("personal/picUrlHq", PIC_URL_HQ_DEFAULT).toString();
picUrlFallback = settings->value("personal/picUrlFallback", PIC_URL_FALLBACK).toString();
@ -289,6 +290,13 @@ void SettingsCache::setAutoConnect(const bool &_autoConnect)
settings->setValue("server/auto_connect", attemptAutoConnect ? 1 : 0);
}
void SettingsCache::setPixmapCacheSize(const int _pixmapCacheSize)
{
pixmapCacheSize = _pixmapCacheSize;
settings->setValue("personal/pixmapCacheSize", pixmapCacheSize);
emit pixmapCacheSizeChanged(pixmapCacheSize);
}
void SettingsCache::copyPath(const QString &src, const QString &dst)
{
// test source && return if inexistent