[-]
[+]
|
Changed |
_service:tar_git:harbour-fahrplan2.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-fahrplan2.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/poetaster/fahrplan.git</param>
<param name="branch">master</param>
- <param name="revision">2.0.45</param>
+ <param name="revision">2.0.46</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-fahrplan2-2.0.46.tar.bz2/fahrplan2.pro
^
|
@@ -2,7 +2,7 @@
APP_NAME = Fahrplan
# Define Version
-VERSION = 2.0.43-1
+VERSION = 2.0.46-1
#CONFIG+= openrepos
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-fahrplan2-2.0.46.tar.bz2/src/gui/about.js
^
|
@@ -37,7 +37,7 @@
"<p>If you encounter bugs or have feature requests visit the <a href=\"https://github.com/smurfy/fahrplan/issues\">Fahrplan issue tracker on GitHub</a>.</p>");
var maintainers = ["Mark Washeim (poetaster)", "Philipp Andreas (smurfy)", "Michael Stevens (stevensmi)", "Oleksii Serdiuk (leppa)"];
-var codeContributors = ["attah", "Thaodan", "gri", "lorenzph", "CaCO3", "hcm", "thp", "qwerty12", "qbast", "Thomas Fischer", "Oleksii Serdiuk (leppa)", "Nekhelesh Ramananthan (nik90)", "NightShift79", "pirast", "Michael Zanetti (mzanetti)", "Chris Clime (balcy)", "dayrover", "shentok", "evansebire", "unsanded", "Morpog", "benni0815", "Erik Lundin"].sort();
+var codeContributors = ["attah", "smatkovi", "Thaodan", "gri", "lorenzph", "CaCO3", "hcm", "thp", "qwerty12", "qbast", "Thomas Fischer", "Oleksii Serdiuk (leppa)", "Nekhelesh Ramananthan (nik90)", "NightShift79", "pirast", "Michael Zanetti (mzanetti)", "Chris Clime (balcy)", "dayrover", "shentok", "evansebire", "unsanded", "Morpog", "benni0815", "Erik Lundin"].sort();
var translators = [
"Arabic - Sary AWAD (sary.1991)",
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-fahrplan2-2.0.46.tar.bz2/src/gui/sailfishos/pages/JourneyDetailsResultsPage.qml
^
|
@@ -23,7 +23,7 @@
import "../delegates"
Page {
- property bool debug: true
+ property bool debug: false
id: journeyDetailsResultsPage
property JourneyDetailResultList currentResult;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-fahrplan2-2.0.46.tar.bz2/src/parser/parser_definitions.h
^
|
@@ -82,7 +82,7 @@
{
Q_OBJECT
Q_PROPERTY(QString id READ id WRITE setId)
- //Q_PROPERTY(QDate date READ date WRITE setDate)
+ Q_PROPERTY(QDate date READ date WRITE setDate)
Q_PROPERTY(QString departureTime READ departureTime WRITE setDepartureTime)
Q_PROPERTY(QString arrivalTime READ arrivalTime WRITE setArrivalTime)
Q_PROPERTY(QString trainType READ trainType WRITE setTrainType)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-fahrplan2-2.0.46.tar.bz2/src/parser/parser_ninetwo.cpp
^
|
@@ -373,9 +373,9 @@
std::unique_ptr<JourneyResultList> resultList{ new JourneyResultList};
- qDebug() << __LINE__ << "PARSING JOURNEYS" ;
+ //qDebug() << __LINE__ << "PARSING JOURNEYS" ;
//qDebug() << "REPLY:>>>>>>>>>>>>\n" << allData;
-// QVariantMap data = parseJson(allData);
+ //QVariantMap data = parseJson(allData);
//QDomDocument slider { data.value("JourneySliderBlock").toString() };
//qDebug() << "DETAIL" << data.value("JourneyDetailBlock");
@@ -446,7 +446,8 @@
// wrap it in an object, bcause it is a naked list
auto json = parseJson("{\"legs\":" + jsonData.toUtf8() + "}");
- // qWarning() << "leg" << "\n" << json;
+ //qWarning() << "leg" << "\n" << json;
+
if(json["legs"].type() != QVariant::List)
return nullptr;
QVariantList legs = json["legs"].toList();
@@ -465,7 +466,9 @@
// evil chaning scope to keep 'last value'
QDateTime arrivalTime;
+ QDateTime departureTime;
+ // inner loop
for(auto const & legv: legs)
{
if(legv.type() != QVariant::Map)
@@ -474,15 +477,11 @@
continue;
}
QVariantMap leg = legv.toMap();
-
QString mode = leg["Mode"].toMap()["ModeType"].toString();
transportTypes.insert(mode);
-
QString modeName = leg["Mode"].toMap()["Name"].toString();
tTypes += modeName.split(" ").at(0) + " ";
-
QString direction = leg["Destination"].toString();
-
// eg. B for metro line b
QString service = leg["Service"].toString();
QString company = leg["Operator"].toMap()["Name"].toString();
@@ -505,12 +504,9 @@
QString arrivalStation = calls[lastCall].toMap()["Location"].toMap()["Name"].toString();
QString arrivalPlatform = calls[lastCall].toMap()["Platform"].toString();
- QDateTime departureTime = QDateTime::fromString(calls[0].toMap()["Departure"].toString(), Qt::ISODate);
-
- qWarning() << "arrivalStation: " << arrivalStation;
- qWarning() << "departureStation: " << departureStation;
-
-
+ // walks have not times
+ if (calls[0].toMap()["Departure"].toString() != "")
+ departureTime = QDateTime::fromString(calls[0].toMap()["Departure"].toString(), Qt::ISODate);
// only set Arrival if we have it. not set for walk
if (calls[lastCall-1].toMap()["Arrival"].toString() != "")
@@ -519,15 +515,19 @@
JourneyDetailResultItem* item = new JourneyDetailResultItem;
item->setDirection(direction);
+ item->setArrivalStation(arrivalStation);
+ item->setDepartureStation(departureStation);
+ if(!arrivalPlatform.isEmpty())
+ item->setArrivalInfo(QString(tr("Pl. %1")).arg(arrivalPlatform));
+ if(!departurePlatform.isEmpty())
+ item->setDepartureInfo(QString(tr("Pl. %1")).arg(departurePlatform));
// walk Mode has Duration set
durationC = leg["Duration"].toString();
durationC.replace(QString("00:"), QString(""));
-
if(mode == "walk") {
QString walkDuration;
walkDuration = mode + " " + durationC ;
- // item->setTrain(tr("Walk"));
item->setTrain(walkDuration);
} else {
item->setTrain(modeName + ": " + service);
@@ -541,42 +541,46 @@
// we're walking, haven't reset Arrival from last leg
// so add walkingTime to Arrivaltime of last leg
+ // if it's the first leg, subtract walking from the second leg for depart
if(mode == "walk" && walkingTime > 0) {
qint64 addT = walkingTime * 60;
QDateTime arrivalTimeWalk = arrivalTime.addSecs(addT);
- qWarning() << "arrivalmap2: " << arrivalTimeWalk.toString("hh:mm");
+ if (detailCount == 0) {
+ //departureTime = QDateTime::fromString(calls[1].toMap()["Departure"].toString(), Qt::ISODate);
+ //departureTime = departureTime.addSecs( - walkingTime * 60) ;
+ //qDebug() << "walkdepart: " << departureTime;
+ //item->setDepartureDateTime(departureTime);
+ }
item->setArrivalDateTime(arrivalTimeWalk);
} else {
- item->setArrivalDateTime(arrivalTime);
+ item->setArrivalDateTime(arrivalTime);
+ item->setDepartureDateTime(departureTime);
+ qDebug() << "normaldepart: " << departureTime;
}
- item->setArrivalStation(arrivalStation);
-
- if(!arrivalPlatform.isEmpty())
- item->setArrivalInfo(QString(tr("Pl. %1")).arg(arrivalPlatform));
-
- item->setDepartureDateTime(departureTime);
- item->setDepartureStation(departureStation);
-
- if(!departurePlatform.isEmpty())
- item->setDepartureInfo(QString(tr("Pl. %1")).arg(departurePlatform));
-
if (detailCount == 0) {
detail->setDepartureStation(item->departureStation());
detail->setDepartureDateTime(item->departureDateTime());
// we need to record first walking to set it later and use if for departure.
firstWalkingTime = walkingTime;
- } else if (detailCount == legs.count()-1){
+ } else if (detailCount == legs.count()-1){
detail->setArrivalDateTime(item->arrivalDateTime());
detail->setArrivalStation(item->arrivalStation());
}
- // no ALWAYS set arrival :)
+ // accounting for walks we adjust here
+ if (detailCount == 1 && walkCount > 0) {
+ departureTime = departureTime.addSecs( - walkingTime * 60) ;
+ detail->getItem(0)->setDepartureDateTime(departureTime);
+ }
+
+
+ // no ALWAYS set arrival :) errr. why?
detail->setArrivalDateTime(item->arrivalDateTime());
detail->setArrivalStation(item->arrivalStation());
detail->appendItem(item);
detailCount ++;
- }
+ } // inner loop
if(detail->itemcount() == 0)
return nullptr;
@@ -588,7 +592,6 @@
detail->setId(id);
response->setId(id);
- response->setDate(detail->getItem(0)->departureDateTime().date());
response->setTransfers(QString::number(detail->itemcount()-1 -walkCount) + " +" + QString::number(walkCount) );
{
QString tt;
@@ -602,24 +605,28 @@
}
QDateTime minutesBegin;
QDateTime minutesEnd;
-
minutesEnd = detail->getItem(detail->itemcount()-1)->arrivalDateTime();
+ // deal with first item is walking
+
if (detail->getItem(0)->train().startsWith("walk") ) {
// this gets us around not having a start time for walk legs.
// anolog to how we set arrival date time above
+ //qDebug() << "fWalk: " << firstWalkingTime;
QDateTime walkDepart = detail->getItem(1)->departureDateTime().addSecs( - firstWalkingTime * 60) ;
detail->getItem(0)->setDepartureDateTime(walkDepart);
-
response->setDepartureTime(walkDepart.toString("hh:mm"));
+ response->setDate(detail->getItem(0)->departureDateTime().date());
minutesBegin = detail->getItem(0)->departureDateTime();
- response->setDate(detail->getItem(1)->departureDateTime().date());
-
} else {
minutesBegin = detail->getItem(0)->departureDateTime();
+ response->setDate(detail->getItem(0)->departureDateTime().date());
response->setDepartureTime(detail->getItem(0)->departureDateTime().toString("hh:mm"));
}
+ // we've adjusted above on count 1 of details, so set here for the result list
+ detail->setDepartureDateTime(detail->getItem(0)->departureDateTime());
+
response->setArrivalTime(detail->getItem(detail->itemcount()-1)->arrivalDateTime().toString("hh:mm"));
int minutes = minutesBegin.secsTo(minutesEnd) / 60;
|