mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
09c0d7a6f5
commit
ee19b067a7
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue