Only allow playlist editing if song is editable

Set proper flags in model instead of overriding edit in view.

Proper fix for #524
This commit is contained in:
Jonas Kvinge
2020-08-30 22:23:38 +02:00
parent 495c6bc21c
commit 22afcbcbb6
2 changed files with 8 additions and 12 deletions

View File

@@ -704,11 +704,6 @@ QModelIndex PlaylistView::PrevEditableIndex(const QModelIndex &current) {
bool PlaylistView::edit(const QModelIndex &idx, QAbstractItemView::EditTrigger trigger, QEvent *event) {
// Only allow playlist editing if song is editable.
if (trigger == QAbstractItemView::AllEditTriggers && !event && playlist_ && !playlist_->item_at(idx.row())->Metadata().IsEditable()) {
return false;
}
bool result = QAbstractItemView::edit(idx, trigger, event);
if (result && trigger == QAbstractItemView::AllEditTriggers && !event) {
playlist_->set_editing(idx.row());