mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
* [Settings] Shuffle some settings around Took 21 minutes Took 1 hour 25 minutes * [Settings] Camel case everything * Revert debug schema change * Add new classes * Fix card counters writing to global * Fix CI tests * Fix Windows CI * interface() is a protected keyword for MSVC Took 5 minutes Took 5 seconds * [Settings] Keep menu settings on the appearance settings page Leave the 'Menu settings' group box on the appearance settings page for now; relocating it to the user interface settings page will be done in a separate PR. Took 6 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
62 lines
2.1 KiB
C++
62 lines
2.1 KiB
C++
#include "cache_storage_settings.h"
|
|
|
|
CacheStorageSettings::CacheStorageSettings(const QString &settingPath, QObject *parent)
|
|
: SettingsManager(settingPath + "cache_storage.ini", "cache_storage", QString(), parent)
|
|
{
|
|
}
|
|
|
|
int CacheStorageSettings::getPixmapCacheSize() const
|
|
{
|
|
return getValue("pixmapCacheSize", QString(), QString(), PIXMAPCACHE_SIZE_DEFAULT).toInt();
|
|
}
|
|
|
|
int CacheStorageSettings::getNetworkCacheSizeInMB() const
|
|
{
|
|
return getValue("networkCacheSize", QString(), QString(), NETWORK_CACHE_SIZE_DEFAULT).toInt();
|
|
}
|
|
|
|
int CacheStorageSettings::getRedirectCacheTtl() const
|
|
{
|
|
return getValue("redirectCacheTtl", QString(), QString(), NETWORK_REDIRECT_CACHE_TTL_DEFAULT).toInt();
|
|
}
|
|
|
|
int CacheStorageSettings::getCardPictureLoaderCacheMethod() const
|
|
{
|
|
return getValue("cardPictureLoaderCacheMethod", QString(), QString(), 0).toInt();
|
|
}
|
|
|
|
int CacheStorageSettings::getLocalCardImageStorageNamingScheme() const
|
|
{
|
|
return getValue("localCardImageStorageNamingScheme", QString(), QString(), LOCAL_CARD_IMAGE_NAMING_SCHEME_DEFAULT)
|
|
.toInt();
|
|
}
|
|
|
|
void CacheStorageSettings::setPixmapCacheSize(int _pixmapCacheSize)
|
|
{
|
|
setValue(_pixmapCacheSize, "pixmapCacheSize");
|
|
emit pixmapCacheSizeChanged(_pixmapCacheSize);
|
|
}
|
|
|
|
void CacheStorageSettings::setNetworkCacheSizeInMB(int _networkCacheSize)
|
|
{
|
|
setValue(_networkCacheSize, "networkCacheSize");
|
|
emit networkCacheSizeChanged(_networkCacheSize);
|
|
}
|
|
|
|
void CacheStorageSettings::setNetworkRedirectCacheTtl(int _redirectCacheTtl)
|
|
{
|
|
setValue(_redirectCacheTtl, "redirectCacheTtl");
|
|
emit redirectCacheTtlChanged(_redirectCacheTtl);
|
|
}
|
|
|
|
void CacheStorageSettings::setCardImageCacheMethod(int _cardImageCachingMethod)
|
|
{
|
|
setValue(_cardImageCachingMethod, "cardPictureLoaderCacheMethod");
|
|
emit cardPictureLoaderCacheMethodChanged(_cardImageCachingMethod);
|
|
}
|
|
|
|
void CacheStorageSettings::setLocalCardImageStorageNamingScheme(int _localCardImageStorageNamingScheme)
|
|
{
|
|
setValue(_localCardImageStorageNamingScheme, "localCardImageStorageNamingScheme");
|
|
emit localCardImageStorageNamingSchemeChanged(_localCardImageStorageNamingScheme);
|
|
}
|