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, 9 insertions, 3 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index 857c5d698..d335d3f7c 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -560,12 +560,12 @@ void LocationFilterModel::addName(const QString &newName)
MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyModel(parent),
divesDisplayed(0),
- curr_dive_site(NULL)
+ curr_dive_site(NULL),
+ model(DiveTripModel::instance())
{
- setSortRole(DiveTripModel::SORT_ROLE);
setFilterKeyColumn(-1); // filter all columns
setFilterCaseSensitivity(Qt::CaseInsensitive);
- setSourceModel(DiveTripModel::instance());
+ setSourceModel(model);
}
void MultiFilterSortModel::setLayout(DiveTripModel::Layout layout)
@@ -707,3 +707,9 @@ void MultiFilterSortModel::stopFilterDiveSite()
curr_dive_site = NULL;
myInvalidate();
}
+
+bool MultiFilterSortModel::lessThan(const QModelIndex &i1, const QModelIndex &i2) const
+{
+ // Hand sorting down to the source model.
+ return model->lessThan(i1, i2);
+}