MPRIS' TracklistChanged event now contains the length of the playlist that has actually changed (Update issue #374)
the PlaylistChanged event now shows which playlist has changed
This commit is contained in:
parent
6bf3162449
commit
04bbf73cff
@ -74,11 +74,11 @@ Mpris1TrackList::Mpris1TrackList(Player* player, QObject* parent)
|
||||
new MprisTrackList(this);
|
||||
QDBusConnection::sessionBus().registerObject("/TrackList", this);
|
||||
|
||||
connect(player->playlists(), SIGNAL(PlaylistChanged()), SLOT(PlaylistChanged()));
|
||||
connect(player->playlists(), SIGNAL(PlaylistChanged(Playlist*)), SLOT(PlaylistChanged(Playlist*)));
|
||||
}
|
||||
|
||||
void Mpris1TrackList::PlaylistChanged() {
|
||||
emit TrackListChange(GetLength());
|
||||
void Mpris1TrackList::PlaylistChanged(Playlist* playlist) {
|
||||
emit TrackListChange(playlist->rowCount());
|
||||
}
|
||||
|
||||
// we use the state from event and don't try to obtain it from Player
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <QObject>
|
||||
|
||||
class Player;
|
||||
class Playlist;
|
||||
|
||||
struct DBusStatus { // From Amarok.
|
||||
int play; // Playing = 0, Paused = 1, Stopped = 2
|
||||
@ -183,7 +184,7 @@ signals:
|
||||
void TrackListChange(int i);
|
||||
|
||||
private slots:
|
||||
void PlaylistChanged();
|
||||
void PlaylistChanged(Playlist* playlist);
|
||||
|
||||
private:
|
||||
Player* player_;
|
||||
|
@ -74,7 +74,7 @@ Playlist* PlaylistManager::AddPlaylist(int id, const QString& name) {
|
||||
ret->set_sequence(sequence_);
|
||||
|
||||
connect(ret, SIGNAL(CurrentSongChanged(Song)), SIGNAL(CurrentSongChanged(Song)));
|
||||
connect(ret, SIGNAL(PlaylistChanged()), SIGNAL(PlaylistChanged()));
|
||||
connect(ret, SIGNAL(PlaylistChanged()), SLOT(OneOfPlaylistsChanged()));
|
||||
connect(ret, SIGNAL(PlaylistChanged()), SLOT(UpdateSummaryText()));
|
||||
connect(ret, SIGNAL(EditingFinished(QModelIndex)), SIGNAL(EditingFinished(QModelIndex)));
|
||||
connect(ret, SIGNAL(LoadTracksError(QString)), SIGNAL(Error(QString)));
|
||||
@ -177,6 +177,10 @@ void PlaylistManager::Remove(int id) {
|
||||
emit PlaylistRemoved(id);
|
||||
}
|
||||
|
||||
void PlaylistManager::OneOfPlaylistsChanged() {
|
||||
emit PlaylistChanged(qobject_cast<Playlist*>(sender()));
|
||||
}
|
||||
|
||||
void PlaylistManager::SetCurrentPlaylist(int id) {
|
||||
Q_ASSERT(playlists_.contains(id));
|
||||
current_ = id;
|
||||
|
@ -102,11 +102,12 @@ signals:
|
||||
|
||||
// Forwarded from individual playlists
|
||||
void CurrentSongChanged(const Song& song);
|
||||
void PlaylistChanged();
|
||||
void PlaylistChanged(Playlist* playlist);
|
||||
void EditingFinished(const QModelIndex& index);
|
||||
void PlayRequested(const QModelIndex& index);
|
||||
|
||||
private slots:
|
||||
void OneOfPlaylistsChanged();
|
||||
void UpdateSummaryText();
|
||||
void SongsDiscovered(const SongList& songs);
|
||||
void LoadFinished(bool success);
|
||||
|
Loading…
x
Reference in New Issue
Block a user