Commit af9202ef authored by Volker Krause's avatar Volker Krause

Consider pkpass boarding pass transit type

parent f0cdd1c1
...@@ -124,8 +124,13 @@ Item { ...@@ -124,8 +124,13 @@ Item {
Kirigami.Icon { Kirigami.Icon {
Layout.rowSpan: 2 Layout.rowSpan: 2
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
// TODO: check transit type and use appropriate icons source: {
source: "qrc:///images/flight.svg" 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 width: Kirigami.Units.iconSizes.smallMedium
height: width height: width
color: pass.labelColor color: pass.labelColor
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include <KPkPass/Field> #include <KPkPass/Field>
#include <KPkPass/Barcode> #include <KPkPass/Barcode>
#include <KPkPass/Pass> #include <KPkPass/BoardingPass>
#ifndef Q_OS_ANDROID #ifndef Q_OS_ANDROID
#include <KDBusService> #include <KDBusService>
...@@ -176,6 +176,7 @@ int main(int argc, char **argv) ...@@ -176,6 +176,7 @@ int main(int argc, char **argv)
qmlRegisterUncreatableType<KPkPass::Barcode>("org.kde.pkpass", 1, 0, "Barcode", {}); qmlRegisterUncreatableType<KPkPass::Barcode>("org.kde.pkpass", 1, 0, "Barcode", {});
qmlRegisterUncreatableType<KPkPass::Field>("org.kde.pkpass", 1, 0, "Field", {}); qmlRegisterUncreatableType<KPkPass::Field>("org.kde.pkpass", 1, 0, "Field", {});
qmlRegisterUncreatableType<KPkPass::Pass>("org.kde.pkpass", 1, 0, "Pass", {}); qmlRegisterUncreatableType<KPkPass::Pass>("org.kde.pkpass", 1, 0, "Pass", {});
qmlRegisterUncreatableType<KPkPass::BoardingPass>("org.kde.pkpass", 1, 0, "BoardingPass", {});
qRegisterMetaType<KItinerary::KnowledgeDb::DrivingSide>(); qRegisterMetaType<KItinerary::KnowledgeDb::DrivingSide>();
qmlRegisterUncreatableType<KItinerary::Ticket>("org.kde.kitinerary", 1, 0, "Ticket", {}); qmlRegisterUncreatableType<KItinerary::Ticket>("org.kde.kitinerary", 1, 0, "Ticket", {});
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <KPkPass/Field> #include <KPkPass/Field>
#include <KPkPass/Barcode> #include <KPkPass/Barcode>
#include <KPkPass/Pass> #include <KPkPass/BoardingPass>
#include <KLocalizedContext> #include <KLocalizedContext>
...@@ -56,6 +56,7 @@ int main(int argc, char **argv) ...@@ -56,6 +56,7 @@ int main(int argc, char **argv)
qmlRegisterUncreatableType<KPkPass::Barcode>("org.kde.pkpass", 1, 0, "Barcode", {}); qmlRegisterUncreatableType<KPkPass::Barcode>("org.kde.pkpass", 1, 0, "Barcode", {});
qmlRegisterUncreatableType<KPkPass::Field>("org.kde.pkpass", 1, 0, "Field", {}); qmlRegisterUncreatableType<KPkPass::Field>("org.kde.pkpass", 1, 0, "Field", {});
qmlRegisterUncreatableType<KPkPass::Pass>("org.kde.pkpass", 1, 0, "Pass", {}); qmlRegisterUncreatableType<KPkPass::Pass>("org.kde.pkpass", 1, 0, "Pass", {});
qmlRegisterUncreatableType<KPkPass::BoardingPass>("org.kde.pkpass", 1, 0, "BoardingPass", {});
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
engine.rootContext()->setContextObject(new KLocalizedContext(&engine)); engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
......
...@@ -6,5 +6,6 @@ ...@@ -6,5 +6,6 @@
<file alias="PkPassBarcode.qml">../src/app/PkPassBarcode.qml</file> <file alias="PkPassBarcode.qml">../src/app/PkPassBarcode.qml</file>
<file alias="PkPassPage.qml">../src/app/PkPassPage.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/flight.svg">../src/app/images/flight.svg</file>
<file alias="images/train.svg">../src/app/images/train.svg</file>
</qresource> </qresource>
</RCC> </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