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
Libraries
KPublicTransport
Commits
b9c6df76
Commit
b9c6df76
authored
Nov 02, 2021
by
Volker Krause
Browse files
Add Journey::expected[Departure|Arrival]Time() methods
Brings the Journey API in line with that of JourneySection.
parent
a45b5599
Pipeline
#93359
passed with stage
in 1 minute and 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/datatypes/journey.cpp
View file @
b9c6df76
...
...
@@ -583,6 +583,11 @@ bool Journey::hasExpectedDepartureTime() const
return
d
->
sections
.
empty
()
?
false
:
d
->
sections
.
front
().
hasExpectedDepartureTime
();
}
QDateTime
Journey
::
expectedDepartureTime
()
const
{
return
d
->
sections
.
empty
()
?
QDateTime
()
:
d
->
sections
.
front
().
expectedDepartureTime
();
}
int
Journey
::
departureDelay
()
const
{
return
d
->
sections
.
empty
()
?
0
:
d
->
sections
.
front
().
departureDelay
();
...
...
@@ -601,6 +606,11 @@ bool Journey::hasExpectedArrivalTime() const
return
d
->
sections
.
empty
()
?
false
:
d
->
sections
.
back
().
hasExpectedArrivalTime
();
}
QDateTime
Journey
::
expectedArrivalTime
()
const
{
return
d
->
sections
.
empty
()
?
QDateTime
()
:
d
->
sections
.
back
().
expectedArrivalTime
();
}
int
Journey
::
arrivalDelay
()
const
{
return
d
->
sections
.
empty
()
?
0
:
d
->
sections
.
back
().
arrivalDelay
();
...
...
src/lib/datatypes/journey.h
View file @
b9c6df76
...
...
@@ -240,6 +240,10 @@ class KPUBLICTRANSPORT_EXPORT Journey
Q_PROPERTY
(
QDateTime
scheduledDepartureTime
READ
scheduledDepartureTime
STORED
false
)
/** @c true if this has real-time data. */
Q_PROPERTY
(
bool
hasExpectedDepartureTime
READ
hasExpectedDepartureTime
STORED
false
)
/** Actual departure time, if available.
* Set to invalid to indicate real-time data is not available.
*/
Q_PROPERTY
(
QDateTime
expectedDepartureTime
READ
expectedDepartureTime
STORED
false
)
/** Difference to schedule in minutes. */
Q_PROPERTY
(
int
departureDelay
READ
departureDelay
STORED
false
)
...
...
@@ -247,6 +251,10 @@ class KPUBLICTRANSPORT_EXPORT Journey
Q_PROPERTY
(
QDateTime
scheduledArrivalTime
READ
scheduledArrivalTime
STORED
false
)
/** @c true if this has real-time data. */
Q_PROPERTY
(
bool
hasExpectedArrivalTime
READ
hasExpectedArrivalTime
STORED
false
)
/** Actual arrival time, if available.
* Set to invalid to indicate real-time data is not available.
*/
Q_PROPERTY
(
QDateTime
expectedArrivalTime
READ
expectedArrivalTime
STORED
false
)
/** Difference to schedule in minutes. */
Q_PROPERTY
(
int
arrivalDelay
READ
arrivalDelay
STORED
false
)
...
...
@@ -267,10 +275,12 @@ public:
QDateTime
scheduledDepartureTime
()
const
;
bool
hasExpectedDepartureTime
()
const
;
QDateTime
expectedDepartureTime
()
const
;
int
departureDelay
()
const
;
QDateTime
scheduledArrivalTime
()
const
;
bool
hasExpectedArrivalTime
()
const
;
QDateTime
expectedArrivalTime
()
const
;
int
arrivalDelay
()
const
;
int
duration
()
const
;
...
...
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