Honor clear selection of media in Train Sidebar

CTRL+Click on a selected media file allows to clear the selection,
lets honor this action to have a way to train without video after
a media file has been selected.
[publish binaries]
This commit is contained in:
Ale Martinez
2020-12-02 19:12:56 -03:00
parent 5f68d2dce0
commit 763458564c

View File

@@ -1056,7 +1056,10 @@ TrainSidebar::mediaTreeWidgetSelectionChanged()
QModelIndex current = mediaTree->currentIndex();
QModelIndex target = vsortModel->mapToSource(current);
QString filename = videoModel->data(videoModel->index(target.row(), 0), Qt::DisplayRole).toString();
context->notifyMediaSelected(filename);
if (filename == context->videoFilename)
context->notifyMediaSelected(""); // CTRL+Click to clear selection
else
context->notifyMediaSelected(filename);
}
void