mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
bd960ea088
commit
91e81879a5
1 changed files with 1 additions and 4 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue