From 763458564c91c7b4e6233f5018c9527fd49ba9b8 Mon Sep 17 00:00:00 2001 From: Ale Martinez Date: Wed, 2 Dec 2020 19:12:56 -0300 Subject: [PATCH] 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] --- src/Train/TrainSidebar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Train/TrainSidebar.cpp b/src/Train/TrainSidebar.cpp index 98716036f..b7a7736fc 100644 --- a/src/Train/TrainSidebar.cpp +++ b/src/Train/TrainSidebar.cpp @@ -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