Commit af9202ef authored by Volker Krause's avatar Volker Krause

Consider pkpass boarding pass transit type

parent f0cdd1c1
......@@ -124,8 +124,13 @@ Item {
Kirigami.Icon {
Layout.rowSpan: 2
Layout.alignment: Qt.AlignBottom
// TODO: check transit type and use appropriate icons
source: "qrc:///images/flight.svg"
source: {
switch (pass.transitType) {
case KPkPass.BoardingPass.Air: return "qrc:///images/flight.svg"
case KPkPass.BoardingPass.Train: return "qrc:///images/train.svg"
}
return "go-next";
}
width: Kirigami.Units.iconSizes.smallMedium
height: width
color: pass.labelColor
......
......@@ -42,7 +42,7 @@
#include <KPkPass/Field>
#include <KPkPass/Barcode>
#include <KPkPass/Pass>
#include <KPkPass/BoardingPass>
#ifndef Q_OS_ANDROID
#include <KDBusService>
......@@ -176,6 +176,7 @@ int main(int argc, char **argv)
qmlRegisterUncreatableType<KPkPass::Barcode>("org.kde.pkpass", 1, 0, "Barcode", {});
qmlRegisterUncreatableType<KPkPass::Field>("org.kde.pkpass", 1, 0, "Field", {});
qmlRegisterUncreatableType<KPkPass::Pass>("org.kde.pkpass", 1, 0, "Pass", {});
qmlRegisterUncreatableType<KPkPass::BoardingPass>("org.kde.pkpass", 1, 0, "BoardingPass", {});
qRegisterMetaType<KItinerary::KnowledgeDb::DrivingSide>();
qmlRegisterUncreatableType<KItinerary::Ticket>("org.kde.kitinerary", 1, 0, "Ticket", {});
......
......@@ -20,7 +20,7 @@
#include <KPkPass/Field>
#include <KPkPass/Barcode>
#include <KPkPass/Pass>
#include <KPkPass/BoardingPass>
#include <KLocalizedContext>
......@@ -56,6 +56,7 @@ int main(int argc, char **argv)
qmlRegisterUncreatableType<KPkPass::Barcode>("org.kde.pkpass", 1, 0, "Barcode", {});
qmlRegisterUncreatableType<KPkPass::Field>("org.kde.pkpass", 1, 0, "Field", {});
qmlRegisterUncreatableType<KPkPass::Pass>("org.kde.pkpass", 1, 0, "Pass", {});
qmlRegisterUncreatableType<KPkPass::BoardingPass>("org.kde.pkpass", 1, 0, "BoardingPass", {});
QQmlApplicationEngine engine;
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
......
......@@ -6,5 +6,6 @@
<file alias="PkPassBarcode.qml">../src/app/PkPassBarcode.qml</file>
<file alias="PkPassPage.qml">../src/app/PkPassPage.qml</file>
<file alias="images/flight.svg">../src/app/images/flight.svg</file>
<file alias="images/train.svg">../src/app/images/train.svg</file>
</qresource>
</RCC>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment