When we recieve an updated signal frmo MPD, refresh library view.

This commit is contained in:
craig
2012-01-19 20:21:16 +00:00
parent 52441d2ea8
commit 52db6eb496
3 changed files with 8 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
changed. (Previously the whole model was replaced).
3. When changing name of playlist, show the original name in the line-edit.
4. Fix adding songs with spaces in their filenames to stored playlists
5. When we recieve an updated signal frmo MPD, refresh library view.
0.2.1
-----

View File

@@ -70,6 +70,7 @@ LibraryPage::LibraryPage(MainWindow *p)
MusicLibraryModel::self(), SLOT(updateMusicLibrary(MusicLibraryItemRoot *, QDateTime)));
connect(MPDConnection::self(), SIGNAL(updatingLibrary()), view, SLOT(showSpinner()));
connect(MPDConnection::self(), SIGNAL(updatedLibrary()), view, SLOT(hideSpinner()));
connect(MPDConnection::self(), SIGNAL(databaseUpdated()), this, SLOT(databaseUpdated()));
connect(MusicLibraryModel::self(), SIGNAL(updateGenres(const QStringList &)), this, SLOT(updateGenres(const QStringList &)));
connect(this, SIGNAL(listAllInfo(const QDateTime &)), MPDConnection::self(), SLOT(listAllInfo(const QDateTime &)));
connect(view, SIGNAL(itemsSelected(bool)), addToPlaylist, SLOT(setEnabled(bool)));
@@ -103,6 +104,11 @@ void LibraryPage::refresh(Refresh type)
}
}
void LibraryPage::databaseUpdated()
{
refresh(RefreshFromCache);
}
void LibraryPage::clear()
{
MusicLibraryModel::self()->clear();

View File

@@ -65,6 +65,7 @@ public Q_SLOTS:
void updateGenres(const QStringList &genres);
void itemDoubleClicked(const QModelIndex &);
void searchItems();
void databaseUpdated();
private:
MusicLibraryProxyModel proxy;