Save cache if toggle grouping
This commit is contained in:
committed by
craig.p.drummond
parent
eedcbc3cf3
commit
a23c83be98
@@ -149,6 +149,12 @@ Song Device::fixPath(const Song &orig, bool fullPath) const
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void Device::toggleGrouping()
|
||||
{
|
||||
MusicLibraryItemRoot::toggleGrouping();
|
||||
saveCache();
|
||||
}
|
||||
|
||||
const QLatin1String Device::constNoCover("-");
|
||||
const QLatin1String Device::constEmbedCover("+");
|
||||
|
||||
|
||||
@@ -160,6 +160,7 @@ public:
|
||||
virtual void removeCache() { }
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
void toggleGrouping();
|
||||
virtual void saveCache();
|
||||
const QString & id() const { return deviceId; }
|
||||
void applyUpdate();
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
void setUseArtistImages(bool a) { artistImages=a; }
|
||||
bool useLargeImages() const { return largeImages; }
|
||||
void setLargeImages(bool a) { largeImages=a; }
|
||||
void toggleGrouping();
|
||||
virtual void toggleGrouping();
|
||||
void applyGrouping();
|
||||
void clearItems();
|
||||
void setModel(MusicModel *m) { m_model=m; }
|
||||
|
||||
@@ -552,6 +552,7 @@ void MusicLibraryModel::toggleGrouping()
|
||||
{
|
||||
beginResetModel();
|
||||
rootItem->toggleGrouping();
|
||||
rootItem->toXML(cacheFileName(), databaseTime);
|
||||
endResetModel();
|
||||
if (mpdModel) {
|
||||
AlbumsModel::self()->update(rootItem);
|
||||
|
||||
Reference in New Issue
Block a user