summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/divelistview.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp
index c01a6189a..30364a8eb 100644
--- a/desktop-widgets/divelistview.cpp
+++ b/desktop-widgets/divelistview.cpp
@@ -33,12 +33,7 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec
setItemDelegate(new DiveListDelegate(this));
setUniformRowHeights(true);
setItemDelegateForColumn(DiveTripModel::RATING, new StarWidgetsDelegate(this));
- MultiFilterSortModel *model = MultiFilterSortModel::instance();
- model->setSortRole(DiveTripModel::SORT_ROLE);
- model->setFilterKeyColumn(-1); // filter all columns
- model->setFilterCaseSensitivity(Qt::CaseInsensitive);
- model->setSourceModel(DiveTripModel::instance());
- setModel(model);
+ setModel(MultiFilterSortModel::instance());
setSortingEnabled(false);
setContextMenuPolicy(Qt::DefaultContextMenu);
@@ -503,8 +498,7 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
header()->setSectionsClickable(true);
connect(header(), SIGNAL(sectionPressed(int)), this, SLOT(headerClicked(int)), Qt::UniqueConnection);
- DiveTripModel *tripModel = DiveTripModel::instance();
- tripModel->setLayout(layout); // Note: setLayout() resets the whole model
+ MultiFilterSortModel::instance()->setLayout(layout);
if (!forceSort)
return;