Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
b0b7f654
Commit
b0b7f654
authored
Dec 17, 2020
by
Volker Krause
Browse files
Fix time rounding close to the day boundary
parent
371b547f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app/timelinemodel.cpp
View file @
b0b7f654
...
...
@@ -525,8 +525,12 @@ void TimelineModel::updateWeatherElements()
}
auto
date
=
now
();
date
.
setTime
(
QTime
(
date
.
time
().
hour
()
+
1
,
0
));
// ### this looks suspicious for 23:xx?
while
(
it
!=
m_elements
.
end
()
&&
date
<
m_weatherMgr
->
maximumForecastTime
(
today
()))
{
// round to next full hour
date
.
setTime
(
QTime
(
date
.
time
().
hour
(),
0
));
date
=
date
.
addSecs
(
60
*
60
);
const
auto
maxForecastTime
=
m_weatherMgr
->
maximumForecastTime
(
date
.
date
());
while
(
it
!=
m_elements
.
end
()
&&
date
<
maxForecastTime
)
{
if
((
*
it
).
dt
<
date
||
(
*
it
).
elementType
==
TimelineElement
::
TodayMarker
)
{
// clean up outdated weather elements (happens when merging previously split ranges)
...
...
@@ -604,7 +608,7 @@ void TimelineModel::updateWeatherElements()
}
// append weather elements beyond the end of the list if necessary
while
(
date
<
m
_weatherMgr
->
maximum
ForecastTime
(
today
())
&&
geo
.
isValid
())
{
while
(
date
<
m
ax
ForecastTime
&&
geo
.
isValid
())
{
auto
endTime
=
date
;
endTime
.
setTime
(
QTime
(
23
,
59
,
59
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment