1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 03:45:56 +01:00

Don't crash when the playlist view in the smart playlist preview doesn't get a Player*.

This commit is contained in:
David Sansome 2012-01-06 11:22:17 +00:00
parent 483c36748e
commit 74c4720054

View File

@ -141,7 +141,6 @@ PlaylistView::PlaylistView(QWidget *parent)
}
void PlaylistView::SetItemDelegates(LibraryBackend* backend) {
Q_ASSERT(player_);
rating_delegate_ = new RatingItemDelegate(this);
setItemDelegate(new PlaylistDelegateBase(this));
@ -167,7 +166,12 @@ void PlaylistView::SetItemDelegates(LibraryBackend* backend) {
setItemDelegateForColumn(Playlist::Column_Filename, new NativeSeparatorsDelegate(this));
setItemDelegateForColumn(Playlist::Column_Rating, rating_delegate_);
setItemDelegateForColumn(Playlist::Column_LastPlayed, new LastPlayedItemDelegate(this));
setItemDelegateForColumn(Playlist::Column_Source, new SongSourceDelegate(this, player_));
if (player_) {
setItemDelegateForColumn(Playlist::Column_Source, new SongSourceDelegate(this, player_));
} else {
header_->HideSection(Playlist::Column_Source);
}
}
void PlaylistView::SetPlaylist(Playlist* playlist) {