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
9ab079fc
Commit
9ab079fc
authored
Apr 23, 2021
by
Volker Krause
Browse files
Improve handling of missing Hafas product modes
parent
e41efa70
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/backends/hafasbackend.cpp
View file @
9ab079fc
...
...
@@ -22,9 +22,10 @@ void HafasBackend::setProductsMap(const QJsonArray& array)
for
(
const
auto
&
prodV
:
array
)
{
const
auto
prodObj
=
prodV
.
toObject
();
const
auto
bitmasks
=
prodObj
.
value
(
QLatin1String
(
"bitmasks"
)).
toArray
();
const
auto
mode
=
static_cast
<
Line
::
Mode
>
(
me
.
keyToValue
(
prodObj
.
value
(
QLatin1String
(
"mode"
)).
toString
().
toUtf8
().
constData
()));
if
(
mode
==
Line
::
Unknown
)
{
auto
mode
=
static_cast
<
Line
::
Mode
>
(
me
.
keyToValue
(
prodObj
.
value
(
QLatin1String
(
"mode"
)).
toString
().
toUtf8
().
constData
()));
if
(
mode
==
Line
::
Unknown
||
mode
<
0
)
{
qCWarning
(
Log
)
<<
"Invalid product mode:"
<<
prodObj
;
mode
=
Line
::
Unknown
;
}
for
(
const
auto
&
bit
:
bitmasks
)
{
m_lineModeMap
[
bit
.
toInt
()]
=
mode
;
...
...
src/lib/networks/de_nw_avv.json
View file @
9ab079fc
...
...
@@ -171,6 +171,7 @@
1024
],
"id"
:
"ferry"
,
"mode"
:
"Ferry"
,
"name"
:
"Fähre"
}
],
...
...
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