mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Mobile/filtering: finally implement the new settings in the actual filter
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
17347f5110
commit
52ec544c3b
1 changed files with 8 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue