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
cbd5fbeb
Commit
cbd5fbeb
authored
Oct 30, 2021
by
Volker Krause
Browse files
Trigger logo asset downloads only on the results we care about
parent
7b8ef8db
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app/livedatamanager.cpp
View file @
cbd5fbeb
...
...
@@ -273,12 +273,14 @@ void LiveDataManager::updateStopoverData(const KPublicTransport::Stopover &stop,
{
auto
&
ld
=
data
(
resId
);
const
auto
oldStop
=
ld
.
stopover
(
type
);
ld
.
setStopover
(
type
,
stop
);
auto
newStop
=
stop
;
newStop
.
applyMetaData
(
true
);
// download logo assets if needed
ld
.
setStopover
(
type
,
newStop
);
ld
.
setTimestamp
(
type
,
now
());
ld
.
store
(
resId
);
// update reservation with live data
const
auto
newRes
=
type
==
LiveData
::
Arrival
?
PublicTransport
::
mergeArrival
(
res
,
s
top
)
:
PublicTransport
::
mergeDeparture
(
res
,
s
top
);
const
auto
newRes
=
type
==
LiveData
::
Arrival
?
PublicTransport
::
mergeArrival
(
res
,
newS
top
)
:
PublicTransport
::
mergeDeparture
(
res
,
newS
top
);
if
(
!
ReservationHelper
::
equals
(
res
,
newRes
))
{
m_resMgr
->
updateReservation
(
resId
,
newRes
);
}
...
...
@@ -287,7 +289,7 @@ void LiveDataManager::updateStopoverData(const KPublicTransport::Stopover &stop,
Q_EMIT
type
==
LiveData
::
Arrival
?
arrivalUpdated
(
resId
)
:
departureUpdated
(
resId
);
// check if we need to notify
if
(
NotificationHelper
::
shouldNotify
(
oldStop
,
s
top
,
type
))
{
if
(
NotificationHelper
::
shouldNotify
(
oldStop
,
newS
top
,
type
))
{
showNotification
(
resId
,
ld
);
}
}
...
...
@@ -298,6 +300,7 @@ void LiveDataManager::updateJourneyData(const KPublicTransport::JourneySection &
const
auto
oldDep
=
ld
.
stopover
(
LiveData
::
Departure
);
const
auto
oldArr
=
ld
.
stopover
(
LiveData
::
Arrival
);
ld
.
journey
=
journey
;
ld
.
journey
.
applyMetaData
(
true
);
// download logo assets if needed
ld
.
journeyTimestamp
=
now
();
ld
.
departure
=
journey
.
departure
();
ld
.
departureTimestamp
=
now
();
...
...
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