From 52ec544c3b44054ad0d54c797a09c0a36572528c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 19 Oct 2018 21:17:39 -0400 Subject: [PATCH] Mobile/filtering: finally implement the new settings in the actual filter Signed-off-by: Dirk Hohndel --- qt-models/divelistmodel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp index bc7e38a98..5a1cf1403 100644 --- a/qt-models/divelistmodel.cpp +++ b/qt-models/divelistmodel.cpp @@ -2,6 +2,7 @@ #include "qt-models/divelistmodel.h" #include "core/qthelper.h" #include +#include "core/settings/qPrefGeneral.h" DiveListSortModel::DiveListSortModel(QObject *parent) : QSortFilterProxyModel(parent) { @@ -10,9 +11,14 @@ DiveListSortModel::DiveListSortModel(QObject *parent) : QSortFilterProxyModel(pa void DiveListSortModel::setFilter(QString f) { - setFilterRole(DiveListModel::FullTextRole); + if (qPrefGeneral::filterFullTextNotes()) + setFilterRole(DiveListModel::FullTextRole); + else + setFilterRole(DiveListModel::FullTextNoNotesRole); + setFilterRegExp(QString(".*%1.*").arg(f)); - setFilterCaseSensitivity(Qt::CaseInsensitive); + if (!qPrefGeneral::filterCaseSensitive()) + setFilterCaseSensitivity(Qt::CaseInsensitive); } void DiveListSortModel::resetFilter()