kde/itinerary: upgrade to 0_git20200325 (!1112)

This commit is contained in:
Bart Ribbers 2020-03-27 17:26:23 +01:00 committed by Alexey Min
parent 557bd52764
commit 9aa2d5ae8f
No known key found for this signature in database
GPG Key ID: EBF5ECFFFEE34DED
4 changed files with 374 additions and 96 deletions

View File

@ -1,49 +0,0 @@
From e692d7c6cc5ebe441377875270248cb81c8a5cd3 Mon Sep 17 00:00:00 2001
From: Volker Krause <vkrause@kde.org>
Date: Sun, 15 Dec 2019 20:11:10 +0100
Subject: [PATCH] Adapt to KPublicTransport API changes
---
autotests/timelinedelegatecontrollertest.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/autotests/timelinedelegatecontrollertest.cpp b/autotests/timelinedelegatecontrollertest.cpp
index 962cd84..7c91378 100644
--- a/autotests/timelinedelegatecontrollertest.cpp
+++ b/autotests/timelinedelegatecontrollertest.cpp
@@ -68,7 +68,7 @@ private Q_SLOTS:
QCOMPARE(controller.effectiveEndTime(), QDateTime());
QCOMPARE(controller.isLocationChange(), false);
QCOMPARE(controller.isPublicTransport(), false);
- QVERIFY(controller.journeyRequest().isEmpty());
+ QVERIFY(!controller.journeyRequest().isValid());
controller.setBatchId(QStringLiteral("foo"));
QCOMPARE(controller.isCurrent(), false);
@@ -174,20 +174,20 @@ private Q_SLOTS:
TimelineDelegateController controller;
controller.setReservationManager(&mgr);
controller.setBatchId(mgr.batches().at(0)); // flight
- QVERIFY(controller.journeyRequest().isEmpty());
+ QVERIFY(!controller.journeyRequest().isValid());
controller.setBatchId(mgr.batches().at(1)); // first train segment
QCOMPARE(controller.isLocationChange(), true);
QCOMPARE(controller.isPublicTransport(), true);
auto jnyReq = controller.journeyRequest();
- QCOMPARE(jnyReq.isEmpty(), false);
+ QCOMPARE(jnyReq.isValid(), true);
QCOMPARE(jnyReq.from().name(), QStringLiteral("Zürich Flughafen"));
QCOMPARE(jnyReq.to().name(), QLatin1String("Randa"));
controller.setBatchId(mgr.batches().at(2)); // second train segment
jnyReq = controller.journeyRequest();
- QCOMPARE(jnyReq.isEmpty(), false);
+ QCOMPARE(jnyReq.isValid(), true);
QCOMPARE(jnyReq.from().name(), QLatin1String("Visp"));
QCOMPARE(jnyReq.to().name(), QLatin1String("Randa"));
}
--
2.24.1

View File

@ -1,25 +0,0 @@
From 6a0d7e507709e71361c67d1b923674423bbdd50e Mon Sep 17 00:00:00 2001
From: Volker Krause <vkrause@kde.org>
Date: Wed, 18 Dec 2019 18:35:47 +0100
Subject: [PATCH] Fix build
---
src/app/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
index ae6b977..8f393cd 100644
--- a/src/app/CMakeLists.txt
+++ b/src/app/CMakeLists.txt
@@ -160,7 +160,7 @@ if (ANDROID)
weather-storm
)
else ()
- target_link_libraries(itinerary PRIVATE Qt5::Positioning Qt5::DBus)
+ target_link_libraries(itinerary PRIVATE Qt5::Positioning Qt5::DBus Qt5::Widgets)
target_link_libraries(itinerary-app PRIVATE
KF5::DBusAddons
Qt5::Widgets
--
2.24.1

View File

@ -0,0 +1,359 @@
From 6039e31d753fa6dd88572ce5aa28a71a0199ab0b Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Fri, 27 Mar 2020 18:01:53 +0100
Subject: [PATCH] Revert "Consider Reservation::reservationStatus"
This reverts commit 85adf9354c1497d5b49b72e25123792138de5689.
---
.../data/timeline/flight-cancelation.json | 35 --------
.../data/timeline/flight-cancelation.model | 86 -------------------
autotests/statisticstest.cpp | 1 -
autotests/timelinedelegatecontrollertest.cpp | 17 ----
src/app/TimelineDelegate.qml | 8 +-
src/app/statisticsmodel.cpp | 5 --
src/app/timelinedelegatecontroller.cpp | 13 ---
src/app/timelinedelegatecontroller.h | 4 -
src/app/timelinemodel.cpp | 24 ++----
9 files changed, 7 insertions(+), 186 deletions(-)
delete mode 100644 autotests/data/timeline/flight-cancelation.json
delete mode 100644 autotests/data/timeline/flight-cancelation.model
diff --git a/autotests/data/timeline/flight-cancelation.json b/autotests/data/timeline/flight-cancelation.json
deleted file mode 100644
index db8017b..0000000
--- a/autotests/data/timeline/flight-cancelation.json
+++ /dev/null
@@ -1,35 +0,0 @@
-[{
- "internal-comment": "sample from https://developers.google.com/gmail/markup/reference/flight-reservation#cancel_a_flight",
- "@context": "http://schema.org",
- "@type": "FlightReservation",
- "reservationNumber": "RXJ34P",
- "reservationStatus": "http://schema.org/Cancelled",
- "underName": {
- "@type": "Person",
- "name": "Eva Green"
- },
- "reservationFor": {
- "@type": "Flight",
- "flightNumber": "110",
- "airline": {
- "@type": "Airline",
- "name": "United",
- "iataCode": "UA"
- },
- "departureAirport": {
- "@type": "Airport",
- "name": "San Francisco Airport",
- "iataCode": "SFO"
- },
- "departureTime": "1996-10-16T20:15:00-07:00",
- "arrivalAirport": {
- "@type": "Airport",
- "name": "John F. Kennedy International Airport",
- "iataCode": "JFK"
- },
- "arrivalTime": "1996-10-16T06:30:00-04:00"
- },
- "checkinUrl": "http://united.com/onlinecheckin.html",
- "modifiedTime": "1996-05-01T08:30:00-08:00",
- "modifyReservationUrl": "http://united.com/modifyreservation.html"
-}]
diff --git a/autotests/data/timeline/flight-cancelation.model b/autotests/data/timeline/flight-cancelation.model
deleted file mode 100644
index 59f8462..0000000
--- a/autotests/data/timeline/flight-cancelation.model
+++ /dev/null
@@ -1,86 +0,0 @@
-[
- {
- "isToday": true,
- "isTodayEmpty": true,
- "rangeType": 0,
- "sectionHeader": "Today",
- "type": 1
- },
- {
- "isToday": false,
- "rangeType": 0,
- "reservations": [
- {
- "@context": "http://schema.org",
- "@type": "FlightReservation",
- "modifiedTime": "1996-05-01T08:30:00-08:00",
- "potentialAction": [
- {
- "@type": "CheckInAction",
- "target": "http://united.com/onlinecheckin.html"
- },
- {
- "@type": "UpdateAction",
- "target": "http://united.com/modifyreservation.html"
- }
- ],
- "reservationFor": {
- "@type": "Flight",
- "airline": {
- "@type": "Airline",
- "iataCode": "UA",
- "name": "United"
- },
- "arrivalAirport": {
- "@type": "Airport",
- "address": {
- "@type": "PostalAddress",
- "addressCountry": "US"
- },
- "geo": {
- "@type": "GeoCoordinates",
- "latitude": 40.63970184326172,
- "longitude": -73.77890014648438
- },
- "iataCode": "JFK",
- "name": "John F. Kennedy International Airport"
- },
- "arrivalTime": {
- "@type": "QDateTime",
- "@value": "1996-10-17T06:30:00-04:00",
- "timezone": "America/New_York"
- },
- "departureAirport": {
- "@type": "Airport",
- "address": {
- "@type": "PostalAddress",
- "addressCountry": "US"
- },
- "geo": {
- "@type": "GeoCoordinates",
- "latitude": 37.618900299072266,
- "longitude": -122.375
- },
- "iataCode": "SFO",
- "name": "San Francisco Airport"
- },
- "departureDay": "1996-10-16",
- "departureTime": {
- "@type": "QDateTime",
- "@value": "1996-10-16T20:15:00-07:00",
- "timezone": "America/Los_Angeles"
- },
- "flightNumber": "110"
- },
- "reservationNumber": "RXJ34P",
- "reservationStatus": "http://schema.org/ReservationCancelled",
- "underName": {
- "@type": "Person",
- "name": "Eva Green"
- }
- }
- ],
- "sectionHeader": "Wednesday, 10/16/96",
- "type": 6
- }
-]
diff --git a/autotests/statisticstest.cpp b/autotests/statisticstest.cpp
index 87dc586..159ed7f 100644
--- a/autotests/statisticstest.cpp
+++ b/autotests/statisticstest.cpp
@@ -72,7 +72,6 @@ private Q_SLOTS:
resMgr.importReservation(readFile(QLatin1String(SOURCE_DIR "/../tests/randa2017.json")));
resMgr.importReservation(readFile(QLatin1String(SOURCE_DIR "/../tests/akademy2017.json")));
resMgr.importReservation(readFile(QLatin1String(SOURCE_DIR "/../tests/akademy2018-program.json")));
- resMgr.importReservation(readFile(QLatin1String(SOURCE_DIR "/data/flight-cancelation.json"))); // canceled flight, should not change stats
stats.setTimeRange({}, {});
QVERIFY(!changeSpy.isEmpty());
diff --git a/autotests/timelinedelegatecontrollertest.cpp b/autotests/timelinedelegatecontrollertest.cpp
index 3716a3d..7c91378 100644
--- a/autotests/timelinedelegatecontrollertest.cpp
+++ b/autotests/timelinedelegatecontrollertest.cpp
@@ -69,7 +69,6 @@ private Q_SLOTS:
QCOMPARE(controller.isLocationChange(), false);
QCOMPARE(controller.isPublicTransport(), false);
QVERIFY(!controller.journeyRequest().isValid());
- QCOMPARE(controller.isCanceled(), false);
controller.setBatchId(QStringLiteral("foo"));
QCOMPARE(controller.isCurrent(), false);
@@ -77,7 +76,6 @@ private Q_SLOTS:
QCOMPARE(controller.effectiveEndTime(), QDateTime());
QCOMPARE(controller.isLocationChange(), false);
QCOMPARE(controller.isPublicTransport(), false);
- QCOMPARE(controller.isCanceled(), false);
ReservationManager mgr;
controller.setReservationManager(&mgr);
@@ -86,7 +84,6 @@ private Q_SLOTS:
QCOMPARE(controller.effectiveEndTime(), QDateTime());
QCOMPARE(controller.isLocationChange(), false);
QCOMPARE(controller.isPublicTransport(), false);
- QCOMPARE(controller.isCanceled(), false);
}
void testProgress()
@@ -114,7 +111,6 @@ private Q_SLOTS:
QCOMPARE(controller.progress(), 0.0f);
QCOMPARE(controller.isLocationChange(), true);
QCOMPARE(controller.isPublicTransport(), true);
- QCOMPARE(controller.isCanceled(), false);
trip.setArrivalTime(QDateTime::currentDateTime().addDays(1));
res.setReservationFor(trip);
@@ -232,19 +228,6 @@ private Q_SLOTS:
QCOMPARE(updateSpy.size(), 0);
QCOMPARE(rmSpy.size(), 3);
}
-
- void testCancel()
- {
- ReservationManager mgr;
- clearReservations(&mgr);
- mgr.importReservation(readFile(QLatin1String(SOURCE_DIR "/data/timeline/flight-cancelation.json")));
-
- TimelineDelegateController controller;
- controller.setReservationManager(&mgr);
- controller.setBatchId(mgr.batches().at(0));
- QCOMPARE(controller.isCanceled(), true);
- QCOMPARE(controller.connectionWarning(), false);
- }
};
QTEST_GUILESS_MAIN(TimelineDelegateControllerTest)
diff --git a/src/app/TimelineDelegate.qml b/src/app/TimelineDelegate.qml
index 9d782be..d138822 100644
--- a/src/app/TimelineDelegate.qml
+++ b/src/app/TimelineDelegate.qml
@@ -55,13 +55,7 @@ Kirigami.AbstractCard {
id: headerBackground
Kirigami.Theme.colorSet: controller.isCurrent ? Kirigami.Theme.Selection : Kirigami.Theme.Complementary
Kirigami.Theme.inherit: false
- color: {
- if (controller.connectionWarning)
- return Kirigami.Theme.negativeTextColor;
- if (controller.isCanceled)
- return Kirigami.Theme.disabledTextColor;
- return Kirigami.Theme.backgroundColor;
- }
+ color: controller.connectionWarning ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.backgroundColor
implicitHeight: headerLayout.implicitHeight + Kirigami.Units.largeSpacing * 2
anchors.leftMargin: -root.leftPadding
anchors.topMargin: -root.topPadding
diff --git a/src/app/statisticsmodel.cpp b/src/app/statisticsmodel.cpp
index 00baa55..70adfd4 100644
--- a/src/app/statisticsmodel.cpp
+++ b/src/app/statisticsmodel.cpp
@@ -283,11 +283,6 @@ void StatisticsModel::recompute()
isPrev = dt.date() < m_begin;
}
- // don't count canceled reservations
- if (JsonLd::canConvert<Reservation>(res) && JsonLd::convert<Reservation>(res).reservationStatus() == Reservation::ReservationCancelled) {
- continue;
- }
-
if (LocationUtil::isLocationChange(res)) {
computeStats(res, isPrev ? m_prevStatData : m_statData);
} else if (JsonLd::isA<LodgingReservation>(res)) {
diff --git a/src/app/timelinedelegatecontroller.cpp b/src/app/timelinedelegatecontroller.cpp
index 6d1fe31..01f6fc4 100644
--- a/src/app/timelinedelegatecontroller.cpp
+++ b/src/app/timelinedelegatecontroller.cpp
@@ -504,17 +504,4 @@ bool TimelineDelegateController::connectionWarning() const
return curDepDt < prevArrDt;
}
-bool TimelineDelegateController::isCanceled() const
-{
- if (!m_resMgr || m_batchId.isEmpty()) {
- return false;
- }
-
- const auto res = m_resMgr->reservation(m_batchId);
- if (!JsonLd::canConvert<Reservation>(res)) {
- return false;
- }
- return JsonLd::convert<Reservation>(res).reservationStatus() == Reservation::ReservationCancelled;
-}
-
#include "moc_timelinedelegatecontroller.cpp"
diff --git a/src/app/timelinedelegatecontroller.h b/src/app/timelinedelegatecontroller.h
index 85ace1b..976cdde 100644
--- a/src/app/timelinedelegatecontroller.h
+++ b/src/app/timelinedelegatecontroller.h
@@ -71,9 +71,6 @@ class TimelineDelegateController : public QObject
/** Inbound connection is unlikely to work. */
Q_PROPERTY(bool connectionWarning READ connectionWarning NOTIFY connectionWarningChanged)
- /** Reservation has been canceled (by user or provider, we usually don't know which). */
- Q_PROPERTY(bool isCanceled READ isCanceled NOTIFY contentChanged)
-
public:
TimelineDelegateController(QObject *parent = nullptr);
~TimelineDelegateController();
@@ -103,7 +100,6 @@ public:
Q_INVOKABLE void applyJourney(const QVariant &journey);
bool connectionWarning() const;
- bool isCanceled() const;
Q_SIGNALS:
void setupChanged();
diff --git a/src/app/timelinemodel.cpp b/src/app/timelinemodel.cpp
index 5a88ffb..30b6974 100644
--- a/src/app/timelinemodel.cpp
+++ b/src/app/timelinemodel.cpp
@@ -78,10 +78,6 @@ static GeoCoordinates geoCoordinate(const QVariant &res)
return LocationUtil::geo(LocationUtil::location(res));
}
-static bool isCanceled(const QVariant &res)
-{
- return JsonLd::canConvert<Reservation>(res) && JsonLd::convert<Reservation>(res).reservationStatus() == Reservation::ReservationCancelled;
-}
TimelineModel::TimelineModel(QObject *parent)
: QAbstractListModel(parent)
@@ -474,10 +470,6 @@ void TimelineModel::updateInformationElements()
continue;
}
const auto res = m_resMgr->reservation((*it).batchId());
- if (isCanceled(res)) {
- ++it;
- continue;
- }
auto newCountry = homeCountry;
newCountry.setIsoCode(LocationHelper::destinationCountry(res));
@@ -525,11 +517,9 @@ void TimelineModel::updateWeatherElements()
continue;
}
const auto res = m_resMgr->reservation((*it).batchId());
- if (!isCanceled(res)) {
- const auto newGeo = geoCoordinate(res);
- if (LocationUtil::isLocationChange(res) || newGeo.isValid()) {
- geo = newGeo;
- }
+ const auto newGeo = geoCoordinate(res);
+ if (LocationUtil::isLocationChange(res) || newGeo.isValid()) {
+ geo = newGeo;
}
++it;
@@ -558,11 +548,9 @@ void TimelineModel::updateWeatherElements()
continue;
}
const auto res = m_resMgr->reservation((*it).batchId());
- if (!isCanceled(res)) {
- const auto newGeo = geoCoordinate(res);
- if (LocationUtil::isLocationChange(res) || newGeo.isValid()) {
- geo = newGeo;
- }
+ const auto newGeo = geoCoordinate(res);
+ if (LocationUtil::isLocationChange(res) || newGeo.isValid()) {
+ geo = newGeo;
}
++it;
--
2.26.0

View File

@ -1,9 +1,9 @@
# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=itinerary
pkgver=0_git20191214
_commit="63caaf2daae0a105982ee774de9a3797aae3ad33"
pkgrel=2
pkgver=0_git20200325
_commit="54303b62bf6f4ec0cf1ccc2967364f96104bc68a"
pkgrel=0
pkgdesc="Application to assist with usage of Travel Reservations"
url="https://github.com/KDE/itinerary"
arch="all !armhf"
@ -11,35 +11,28 @@ license="LGPL-2.0-or-later"
depends="prison"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtquickcontrols2-dev
qt5-qtlocation-dev ki18n-dev kcontacts-dev kpkpass-dev kitinerary-dev
kpublictransport-dev kdbusaddons-dev solid-dev shared-mime-info"
kpublictransport-dev kdbusaddons-dev solid-dev shared-mime-info
kholidays-dev knotifications-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/KDE/itinerary/archive/$_commit.tar.gz
0001-Fix-build.patch
0001-Adapt-to-KPublicTransport-API-changes.patch"
0001-Revert-Consider-Reservation-reservationStatus.patch" # requires kitinerary v20.04.0
builddir="$srcdir/$pkgname-$_commit"
options="!check" # Tests fail
options="!check" # Tests require newest version of kitinerary
build() {
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake \
cmake -B build \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=True \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_C_FLAGS="$CFLAGS" \
$CMAKE_CROSSOPTS
make
-DCMAKE_INSTALL_LIBDIR=lib
make -C build
}
check() {
cd build
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
make DESTDIR="$pkgdir" install
DESTDIR="$pkgdir" make -C build install
}
sha512sums="4d0ac75d96cfe9c996ea6b41472945d827d612fe817dff342dffbb22588753cf96d307c9132a693ab77a24819afcc4af1a35e1b59af9d406a758c7663132ebd2 itinerary-63caaf2daae0a105982ee774de9a3797aae3ad33.tar.gz
ac2eca31b0dc066ff174f6bdb612d5387e7d31bc31b5d0e28814be4932c69dbd9cec4975420757d5b70c14d9828ee4a7a175da4eae4124840fff26f68e0df20f 0001-Fix-build.patch
619bf1ef7c3eb2b9f8de717f291ba7aac8f038adea38b5ef0c2406d57aff6d850e57d7d720f993242ac2fd6bf8ceebf647996c32bda1105652560818e7387ff7 0001-Adapt-to-KPublicTransport-API-changes.patch"
sha512sums="563f9d2b6adae2c03a549cb83dbf2cef0baae8fdb1cc4310b6b90e73a25adcbbbf2ce98aaab5b9ff3658823c1b9370344f9f9c932338f8499093f747b5cbda8d itinerary-54303b62bf6f4ec0cf1ccc2967364f96104bc68a.tar.gz
1b28272addd954bbea2dc874dc0b2f4ade256da57115db3fa54a088d0367b32cab5b218c9eb273f5c8d9613e36a72be4437f9599067d932ef704e3504653335c 0001-Revert-Consider-Reservation-reservationStatus.patch"