Mobile/filtering: finally implement the new settings in the actual filter

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-10-19 21:17:39 -04:00
parent 17347f5110
commit 52ec544c3b

View file

@ -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()