fixing a regression where clicking on empty playlist space would crash Clementine
This commit is contained in:
parent
2e286e4271
commit
17af8b935c
@ -1050,9 +1050,7 @@ void MainWindow::AddToPlaylist(QMimeData* data) {
|
|||||||
|
|
||||||
void MainWindow::PlaylistRightClick(const QPoint& global_pos, const QModelIndex& index) {
|
void MainWindow::PlaylistRightClick(const QPoint& global_pos, const QModelIndex& index) {
|
||||||
QModelIndex source_index = playlists_->current()->proxy()->mapToSource(index);
|
QModelIndex source_index = playlists_->current()->proxy()->mapToSource(index);
|
||||||
|
|
||||||
playlist_menu_index_ = source_index;
|
playlist_menu_index_ = source_index;
|
||||||
PlaylistItemPtr current_item = playlists_->current()->item_at(source_index.row());
|
|
||||||
|
|
||||||
// Is this song currently playing?
|
// Is this song currently playing?
|
||||||
if (playlists_->current()->current_row() == source_index.row() && player_->GetState() == Engine::Playing) {
|
if (playlists_->current()->current_row() == source_index.row() && player_->GetState() == Engine::Playing) {
|
||||||
@ -1067,7 +1065,7 @@ void MainWindow::PlaylistRightClick(const QPoint& global_pos, const QModelIndex&
|
|||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
playlist_play_pause_->setEnabled(
|
playlist_play_pause_->setEnabled(
|
||||||
playlists_->current()->current_row() != source_index.row() ||
|
playlists_->current()->current_row() != source_index.row() ||
|
||||||
! (current_item->options() & PlaylistItem::PauseDisabled));
|
! (playlists_->current()->item_at(source_index.row())->options() & PlaylistItem::PauseDisabled));
|
||||||
} else {
|
} else {
|
||||||
playlist_play_pause_->setEnabled(false);
|
playlist_play_pause_->setEnabled(false);
|
||||||
}
|
}
|
||||||
@ -1156,7 +1154,7 @@ void MainWindow::PlaylistRightClick(const QPoint& global_pos, const QModelIndex&
|
|||||||
ui_->action_edit_value->setText(tr("Edit tag \"%1\"...").arg(column_name));
|
ui_->action_edit_value->setText(tr("Edit tag \"%1\"...").arg(column_name));
|
||||||
|
|
||||||
// Is it a library item?
|
// Is it a library item?
|
||||||
if (current_item->IsLocalLibraryItem()) {
|
if (playlists_->current()->item_at(source_index.row())->IsLocalLibraryItem()) {
|
||||||
playlist_organise_->setVisible(editable);
|
playlist_organise_->setVisible(editable);
|
||||||
} else {
|
} else {
|
||||||
playlist_copy_to_library_->setVisible(editable);
|
playlist_copy_to_library_->setVisible(editable);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user