From 14700487730f3d5863ea810452c540d1bb4b9ca8 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 20 Jan 2019 21:15:46 +0100 Subject: Filter: extend range of allowed temperatures The temperature range 0-100 was inadequate in both supported scales (Celsius and Fahrenheit). Extend the range to encompass all physically meaningful values in both scales. Use the default-values to set the minimum and maximum of the UI-fields. Thus, these values are configurable in a single place. In the future we should use a scale-independent representation (e.g. mkelvin as in the rest of the code base). But this would mean implementing a custom widget with a conversion function. Signed-off-by: Berthold Stoeger --- qt-models/filtermodels.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'qt-models') diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h index f9be3a2ad..1925bc422 100644 --- a/qt-models/filtermodels.h +++ b/qt-models/filtermodels.h @@ -20,10 +20,13 @@ struct FilterData { int maxVisibility = 5; int minRating = 0; int maxRating = 5; - double minWaterTemp = 0; - double maxWaterTemp = 100; - double minAirTemp = 0; - double maxAirTemp = 100; + // The default minimum and maximum temperatures are set such that all + // physically reasonable dives are shown. Note that these values should + // work for both Celcius and Fahrenheit scales. + double minWaterTemp = -10; + double maxWaterTemp = 200; + double minAirTemp = -50; + double maxAirTemp = 200; QDateTime fromDate; QTime fromTime; QDateTime toDate = QDateTime::currentDateTime(); -- cgit v1.2.3-70-g09d2