SetActiveToCurrent: Check if the playlist changed. If not, then do not call SetActivePlaylist().

This commit is contained in:
Andreas 2013-03-20 15:33:53 +01:00
parent b9ff2dc46d
commit 329a91c265
2 changed files with 11 additions and 1 deletions

View File

@ -252,6 +252,16 @@ void PlaylistManager::SetActivePlaylist(int id) {
sequence_->SetUsingDynamicPlaylist(active()->is_dynamic());
}
void PlaylistManager::SetActiveToCurrent() {
// Check if we need to update the active playlist.
// By calling SetActiveToCurrent, the playlist manager emits the signal
// "ActiveChanged". This signal causes the network remote module to
// send all playlists to the clients, even no change happend.
if (current_id() != active_id()) {
SetActivePlaylist(current_id());
}
}
void PlaylistManager::ClearCurrent() {
current()->Clear();
}

View File

@ -181,7 +181,7 @@ public slots:
void SetCurrentPlaylist(int id);
void SetActivePlaylist(int id);
void SetActiveToCurrent() { SetActivePlaylist(current_id()); }
void SetActiveToCurrent();
void SelectionChanged(const QItemSelection& selection);