From b8ffc85a2026017d9f382a443091df943b73d005 Mon Sep 17 00:00:00 2001 From: Dylan Van Assche Date: Wed, 20 Feb 2019 16:41:16 +0100 Subject: [PATCH] Fixed arrival/departure setting --- qml/pages/TripPage.qml | 9 ++++++++- rpm/harbour-berail.changes | 3 +++ rpm/harbour-berail.spec | 4 ++-- rpm/harbour-berail.yaml | 4 ++-- src/api.cpp | 4 ++-- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/qml/pages/TripPage.qml b/qml/pages/TripPage.qml index 1fcd49a..663f017 100644 --- a/qml/pages/TripPage.qml +++ b/qml/pages/TripPage.qml @@ -32,7 +32,14 @@ Page { onStatusChanged: status===PageStatus.Active? getData(): undefined function getData() { - api.getConnections(from, to, IRail.Arrival, date, Utils.convertTransportType(settings.transportFilter)) + var arrdep; + if(settings.timeIs === 0) { + arrdep = IRail.Departure + } + else { + arrdep = IRail.Arrival; + } + api.getConnections(from, to, arrdep, date, Utils.convertTransportType(settings.transportFilter)) } Connections { diff --git a/rpm/harbour-berail.changes b/rpm/harbour-berail.changes index fc99a30..f0f44da 100644 --- a/rpm/harbour-berail.changes +++ b/rpm/harbour-berail.changes @@ -8,6 +8,9 @@ # * date Author's Name version-release # - Summary of changes +* Mon Jan 8 2018 Dylan Van Assche 2.1-1 +- [MAJOR BUGFIX] Time selection for route planner works again. + * Mon Jan 8 2018 Dylan Van Assche 2.0-2 - [MINOR BUGFIX] Workaround for iRail API issue #335 diff --git a/rpm/harbour-berail.spec b/rpm/harbour-berail.spec index 18bbab5..b49b62c 100644 --- a/rpm/harbour-berail.spec +++ b/rpm/harbour-berail.spec @@ -13,8 +13,8 @@ Name: harbour-berail %{!?qtc_make:%define qtc_make make} %{?qtc_builddir:%define _builddir %qtc_builddir} Summary: BeRail -Version: 2.0 -Release: 2 +Version: 2.1 +Release: 1 Group: Qt/Qt License: GPLv3 URL: http://dylanvanassche.be/ diff --git a/rpm/harbour-berail.yaml b/rpm/harbour-berail.yaml index 4efadc5..98cc62a 100644 --- a/rpm/harbour-berail.yaml +++ b/rpm/harbour-berail.yaml @@ -1,7 +1,7 @@ Name: harbour-berail Summary: BeRail -Version: 2.0 -Release: 2 +Version: 2.1 +Release: 1 # The contents of the Group field should be one of the groups listed here: # http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS Group: Qt/Qt diff --git a/src/api.cpp b/src/api.cpp index 01158d9..4b02862 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -102,7 +102,7 @@ QString API::parseTime(QDateTime time) } QString API::parseArrdep(IRail::ArrDep arrdep) { - if(arrdep == IRail::ArrDep::Arrival) + if(arrdep == IRail::ArrDep::Arrival) { return "arrival"; } @@ -221,7 +221,7 @@ void API::getLiveboard(QString stationName, QDateTime time, IRail::ArrDep arrdep parameters.addQueryItem("station", stationName); parameters.addQueryItem("date", this->parseDate(time)); parameters.addQueryItem("time", this->parseTime(time)); - parameters.addQueryItem("arrdep", this->parseArrdep(arrdep)); + parameters.addQueryItem("timesel", this->parseArrdep(arrdep)); parameters.addQueryItem("alerts", "true"); // Prepare & do request