aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-09-21 14:30:04 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-09-21 16:07:24 -0700
commit4b401eb2def0b90dd3958aa114d18621a14b7b9d (patch)
tree8c2d0336f8971e104a785a0f82baa444e3d537aa /desktop-widgets/tab-widgets
parent44a291a09f06733ff84dc99d532351d6cbc927c6 (diff)
downloadsubsurface-4b401eb2def0b90dd3958aa114d18621a14b7b9d.tar.gz
Cleanup: return each dive site only once in selectedDiveSites()
In TabDiveSite::selectedDiveSites(), the QItemSelectionModel:: selectedIndexes() function was used. Thus for every selected dive site 8 entries were added to the return-vector! Instead, use the QItemSelectionModel::selectedRows() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveSite.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveSite.cpp b/desktop-widgets/tab-widgets/TabDiveSite.cpp
index ee232b703..e9eee0a88 100644
--- a/desktop-widgets/tab-widgets/TabDiveSite.cpp
+++ b/desktop-widgets/tab-widgets/TabDiveSite.cpp
@@ -85,7 +85,7 @@ void TabDiveSite::on_filterText_textChanged(const QString &text)
QVector<dive_site *> TabDiveSite::selectedDiveSites()
{
- const QModelIndexList indexes = ui.diveSites->view()->selectionModel()->selectedIndexes();
+ const QModelIndexList indexes = ui.diveSites->view()->selectionModel()->selectedRows();
QVector<dive_site *> sites;
sites.reserve(indexes.size());
for (const QModelIndex &idx: indexes) {