Try to get rid of unnecessary reloads of the dive list

Don't call refreshDisplay() after preferences change. This strangely
somehow leads to a situation where I need to move the mouse over the dive
list before changes to the units are reflected.

When calling reload() do not force layout change / resort unless that is
the intention.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-06-06 11:22:08 +09:00
parent 3f7490c205
commit 6f7e13ac70
4 changed files with 11 additions and 9 deletions

View file

@ -128,8 +128,10 @@ void DiveListView::headerClicked(int i)
void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
{
currentLayout = layout;
if (layout == DiveTripModel::CURRENT)
layout = currentLayout;
else
currentLayout = layout;
header()->setClickable(true);
connect(header(), SIGNAL(sectionPressed(int)), this, SLOT(headerClicked(int)), Qt::UniqueConnection);