Commit c6afa4c5 authored by Michael Pyne's avatar Michael Pyne

Disable tag updating from inline editor.

This mitigates a potential data-loss situation that might happen when
adding new music items:

  Juk starts processing the new items in addFiles,
  Results in a new CollectionListItem being created,
  The resultant PlaylistItem superclass calls setFlags,
  This causes Qt to send a *data* changed signal from the QTreeWidget
    holding all the playlist items, saying that a *different*
    QTreeWidgetItem / PlaylistItem has been changed.
  This signal is normally only possible because of user interaction with
    the inline editor. As a result JuK assumes the signal is a user
    request to edit the track's tag, and does so. I have seen this
    cause existing files to take on the same tag values as one of the
    incoming new tracks.

Although in theory a user could immediately select the "Undo" command to
fix this, that's not a very good workaround. Since we have a separate
tag editor already, we'll just use that instead until we can figure out
a way to ensure that dataChanged signals are sent only when the data
itself has changed (not just flags caused by unrelated items being
created).

CHANGELOG: Prevent opening new items from inadvertently editing track metadata on existing items.
FIXED-IN:18.12.1
parent 976f77ad
......@@ -1329,11 +1329,19 @@ void Playlist::slotInitialize()
connect(this, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(slotShowRMBMenu(QPoint)));
connect(this, &QTreeWidget::itemChanged,
this, &Playlist::slotInlineEditDone);
connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
this, SLOT(slotPlayCurrent()));
// Disabled for now because adding new items (File->Open) causes Qt to send
// an itemChanged signal for unrelated playlist items which can cause the
// inline editor done slot to mistakenly overwrite tags associated to
// *other* playlist items. I haven't found a way to determine whether the
// itemChanged signal is really coming from the inline editor so instead
// users will need to use the tag editor. :(
// -- mpyne 2018-12-20
//connect(this, &QTreeWidget::itemChanged,
// this, &Playlist::slotInlineEditDone);
connect(action("resizeColumnsManually"), SIGNAL(triggered()),
this, SLOT(slotColumnResizeModeChanged()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment