diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-07-26 18:03:07 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-27 09:08:42 -0700 |
commit | 67a875ef81290fe49a0b25e174615942d8404bea (patch) | |
tree | 455d985065a290cca1b6e2c1f16d66b2a57bd1ed /desktop-widgets/divelistview.h | |
parent | 079b99135a2340d9ffc97ceec2b2b5e288f597de (diff) | |
download | subsurface-67a875ef81290fe49a0b25e174615942d8404bea.tar.gz |
Dive list view: setup columns in constructor
The column-widths must only be set once the source-model is that.
The old code realized this with a rather complicated logic.
Instead, simply set the source-model in the constructor and
set the column widths after that. Rename the corresponding
function from "setupUi" to "setColumnWidths".
Moreover, the setupUi function had different code-paths for
the first and other calls. Since it is only called once,
remove the other code paths.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/divelistview.h')
-rw-r--r-- | desktop-widgets/divelistview.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/divelistview.h b/desktop-widgets/divelistview.h index e6ae8395d..eaabe5c8d 100644 --- a/desktop-widgets/divelistview.h +++ b/desktop-widgets/divelistview.h @@ -77,7 +77,7 @@ private: /* if dive_trip_t is null, there's no problem. */ QMultiHash<dive_trip_t *, int> selectedDives; void merge_trip(const QModelIndex &a, const int offset); - void setupUi(); + void setColumnWidths(); void calculateInitialColumnWidth(const DiveTripModel &tripModel, int col); void backupExpandedRows(); void restoreExpandedRows(); |