Toggle fetch covers bug

This commit is contained in:
nikwen.developer@gmail.com
2014-08-17 11:13:50 +00:00
committed by nikwen.developer@gmail.com
parent 2daeda366e
commit 12cb6d69cb
3 changed files with 10 additions and 2 deletions

View File

@@ -154,7 +154,13 @@ void MPDBackend::setAlbumViewSort(int s) {
void MPDBackend::setCoverFetch(bool s) {
Covers::self()->setFetchCovers(s);
}
void MPDBackend::resetAllModels() { //TODO: Better idea?
MusicLibraryModel::self()->resetModel();
AlbumsModel::self()->resetModel();
PlaylistsModel::self()->resetModel();
}
void MPDBackend::playPause() {
switch (MPDStatus::self()->state()) {
case MPDState_Playing:

View File

@@ -111,6 +111,7 @@ public:
Q_INVOKABLE int getCrossfade() { return MPDStatus::self()->crossFade(); }
Q_INVOKABLE QStringList getOutputs () { return outputSettings; }
Q_INVOKABLE QString getReplayGain () { return replayGainSetting; }
Q_INVOKABLE void resetAllModels();
PlayQueueProxyModel * getPlayQueueProxyModel() { return &playQueueProxyModel; }
MusicLibraryProxyModel * getArtistsProxyModel() { return &artistsProxyModel; }

View File

@@ -53,7 +53,8 @@ Item {
onContentsChanged: {
if (contents != undefined) {
console.log("Update cover fetch")
backend.setCoverFetch(contents["coverFetch"]) //TODO: Untick fetch checkbox => Delete saved images => Tick fetch checkbox => First few album covers are not loaded
backend.setCoverFetch(contents["coverFetch"]) //TODO: Untick fetch checkbox => Delete saved images => Reopen app => Tick fetch checkbox => First few album covers are not loaded
backend.resetAllModels()
}
}
}