diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-01-18 17:08:48 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-19 13:59:24 -0800 |
commit | 37a521eb5d6de7b8bbbb3f85417ce303db6a3622 (patch) | |
tree | ce1614b25e60d6e719c600c247ec84b8fb1d0e82 /qt-models | |
parent | 424f1e98af6c8b868305fc3dcbe44118fd780ce7 (diff) | |
download | subsurface-37a521eb5d6de7b8bbbb3f85417ce303db6a3622.tar.gz |
Filter: ignore unset temperatures
The filter treated unset air and water temperatures as 0 K, leading
to many dives not being shown. Don't filter on unset temperatures.
Reported-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/filtermodels.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index 719467fd2..596bcd98f 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -111,10 +111,12 @@ bool MultiFilterSortModel::showDive(const struct dive *d) const // TODO: get the preferences for the imperial vs metric data. // ignore the check if it doesn't makes sense. - if (d->watertemp.mkelvin < C_to_mkelvin(filterData.minWaterTemp) || d->watertemp.mkelvin > C_to_mkelvin((filterData.maxWaterTemp))) + if (d->watertemp.mkelvin && + (d->watertemp.mkelvin < C_to_mkelvin(filterData.minWaterTemp) || d->watertemp.mkelvin > C_to_mkelvin((filterData.maxWaterTemp)))) return false; - if (d->airtemp.mkelvin < C_to_mkelvin(filterData.minAirTemp) || d->airtemp.mkelvin > C_to_mkelvin(filterData.maxAirTemp)) + if (d->airtemp.mkelvin && + (d->airtemp.mkelvin < C_to_mkelvin(filterData.minAirTemp) || d->airtemp.mkelvin > C_to_mkelvin(filterData.maxAirTemp))) return false; if (filterData.from.isValid() && d->when < filterData.from.toTime_t()) |