summaryrefslogtreecommitdiffstats
path: root/qt-models/filtermodels.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/filtermodels.cpp')
-rw-r--r--qt-models/filtermodels.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index ce0c2528c..857c5d698 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -562,6 +562,16 @@ MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyMo
divesDisplayed(0),
curr_dive_site(NULL)
{
+ setSortRole(DiveTripModel::SORT_ROLE);
+ setFilterKeyColumn(-1); // filter all columns
+ setFilterCaseSensitivity(Qt::CaseInsensitive);
+ setSourceModel(DiveTripModel::instance());
+}
+
+void MultiFilterSortModel::setLayout(DiveTripModel::Layout layout)
+{
+ DiveTripModel *tripModel = DiveTripModel::instance();
+ tripModel->setLayout(layout); // Note: setLayout() resets the whole model
}
void MultiFilterSortModel::divesAdded(const QVector<dive *> &dives)
@@ -656,6 +666,8 @@ void MultiFilterSortModel::myInvalidate()
invalidateFilter();
+ // Tell the dive trip model to update the displayed-counts
+ DiveTripModel::instance()->filterFinished();
emit filterFinished();
#if !defined(SUBSURFACE_MOBILE)