mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-05 14:28:40 +01:00
Don't crash when the playlist view in the smart playlist preview doesn't get a Player*.
This commit is contained in:
parent
483c36748e
commit
74c4720054
@ -141,7 +141,6 @@ PlaylistView::PlaylistView(QWidget *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistView::SetItemDelegates(LibraryBackend* backend) {
|
void PlaylistView::SetItemDelegates(LibraryBackend* backend) {
|
||||||
Q_ASSERT(player_);
|
|
||||||
rating_delegate_ = new RatingItemDelegate(this);
|
rating_delegate_ = new RatingItemDelegate(this);
|
||||||
|
|
||||||
setItemDelegate(new PlaylistDelegateBase(this));
|
setItemDelegate(new PlaylistDelegateBase(this));
|
||||||
@ -167,7 +166,12 @@ void PlaylistView::SetItemDelegates(LibraryBackend* backend) {
|
|||||||
setItemDelegateForColumn(Playlist::Column_Filename, new NativeSeparatorsDelegate(this));
|
setItemDelegateForColumn(Playlist::Column_Filename, new NativeSeparatorsDelegate(this));
|
||||||
setItemDelegateForColumn(Playlist::Column_Rating, rating_delegate_);
|
setItemDelegateForColumn(Playlist::Column_Rating, rating_delegate_);
|
||||||
setItemDelegateForColumn(Playlist::Column_LastPlayed, new LastPlayedItemDelegate(this));
|
setItemDelegateForColumn(Playlist::Column_LastPlayed, new LastPlayedItemDelegate(this));
|
||||||
|
|
||||||
|
if (player_) {
|
||||||
setItemDelegateForColumn(Playlist::Column_Source, new SongSourceDelegate(this, player_));
|
setItemDelegateForColumn(Playlist::Column_Source, new SongSourceDelegate(this, player_));
|
||||||
|
} else {
|
||||||
|
header_->HideSection(Playlist::Column_Source);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistView::SetPlaylist(Playlist* playlist) {
|
void PlaylistView::SetPlaylist(Playlist* playlist) {
|
||||||
|
Loading…
Reference in New Issue
Block a user