Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

Commit

Permalink
use line id and not name to get correct transportation type
Browse files Browse the repository at this point in the history
  • Loading branch information
umglurf committed Jan 23, 2016
1 parent 48eea16 commit 0c52d10
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion qml/pages/RealTime.qml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Page {
TransportIcon {
width: lineLabel.height
height: lineLabel.height
transportation: RuteFisk.lines[linenumber] === undefined ? "3" : RuteFisk.lines[linenumber]
transportation: RuteFisk.lines[lineRef] === undefined ? "3" : RuteFisk.lines[lineRef]
}
Label {
id: lineLabel
Expand Down Expand Up @@ -320,6 +320,7 @@ Page {
line['line'] = data[index]['MonitoredVehicleJourney']['PublishedLineName'] + data[index]['MonitoredVehicleJourney']['DestinationName'];
line['lineColor'] = "#" + data[index]['Extensions']['LineColour'];
line['linenumber'] = data[index]['MonitoredVehicleJourney']['PublishedLineName'];
line['lineRef'] = data[index]['MonitoredVehicleJourney']['LineRef'];
line['destination'] = data[index]['MonitoredVehicleJourney']['DestinationName'];
line['origin'] = data[index]['MonitoredVehicleJourney']['OriginName'] ? data[index]['MonitoredVehicleJourney']['OriginName'] : "";
line['departures'] = [];
Expand Down
4 changes: 2 additions & 2 deletions qml/pages/TravelFromToOptions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ Page {
}

Component.onCompleted: {
for(var line in RuteFisk.lines) {
if(RuteFisk.lines.hasOwnProperty(line)) {
for(var line in RuteFisk.lineNumbers) {
if(RuteFisk.lineNumbers.hasOwnProperty(line)) {
if(lines.indexOf(line) == -1) {
available_lines[line] = 1;
} else {
Expand Down
4 changes: 3 additions & 1 deletion qml/scripts/rutefisk.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function non_tz_date_parse(timestr) {
}

var lines = {};
var lineNumbers = {};
var lines_finished = false;
if (!lines_finished) {
get_lines();
Expand All @@ -75,7 +76,8 @@ function get_lines() {
lines_finished = true;
var data = JSON.parse(xhr.responseText);
for(var index=0; index < data.length; index++) {
lines[data[index]['Name']] = data[index]['Transportation'];
lines[data[index]['ID']] = data[index]['Transportation'];
lineNumbers[data[index]['Name']] = data[index]['ID'];
};
};
};
Expand Down
6 changes: 3 additions & 3 deletions translations/harbour-rutefisk-sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@
<translation>Plattform %1</translation>
</message>
<message>
<location filename="../qml/pages/RealTime.qml" line="337"/>
<location filename="../qml/pages/RealTime.qml" line="338"/>
<source>sec</source>
<translation>sek</translation>
</message>
<message>
<location filename="../qml/pages/RealTime.qml" line="339"/>
<location filename="../qml/pages/RealTime.qml" line="340"/>
<source>min</source>
<translation>min</translation>
</message>
<message>
<location filename="../qml/pages/RealTime.qml" line="375"/>
<location filename="../qml/pages/RealTime.qml" line="376"/>
<source>Error getting stop information</source>
<translation>Kunde inte hämta hållplatsinformation</translation>
</message>
Expand Down
6 changes: 3 additions & 3 deletions translations/harbour-rutefisk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/RealTime.qml" line="337"/>
<location filename="../qml/pages/RealTime.qml" line="338"/>
<source>sec</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/RealTime.qml" line="339"/>
<location filename="../qml/pages/RealTime.qml" line="340"/>
<source>min</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/RealTime.qml" line="375"/>
<location filename="../qml/pages/RealTime.qml" line="376"/>
<source>Error getting stop information</source>
<translation type="unfinished"></translation>
</message>
Expand Down

0 comments on commit 0c52d10

Please sign in to comment.