summaryrefslogtreecommitdiffstats
path: root/qt-models/divelistmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/divelistmodel.cpp')
-rw-r--r--qt-models/divelistmodel.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index 05f163505..d1ae4093d 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -207,13 +207,16 @@ void DiveListSortModel::setSourceModel(QAbstractItemModel *sourceModel)
updateFilterState();
}
-void DiveListSortModel::setFilter(QString f)
+void DiveListSortModel::setFilter(QString f, FilterData::Mode mode)
{
f = f.trimmed();
FilterData data;
if (!f.isEmpty()) {
- data.mode = FilterData::Mode::FULLTEXT;
- data.fullText = f;
+ data.mode = mode;
+ if (mode == FilterData::Mode::FULLTEXT)
+ data.fullText = f;
+ else
+ data.tags = f.split(",", QString::SkipEmptyParts);
}
DiveFilter::instance()->setFilter(data);
CollapsedDiveListSortModel::instance()->updateFilterState();