From c29109744e56a919b2d5ef417ac287bb2aada6cf Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 25 May 2014 07:01:06 -0700 Subject: Dive list: don't reset column width when reloading We set the column width in the dive list widget when we create that widget, based on what is in the settings. And we save the current column width back to the settings when we destroy that widget (so if Subsurface is shut down correctly and Qt actually gets to run the destructor but not when someone kills the program). That means that if we recreate the dive list at any point while Subsurface is running (and we do that a lot when you manipulate your dive list in any way shape or form), any changes to the column widths are lost. DiveListView::reload() explicitly calls setupUi() which reads the column widths back from the settings - but changes made to the columns aren't saved to the settings until we destroy the widget... I see no reason why reload() should call setupUi(), so I'm removing that call. Let's hope this doesn't break anything else. Fixes #518 Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 56617479b..29157737f 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -351,7 +351,6 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort) setCurrentIndex(firstDiveOrTrip); } } - setupUi(); if (selectedIndexes().count()) { QModelIndex curr = selectedIndexes().first(); curr = curr.parent().isValid() ? curr.parent() : curr; -- cgit v1.2.3-70-g09d2