mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-21 01:42:15 -07:00
Set the maximum network cache size from settings value on PictureLoaderWorker instantiation.
This commit is contained in:
parent
eca74114a2
commit
9f0e941476
2 changed files with 3 additions and 1 deletions
|
|
@ -136,6 +136,8 @@ PictureLoaderWorker::PictureLoaderWorker()
|
||||||
#endif
|
#endif
|
||||||
auto cache = new QNetworkDiskCache(this);
|
auto cache = new QNetworkDiskCache(this);
|
||||||
cache->setCacheDirectory(SettingsCache::instance().getNetworkCachePath());
|
cache->setCacheDirectory(SettingsCache::instance().getNetworkCachePath());
|
||||||
|
cache->setMaximumCacheSize(1024L * 1024L *
|
||||||
|
static_cast<qint64>(SettingsCache::instance().getNetworkCacheSizeInMB()));
|
||||||
// Note: the settings is in MB, but QNetworkDiskCache uses bytes
|
// Note: the settings is in MB, but QNetworkDiskCache uses bytes
|
||||||
connect(&SettingsCache::instance(), &SettingsCache::networkCacheSizeChanged, cache,
|
connect(&SettingsCache::instance(), &SettingsCache::networkCacheSizeChanged, cache,
|
||||||
[cache](int newSizeInMB) { cache->setMaximumCacheSize(1024L * 1024L * static_cast<qint64>(newSizeInMB)); });
|
[cache](int newSizeInMB) { cache->setMaximumCacheSize(1024L * 1024L * static_cast<qint64>(newSizeInMB)); });
|
||||||
|
|
|
||||||
|
|
@ -844,7 +844,7 @@ void DeckEditorSettingsPage::retranslateUi()
|
||||||
urlLinkLabel.setText(QString("<a href='%1'>%2</a>").arg(WIKI_CUSTOM_PIC_URL).arg(tr("How to add a custom URL")));
|
urlLinkLabel.setText(QString("<a href='%1'>%2</a>").arg(WIKI_CUSTOM_PIC_URL).arg(tr("How to add a custom URL")));
|
||||||
clearDownloadedPicsButton.setText(tr("Delete Downloaded Images"));
|
clearDownloadedPicsButton.setText(tr("Delete Downloaded Images"));
|
||||||
resetDownloadURLs.setText(tr("Reset Download URLs"));
|
resetDownloadURLs.setText(tr("Reset Download URLs"));
|
||||||
networkCacheLabel.setText(tr("Downloaded images directory size:"));
|
networkCacheLabel.setText(tr("Network Cache Size:"));
|
||||||
networkCacheEdit.setToolTip(tr("On-disk cache for downloaded pictures"));
|
networkCacheEdit.setToolTip(tr("On-disk cache for downloaded pictures"));
|
||||||
pixmapCacheLabel.setText(tr("Picture cache size:"));
|
pixmapCacheLabel.setText(tr("Picture cache size:"));
|
||||||
pixmapCacheEdit.setToolTip(tr("In-memory cache for pictures not currently on screen"));
|
pixmapCacheEdit.setToolTip(tr("In-memory cache for pictures not currently on screen"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue