diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/divefilter.cpp | 9 | ||||
-rw-r--r-- | core/divefilter.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/core/divefilter.cpp b/core/divefilter.cpp index 5765ed673..9f54f5cca 100644 --- a/core/divefilter.cpp +++ b/core/divefilter.cpp @@ -2,6 +2,7 @@ #include "divefilter.h" #include "divelist.h" // for filter_dive +#include "gettextfromc.h" #include "qthelper.h" #include "subsurface-qt/divelistnotifier.h" #ifndef SUBSURFACE_MOBILE @@ -151,6 +152,14 @@ bool DiveFilter::diveSiteMode() const } #endif +QString DiveFilter::shownText() const +{ + if (diveSiteMode() || filterData.validFilter()) + return gettextFromC::tr("%L1/%L2 shown").arg(shown_dives).arg(dive_table.nr); + else + return gettextFromC::tr("%L1 dives").arg(dive_table.nr); +} + void DiveFilter::setFilter(const FilterData &data) { filterData = data; diff --git a/core/divefilter.h b/core/divefilter.h index a0c9b5d2f..3ebb049ef 100644 --- a/core/divefilter.h +++ b/core/divefilter.h @@ -38,6 +38,7 @@ class DiveFilter { public: static DiveFilter *instance(); + QString shownText() const; bool diveSiteMode() const; // returns true if we're filtering on dive site (on mobile always returns false) #ifndef SUBSURFACE_MOBILE const QVector<dive_site *> &filteredDiveSites() const; |