diff options
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/filtermodels.cpp | 10 | ||||
-rw-r--r-- | qt-models/filtermodels.h | 6 |
2 files changed, 12 insertions, 4 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index 2f3ce99a8..6efac8348 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -114,10 +114,16 @@ bool MultiFilterSortModel::showDive(const struct dive *d) const (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()) + QDateTime t = filterData.fromDate; + t.setTime(filterData.fromTime); + if (filterData.fromDate.isValid() && filterData.fromTime.isValid() && + d->when < t.toMSecsSinceEpoch()/1000 + t.offsetFromUtc()) return false; - if (filterData.to.isValid() && d->when > filterData.to.toTime_t()) + t = filterData.toDate; + t.setTime(filterData.toTime); + if (filterData.toDate.isValid() && filterData.toTime.isValid() && + d->when > t.toMSecsSinceEpoch()/1000 + t.offsetFromUtc()) return false; // tags. diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h index 5cb130522..f9be3a2ad 100644 --- a/qt-models/filtermodels.h +++ b/qt-models/filtermodels.h @@ -24,8 +24,10 @@ struct FilterData { double maxWaterTemp = 100; double minAirTemp = 0; double maxAirTemp = 100; - QDateTime from; - QDateTime to = QDateTime::currentDateTime(); + QDateTime fromDate; + QTime fromTime; + QDateTime toDate = QDateTime::currentDateTime(); + QTime toTime = QTime::currentTime(); QStringList tags; QStringList people; QStringList location; |