diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-15 22:35:24 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-05-06 13:58:09 -0700 |
commit | 91e81879a5a28145a2b79d8c9172e1ea3c3580bc (patch) | |
tree | f29bed7e5eda0283c9fedadb44bd566cd0f3aec6 | |
parent | bd960ea088aebb19de9cdee455103e1878e2506f (diff) | |
download | subsurface-91e81879a5a28145a2b79d8c9172e1ea3c3580bc.tar.gz |
media: put photo-view in row-selection mode
It makes no sense to have the view in item-selection mode, since
each picture represents a row. Thus we can remove a few lines
of code.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r-- | desktop-widgets/tab-widgets/TabDivePhotos.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/desktop-widgets/tab-widgets/TabDivePhotos.cpp b/desktop-widgets/tab-widgets/TabDivePhotos.cpp index 921511de4..dab5d2c67 100644 --- a/desktop-widgets/tab-widgets/TabDivePhotos.cpp +++ b/desktop-widgets/tab-widgets/TabDivePhotos.cpp @@ -26,6 +26,7 @@ TabDivePhotos::TabDivePhotos(QWidget *parent) ui->setupUi(this); ui->photosView->setModel(divePictureModel); ui->photosView->setSelectionMode(QAbstractItemView::ExtendedSelection); + ui->photosView->setSelectionBehavior(QAbstractItemView::SelectRows); ui->photosView->setResizeMode(QListView::Adjust); connect(ui->photosView, &DivePictureWidget::photoDoubleClicked, @@ -70,8 +71,6 @@ QVector<QString> TabDivePhotos::getSelectedFilenames() const if (!ui->photosView->selectionModel()->hasSelection()) return selectedPhotos; QModelIndexList indices = ui->photosView->selectionModel()->selectedRows(); - if (indices.count() == 0) - indices = ui->photosView->selectionModel()->selectedIndexes(); selectedPhotos.reserve(indices.count()); for (const auto &photo: indices) { if (photo.isValid()) { @@ -115,8 +114,6 @@ void TabDivePhotos::saveSubtitles() if (!ui->photosView->selectionModel()->hasSelection()) return; QModelIndexList indices = ui->photosView->selectionModel()->selectedRows(); - if (indices.count() == 0) - indices = ui->photosView->selectionModel()->selectedIndexes(); selectedPhotos.reserve(indices.count()); for (const auto &photo: indices) { if (photo.isValid()) { |