From 434644b381cb1dc8d2080b19a9725bfe2660a217 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 17 Apr 2020 23:18:58 +0200 Subject: undo: make picture (media) deletion undoable The code is rather complex. Firstly, we have different representations of pictures throughout the code. Secondly, this tries to do add the pictures in batches to the divepicture model and that is always rather tricky. Signed-off-by: Berthold Stoeger --- desktop-widgets/tab-widgets/TabDivePhotos.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'desktop-widgets/tab-widgets') diff --git a/desktop-widgets/tab-widgets/TabDivePhotos.cpp b/desktop-widgets/tab-widgets/TabDivePhotos.cpp index 731e58388..db1b943e4 100644 --- a/desktop-widgets/tab-widgets/TabDivePhotos.cpp +++ b/desktop-widgets/tab-widgets/TabDivePhotos.cpp @@ -84,7 +84,8 @@ QVector TabDivePhotos::getSelectedFilenames() const void TabDivePhotos::removeSelectedPhotos() { - DivePictureModel::instance()->removePictures(getSelectedFilenames()); + QModelIndexList indices = ui->photosView->selectionModel()->selectedRows(); + DivePictureModel::instance()->removePictures(indices); } void TabDivePhotos::openFolderOfSelectedFiles() -- cgit v1.2.3-70-g09d2