Skip to content
This repository was archived by the owner on Jul 22, 2021. It is now read-only.

Commit 0c9c457

Browse files
Merge pull request #2 from iRail/upgrade-1.1
V1.1-2
2 parents 4085886 + b9beba5 commit 0c9c457

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

qml/pages/js/liveboard.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,23 @@ function load(station) {
5656

5757
if(liveboard.departures.departure[i].hasOwnProperty("alerts")) { // Detect if we have alerts in this data
5858
for(var j=0; j < Object.keys(liveboard.departures.departure[i].alerts.alert).length; j++) {
59-
alertsModel.append({
60-
"header": liveboard.departures.departure[i].alerts.alert[j].header,
61-
"description": liveboard.departures.departure[i].alerts.alert[j].description
62-
});
63-
}
64-
}
65-
}
59+
var newEntry = true;
60+
for(var k=0; k < alertsModel.count; k++) {
61+
if(alertsModel.count == 0) { // Only when we have an entry we should check for duplicates
62+
break;
63+
}
64+
65+
if(alertsModel.get(k).header == alertsModel.get(j).header) {
66+
newEntry = false;
67+
break;
68+
}
69+
}
6670

67-
// Remove duplicates from AlertsModel if the model is > 1
68-
if(alertsModel.count > 1) {
69-
for(var i=0; i < alertsModel.count; i++) {
70-
for(var j=i; j < alertsModel.count; j++) { // Only check for the same elements after the current one
71-
if(alertsModel.get(i).header == alertsModel.get(j).header) {
72-
alertsModel.remove(j);
71+
if(newEntry) {
72+
alertsModel.append({
73+
"header": liveboard.departures.departure[i].alerts.alert[j].header,
74+
"description": liveboard.departures.departure[i].alerts.alert[j].description
75+
});
7376
}
7477
}
7578
}

rpm/harbour-berail.changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
# * date Author's Name <author's email> version-release
99
# - Summary of changes
1010

11+
* Mon Jun 06 2017 Dylan Van Assche <dylan.van.assche@protonmail.com.com> 1.1-2
12+
- [MINOR BUGFIX] Remove disturbances duplicates in Liveboard
13+
1114
* Mon Jun 06 2017 Dylan Van Assche <dylan.van.assche@protonmail.com.com> 1.1-1
1215
- [MINOR BUGFIX] Recovering after a wrong connection in the routeplanner fixed
1316
- [MINOR BUGFIX] Liveboard shows information twice fixed

rpm/harbour-berail.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Name: harbour-berail
1414
%{?qtc_builddir:%define _builddir %qtc_builddir}
1515
Summary: BeRail
1616
Version: 1.1
17-
Release: 1
17+
Release: 2
1818
Group: Qt/Qt
1919
License: LICENSE
2020
URL: http://example.org/

rpm/harbour-berail.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Name: harbour-berail
22
Summary: BeRail
33
Version: 1.1
4-
Release: 1
4+
Release: 2
55
# The contents of the Group field should be one of the groups listed here:
66
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
77
Group: Qt/Qt

0 commit comments

Comments
 (0)