diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-25 15:19:35 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-04-25 10:23:05 -0700 |
commit | e26ac9e58dfc75ca735ac0f59d4f912319be6ae2 (patch) | |
tree | 3372ade4150672155654e78a1b5f6dcaf94b36af /desktop-widgets/divelistview.cpp | |
parent | c00737eb2366f79a95ed9f43f71c489cb23596cc (diff) | |
download | subsurface-e26ac9e58dfc75ca735ac0f59d4f912319be6ae2.tar.gz |
desktop: remove selection-code to select a new current_dive
The undo-machinery makes sure that a current_dive always exists
after an undo command. This part of the code should never be
called.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/divelistview.cpp')
-rw-r--r-- | desktop-widgets/divelistview.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index f72c8ed5b..c2b72fbed 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -337,9 +337,6 @@ void DiveListView::selectDive(int i, bool scrollto) void DiveListView::selectDives(const QList<int> &newDiveSelection) { - int firstInList, newSelection; - struct dive *d; - if (!newDiveSelection.count()) return; @@ -350,22 +347,10 @@ void DiveListView::selectDives(const QList<int> &newDiveSelection) // becomes the selected_dive that we scroll to QList<int> sortedSelection = newDiveSelection; std::sort(sortedSelection.begin(), sortedSelection.end()); - newSelection = firstInList = sortedSelection.first(); while (!sortedSelection.isEmpty()) selectDive(sortedSelection.takeLast()); - while (!current_dive) { - // that can happen if we restored a selection after edit - // and the only selected dive is no longer visible because of a filter - newSelection--; - if (newSelection < 0) - newSelection = dive_table.nr - 1; - if (newSelection == firstInList) - break; - if ((d = get_dive(newSelection)) != NULL && !d->hidden_by_filter) - selectDive(newSelection); - } QAbstractItemModel *m = model(); QModelIndexList idxList = m->match(m->index(0, 0), DiveTripModelBase::DIVE_IDX, get_divenr(current_dive), 2, Qt::MatchRecursive); if (!idxList.isEmpty()) { |