diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-04-29 08:17:41 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-05-11 12:06:19 -0700 |
commit | 3e05d61eb95f5b26d0382ff87451cbe5b59fc9ec (patch) | |
tree | 949ea9b51606012cd1fa1da2a629cce464f92e49 /qt-models | |
parent | 23cf85e89c7f09281bedd7e704c867049c84cbe8 (diff) | |
download | subsurface-3e05d61eb95f5b26d0382ff87451cbe5b59fc9ec.tar.gz |
Map: show all dive sites when in dive-site filter mode
When on the dive site tab or editing a dive site, we want
to show all dive sites so that the user can related different
dive sites. Therefore export a "in dive site mode" flag from
the filter model and don't filter in that case in MapWidgetHelper.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/filtermodels.cpp | 5 | ||||
-rw-r--r-- | qt-models/filtermodels.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index bc454bcc9..663037383 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -278,6 +278,11 @@ void MultiFilterSortModel::stopFilterDiveSites() myInvalidate(); } +bool MultiFilterSortModel::diveSiteMode() const +{ + return !dive_sites.isEmpty(); +} + bool MultiFilterSortModel::lessThan(const QModelIndex &i1, const QModelIndex &i2) const { // Hand sorting down to the source model. diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h index 258b4186b..7520fbe16 100644 --- a/qt-models/filtermodels.h +++ b/qt-models/filtermodels.h @@ -63,6 +63,7 @@ public: bool updateDive(struct dive *d); // returns true if visibility status changed int divesDisplayed; bool lessThan(const QModelIndex &, const QModelIndex &) const override; + bool diveSiteMode() const; // returns true if we're filtering on dive site public slots: void myInvalidate(); |