mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2024-12-17 02:59:03 +01:00
Fix setting pixmap cache limit
This commit is contained in:
parent
b386ca14df
commit
cf0442d5b8
@ -70,6 +70,7 @@ using std::placeholders::_2;
|
|||||||
|
|
||||||
const char *CollectionModel::kSavedGroupingsSettingsGroup = "SavedGroupings";
|
const char *CollectionModel::kSavedGroupingsSettingsGroup = "SavedGroupings";
|
||||||
const int CollectionModel::kPrettyCoverSize = 32;
|
const int CollectionModel::kPrettyCoverSize = 32;
|
||||||
|
const int CollectionModel::kPixmapCacheLimit = QPixmapCache::cacheLimit() * 8;
|
||||||
|
|
||||||
static bool IsArtistGroupBy(const CollectionModel::GroupBy by) {
|
static bool IsArtistGroupBy(const CollectionModel::GroupBy by) {
|
||||||
return by == CollectionModel::GroupBy_Artist || by == CollectionModel::GroupBy_AlbumArtist;
|
return by == CollectionModel::GroupBy_Artist || by == CollectionModel::GroupBy_AlbumArtist;
|
||||||
@ -125,7 +126,7 @@ CollectionModel::CollectionModel(CollectionBackend *backend, Application *app, Q
|
|||||||
backend_->UpdateTotalArtistCountAsync();
|
backend_->UpdateTotalArtistCountAsync();
|
||||||
backend_->UpdateTotalAlbumCountAsync();
|
backend_->UpdateTotalAlbumCountAsync();
|
||||||
|
|
||||||
QPixmapCache::setCacheLimit(QPixmapCache::cacheLimit() * 8);
|
QPixmapCache::setCacheLimit(kPixmapCacheLimit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -835,6 +836,7 @@ void CollectionModel::BeginReset() {
|
|||||||
divider_nodes_.clear();
|
divider_nodes_.clear();
|
||||||
pending_art_.clear();
|
pending_art_.clear();
|
||||||
pending_cache_keys_.clear();
|
pending_cache_keys_.clear();
|
||||||
|
QPixmapCache::clear();
|
||||||
|
|
||||||
root_ = new CollectionItem(this);
|
root_ = new CollectionItem(this);
|
||||||
root_->compilation_artist_node_ = nullptr;
|
root_->compilation_artist_node_ = nullptr;
|
||||||
|
@ -70,6 +70,7 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
|||||||
static const char *kSavedGroupingsSettingsGroup;
|
static const char *kSavedGroupingsSettingsGroup;
|
||||||
|
|
||||||
static const int kPrettyCoverSize;
|
static const int kPrettyCoverSize;
|
||||||
|
static const int kPixmapCacheLimit;
|
||||||
|
|
||||||
enum Role {
|
enum Role {
|
||||||
Role_Type = Qt::UserRole + 1,
|
Role_Type = Qt::UserRole + 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user