mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-20 05:43:54 -07:00
[PictureLoader] Allow saving downloaded images to local storage and not just the QNetworkManager cache (#6620)
* [PictureLoader] Allow saving downloaded images to local storage and not just the QNetworkManager cache. Took 1 hour 11 minutes Took 4 seconds Took 25 seconds * Give people options from a dropdown. Took 1 hour 6 minutes Took 3 seconds * Simplify directory removal code. Took 5 minutes Took 8 seconds * Merge pull request #8 * Create new category for new settings * Split off storage settings Took 47 minutes Took 4 seconds * Allow toggling between caching methods. Took 1 hour 30 minutes Took 9 seconds * Adjust settings dialog. Took 5 minutes Took 59 seconds Took 22 seconds Took 6 seconds * tr() strings Took 1 minute Took 6 seconds * Readjust layout, default naming scheme. Took 5 minutes * Add stretch. Took 9 minutes * Make scrollable. Took 2 minutes * Add icon. Took 7 minutes * Change naming to be uniform. Took 3 minutes Took 3 seconds --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
This commit is contained in:
parent
20cd7ce73d
commit
f8ce5c2e39
12 changed files with 1382 additions and 132 deletions
|
|
@ -7,6 +7,8 @@
|
|||
#ifndef SETTINGSCACHE_H
|
||||
#define SETTINGSCACHE_H
|
||||
|
||||
#include "../../interface/card_picture_loader/card_picture_loader_cache_method.h"
|
||||
#include "../../interface/card_picture_loader/card_picture_loader_local_schemes.h"
|
||||
#include "shortcuts_settings.h"
|
||||
|
||||
#include <QDate>
|
||||
|
|
@ -184,6 +186,8 @@ signals:
|
|||
void pixmapCacheSizeChanged(int newSizeInMBs);
|
||||
void networkCacheSizeChanged(int newSizeInMBs);
|
||||
void redirectCacheTtlChanged(int newTtl);
|
||||
void cardPictureLoaderCacheMethodChanged(int cardPictureLoaderCacheMethod);
|
||||
void localCardImageStorageNamingSchemeChanged(int localCardImageStorageNamingScheme);
|
||||
void masterVolumeChanged(int value);
|
||||
void chatMentionCompleterChanged();
|
||||
void downloadSpoilerTimeIndexChanged();
|
||||
|
|
@ -303,6 +307,8 @@ private:
|
|||
int pixmapCacheSize;
|
||||
int networkCacheSize;
|
||||
int redirectCacheTtl;
|
||||
int cardPictureLoaderCacheMethod;
|
||||
int localCardImageStorageNamingScheme;
|
||||
bool scaleCards;
|
||||
int verticalCardOverlapPercent;
|
||||
bool showMessagePopups;
|
||||
|
|
@ -786,6 +792,10 @@ public:
|
|||
{
|
||||
return pixmapCacheSize;
|
||||
}
|
||||
[[nodiscard]] CardPictureLoaderCacheMethod::CacheMethod getCardPictureLoaderCacheMethod() const
|
||||
{
|
||||
return static_cast<CardPictureLoaderCacheMethod::CacheMethod>(cardPictureLoaderCacheMethod);
|
||||
}
|
||||
[[nodiscard]] int getNetworkCacheSizeInMB() const
|
||||
{
|
||||
return networkCacheSize;
|
||||
|
|
@ -794,6 +804,10 @@ public:
|
|||
{
|
||||
return redirectCacheTtl;
|
||||
}
|
||||
[[nodiscard]] CardPictureLoaderLocalSchemes::NamingScheme getLocalCardImageStorageNamingScheme() const
|
||||
{
|
||||
return static_cast<CardPictureLoaderLocalSchemes::NamingScheme>(localCardImageStorageNamingScheme);
|
||||
}
|
||||
[[nodiscard]] bool getScaleCards() const
|
||||
{
|
||||
return scaleCards;
|
||||
|
|
@ -1098,8 +1112,11 @@ public slots:
|
|||
void setIgnoreUnregisteredUsers(QT_STATE_CHANGED_T _ignoreUnregisteredUsers);
|
||||
void setIgnoreUnregisteredUserMessages(QT_STATE_CHANGED_T _ignoreUnregisteredUserMessages);
|
||||
void setPixmapCacheSize(const int _pixmapCacheSize);
|
||||
void setCardImageCacheMethod(CardPictureLoaderCacheMethod::CacheMethod _cardImageCachingMethod);
|
||||
void setNetworkCacheSizeInMB(const int _networkCacheSize);
|
||||
void setNetworkRedirectCacheTtl(const int _redirectCacheTtl);
|
||||
void setLocalCardImageStorageNamingScheme(
|
||||
const CardPictureLoaderLocalSchemes::NamingScheme _localCardImageStorageNamingScheme);
|
||||
void setCardScaling(const QT_STATE_CHANGED_T _scaleCards);
|
||||
void setStackCardOverlapPercent(const int _verticalCardOverlapPercent);
|
||||
void setShowMessagePopups(const QT_STATE_CHANGED_T _showMessagePopups);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue