Skip to content

Commit

Permalink
Playlist: Grey invalid song entries when updating items.
Browse files Browse the repository at this point in the history
  • Loading branch information
smithjd15 committed Jan 1, 2022
1 parent d8bf52b commit 06d92de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/playlist/playlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,9 @@ void Playlist::UpdateItems(const SongList& songs) {
QLinkedList<Song> 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<Song> it(songs_list);
Expand All @@ -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
Expand Down

0 comments on commit 06d92de

Please sign in to comment.