diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-11-28 21:55:26 +0100 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2019-12-04 13:00:23 +0100 |
commit | 28e97e75556e50c33fb064a60725ab7937ef5440 (patch) | |
tree | c3907cb5abce0117c6f7d208b520f9f1c2be1481 /desktop-widgets/divelistview.h | |
parent | be26b0bd9aa6817ea6aa5c374172fc9518379b55 (diff) | |
download | subsurface-28e97e75556e50c33fb064a60725ab7937ef5440.tar.gz |
Cleanup: remove DiveListView::expandedRows member variable
The QList served as backing store for backupExpandedRows()
and restoreExpandedRows(). However, these always came in
pairs in the same scope. There is no reason to store the
expanded rows over a longer time.
Therefore, return the expanded rows from backupExpandedRows()
and take them as argument in restoreExpandedRows(). Morover
replace the QList<int> by the much lighter std::vector<int>.
We certainly don't need copy-on-write, reference-counting and
immutability of iterators in this case.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/divelistview.h')
-rw-r--r-- | desktop-widgets/divelistview.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/desktop-widgets/divelistview.h b/desktop-widgets/divelistview.h index d4954ee86..ce3021b3f 100644 --- a/desktop-widgets/divelistview.h +++ b/desktop-widgets/divelistview.h @@ -69,7 +69,6 @@ private: void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags) override; void selectAll() override; void selectionChangeDone(); - QList<int> expandedRows; DiveTripModelBase::Layout currentLayout; QModelIndex contextMenuIndex; bool dontEmitDiveChangedSignal; @@ -80,8 +79,8 @@ private: void merge_trip(const QModelIndex &a, const int offset); void setColumnWidths(); void calculateInitialColumnWidth(int col); - void backupExpandedRows(); - void restoreExpandedRows(); + std::vector<int> backupExpandedRows(); + void restoreExpandedRows(const std::vector<int> &); int lastVisibleColumn(); void selectTrip(dive_trip *trip); void updateLastImageTimeOffset(int offset); |