summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/divefilter.cpp4
-rw-r--r--core/divefilter.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/core/divefilter.cpp b/core/divefilter.cpp
index ed8e30f5f..89fbd731d 100644
--- a/core/divefilter.cpp
+++ b/core/divefilter.cpp
@@ -349,6 +349,10 @@ bool DiveFilter::showDive(const struct dive *d) const
if (!filterData.planned && !has_planned(d, false))
return false;
+ // Dive mode
+ if (filterData.diveMode >= 0 && d->dc.divemode != (divemode_t)filterData.diveMode)
+ return false;
+
return true;
}
diff --git a/core/divefilter.h b/core/divefilter.h
index ae5ba9869..37024be47 100644
--- a/core/divefilter.h
+++ b/core/divefilter.h
@@ -101,6 +101,7 @@ struct FilterData {
StringFilterMode equipmentStringMode = StringFilterMode::SUBSTRING;
bool logged = true;
bool planned = true;
+ int diveMode = -1; // -1: don't filter, >= 0: corresponds to divemode_t
};
class DiveFilter {