summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/locationinformation.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-04-15 22:26:11 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-16 23:46:19 +1200
commitee19b067a700e2d2e0447488f2fa39f869eb633f (patch)
tree1dcc7e9956c805a004386806e15ce23cbe9347dc /desktop-widgets/locationinformation.cpp
parent09c0d7a6f537d83068878c39f18f36f9dcb18d7f (diff)
downloadsubsurface-ee19b067a700e2d2e0447488f2fa39f869eb633f.tar.gz
Desktop: don't show special dive site entries if there is no filter
In the dive site selection widget there are two special entries (add dive site with given name). Don't show this if the user didn't enter a string. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/locationinformation.cpp')
-rw-r--r--desktop-widgets/locationinformation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp
index dfceb8cd1..d1a11c03d 100644
--- a/desktop-widgets/locationinformation.cpp
+++ b/desktop-widgets/locationinformation.cpp
@@ -267,6 +267,11 @@ void DiveLocationFilterProxyModel::setFilter(const QString &filterIn)
bool DiveLocationFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex&) const
{
+ // We don't want to show the first two entries (add dive site with that name)
+ // if there is no filter text.
+ if (filter.isEmpty() && source_row <= 1)
+ return false;
+
if (source_row == 0)
return true;