From 06d92deefb96018b0151e8baa8fbfeee9d815d71 Mon Sep 17 00:00:00 2001 From: "James D. Smith" Date: Fri, 31 Dec 2021 21:55:02 -0700 Subject: [PATCH] Playlist: Grey invalid song entries when updating items. --- src/playlist/playlist.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index fc41481f9d..b5fa8d2126 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -1204,6 +1204,9 @@ void Playlist::UpdateItems(const SongList& songs) { QLinkedList songs_list; for (const Song& song : songs) songs_list.append(song); + QSettings s; + s.beginGroup(kSettingsGroup); + for (int i = 0; i < items_.size(); i++) { // Update current items list QMutableLinkedListIterator it(songs_list); @@ -1223,6 +1226,12 @@ void Playlist::UpdateItems(const SongList& songs) { } else { new_item = PlaylistItemPtr(new SongPlaylistItem(song)); } + if (s.value("greyoutdeleted", false).toBool()) { + if (!song.is_valid()) { + new_item->SetForegroundColor(kInvalidSongPriority, + kInvalidSongColor); + } + } items_[i] = new_item; emit dataChanged(index(i, 0), index(i, ColumnCount - 1)); // Also update undo actions