mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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
590a19542d
commit
ae46b07f96
1 changed files with 8 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
#include "qt-models/divelistmodel.h"
|
#include "qt-models/divelistmodel.h"
|
||||||
#include "core/qthelper.h"
|
#include "core/qthelper.h"
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include "core/settings/qPrefGeneral.h"
|
||||||
|
|
||||||
DiveListSortModel::DiveListSortModel(QObject *parent) : QSortFilterProxyModel(parent)
|
DiveListSortModel::DiveListSortModel(QObject *parent) : QSortFilterProxyModel(parent)
|
||||||
{
|
{
|
||||||
|
@ -10,9 +11,14 @@ DiveListSortModel::DiveListSortModel(QObject *parent) : QSortFilterProxyModel(pa
|
||||||
|
|
||||||
void DiveListSortModel::setFilter(QString f)
|
void DiveListSortModel::setFilter(QString f)
|
||||||
{
|
{
|
||||||
setFilterRole(DiveListModel::FullTextRole);
|
if (qPrefGeneral::filterFullTextNotes())
|
||||||
|
setFilterRole(DiveListModel::FullTextRole);
|
||||||
|
else
|
||||||
|
setFilterRole(DiveListModel::FullTextNoNotesRole);
|
||||||
|
|
||||||
setFilterRegExp(QString(".*%1.*").arg(f));
|
setFilterRegExp(QString(".*%1.*").arg(f));
|
||||||
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
if (!qPrefGeneral::filterCaseSensitive())
|
||||||
|
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveListSortModel::resetFilter()
|
void DiveListSortModel::resetFilter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue