Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
Itinerary
Commits
af9202ef
Commit
af9202ef
authored
Jan 01, 2019
by
Volker Krause
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consider pkpass boarding pass transit type
parent
f0cdd1c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
src/app/BoardingPass.qml
src/app/BoardingPass.qml
+7
-2
src/app/main.cpp
src/app/main.cpp
+2
-1
tests/pkpassviewer.cpp
tests/pkpassviewer.cpp
+2
-1
tests/pkpassviewer.qrc
tests/pkpassviewer.qrc
+1
-0
No files found.
src/app/BoardingPass.qml
View file @
af9202ef
...
...
@@ -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
...
...
src/app/main.cpp
View file @
af9202ef
...
...
@@ -42,7 +42,7 @@
#include <KPkPass/Field>
#include <KPkPass/Barcode>
#include <KPkPass/Pass>
#include <KPkPass/
Boarding
Pass>
#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"
,
{});
...
...
tests/pkpassviewer.cpp
View file @
af9202ef
...
...
@@ -20,7 +20,7 @@
#include <KPkPass/Field>
#include <KPkPass/Barcode>
#include <KPkPass/Pass>
#include <KPkPass/
Boarding
Pass>
#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
));
...
...
tests/pkpassviewer.qrc
View file @
af9202ef
...
...
@@ -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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment