Implement disk caching of album art (#360)

* Implement disk caching of album art

This includes a button to clear the cache in the settings, as
requested.

Closes #358

* Make the cache size defaults match

* Implement the review by jonaski

* Fix more problems with the PR
This commit is contained in:
Gavin D. Howard
2020-02-07 15:18:18 -07:00
committed by GitHub
parent ab7b65a30b
commit 691f5d99ca
10 changed files with 254 additions and 16 deletions

View File

@@ -39,6 +39,18 @@ public:
~CollectionSettingsPage();
static const char *kSettingsGroup;
static const char *kSettingsCacheSize;
static const char *kSettingsCacheSizeUnit;
static const char *kSettingsDiskCacheEnable;
static const char *kSettingsDiskCacheSize;
static const char *kSettingsDiskCacheSizeUnit;
enum CacheSizeUnit {
CacheSizeUnit_KB,
CacheSizeUnit_MB,
CacheSizeUnit_GB,
CacheSizeUnit_TB,
};
enum SaveCover {
SaveCover_Hash = 1,
@@ -53,11 +65,14 @@ private slots:
void Remove();
void CurrentRowChanged(const QModelIndex &index);
void DiskCacheEnable(int state);
void CoverSaveInAlbumDirChanged();
private:
Ui_CollectionSettingsPage *ui_;
bool initialised_model_;
static const QStringList cacheUnitNames;
};
#endif // COLLECTIONSETTINGSPAGE_H