summaryrefslogtreecommitdiffstats
path: root/qt-models/divelistmodel.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-19 21:17:39 -0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-23 22:45:30 +0100
commit52ec544c3b44054ad0d54c797a09c0a36572528c (patch)
treed5ee4a00db7012e4118bfdd4a45cb332e6256cd1 /qt-models/divelistmodel.cpp
parent17347f51101e41423d7517403efc853264aae7ae (diff)
downloadsubsurface-52ec544c3b44054ad0d54c797a09c0a36572528c.tar.gz
Mobile/filtering: finally implement the new settings in the actual filter
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/divelistmodel.cpp')
-rw-r--r--qt-models/divelistmodel.cpp10
1 files 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 <QDateTime>
+#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()