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
3aa12a43
Commit
3aa12a43
authored
Dec 23, 2020
by
Volker Krause
Browse files
Add location request type checks to the OTP backends
parent
0b0cb95f
Pipeline
#45247
passed with stage
in 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/backends/opentripplannergraphqlbackend.cpp
View file @
3aa12a43
...
...
@@ -44,6 +44,10 @@ bool OpenTripPlannerGraphQLBackend::needsLocationQuery(const Location &loc, Abst
bool
OpenTripPlannerGraphQLBackend
::
queryLocation
(
const
LocationRequest
&
req
,
LocationReply
*
reply
,
QNetworkAccessManager
*
nam
)
const
{
if
((
req
.
types
()
&
(
Location
::
Stop
|
Location
::
RentedVehicle
|
Location
::
RentedVehicleStation
))
==
0
)
{
return
false
;
}
auto
gqlReq
=
graphQLRequest
();
if
(
req
.
hasCoordinate
())
{
gqlReq
.
setQueryFromFile
(
graphQLPath
(
QStringLiteral
(
"stationByCoordinate.graphql"
)));
...
...
src/lib/backends/opentripplannerrestbackend.cpp
View file @
3aa12a43
...
...
@@ -49,6 +49,10 @@ bool OpenTripPlannerRestBackend::needsLocationQuery(const Location &loc, Abstrac
bool
OpenTripPlannerRestBackend
::
queryLocation
(
const
LocationRequest
&
req
,
LocationReply
*
reply
,
QNetworkAccessManager
*
nam
)
const
{
if
((
req
.
types
()
&
Location
::
Stop
)
==
0
)
{
return
false
;
}
if
(
req
.
hasCoordinate
())
{
QUrlQuery
query
;
query
.
addQueryItem
(
QStringLiteral
(
"lat"
),
QString
::
number
(
req
.
latitude
()));
...
...
Write
Preview
Markdown
is supported
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