Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
2e9434b6
Commit
2e9434b6
authored
Jan 07, 2021
by
Volker Krause
Browse files
Silence a number of warnings about accessing undefined objects
parent
d8d18a62
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/PlaceDelegate.qml
View file @
2e9434b6
...
...
@@ -27,7 +27,7 @@ Item {
/** Indicates that this represents the full range of the element (only valid for non-transit elements). */
readonly
property
bool
isFullRange
:
!
isRangeBegin
&&
!
isRangeEnd
implicitHeight
:
(
!
place
.
address
.
isEmpty
||
place
.
geo
.
isValid
)
?
Math
.
max
(
buttonLayout
.
implicitHeight
,
label
.
implicitHeight
)
:
0
implicitHeight
:
(
place
&&
(
!
place
.
address
.
isEmpty
||
place
.
geo
.
isValid
)
)
?
Math
.
max
(
buttonLayout
.
implicitHeight
,
label
.
implicitHeight
)
:
0
implicitWidth
:
label
.
width
+
buttonLayout
.
width
Component
{
...
...
@@ -40,8 +40,8 @@ Item {
QQC2.Label
{
id
:
label
visible
:
!
place
.
address
.
isEmpty
text
:
Localizer
.
formatAddress
(
place
.
address
)
visible
:
place
!=
undefined
&&
!
place
.
address
.
isEmpty
text
:
place
?
Localizer
.
formatAddress
(
place
.
address
)
:
""
color
:
Kirigami
.
Theme
.
textColor
anchors.left
:
root
.
left
}
...
...
@@ -52,7 +52,7 @@ Item {
y
:
Math
.
max
(
0
,
label
.
implicitHeight
-
buttonLayout
.
implicitHeight
)
QQC2.ToolButton
{
visible
:
place
.
geo
.
isValid
visible
:
place
!=
undefined
&&
place
.
geo
.
isValid
icon.name
:
"
map-symbolic
"
onClicked
:
{
var
args
=
{
placeName
:
place
.
name
};
...
...
@@ -70,7 +70,7 @@ Item {
}
QQC2.ToolButton
{
visible
:
place
.
geo
.
isValid
||
!
place
.
address
.
isEmpty
visible
:
place
!=
undefined
&&
(
place
.
geo
.
isValid
||
!
place
.
address
.
isEmpty
)
icon.name
:
"
map-globe
"
onClicked
:
NavigationController
.
showOnMap
(
place
)
}
...
...
@@ -91,7 +91,7 @@ Item {
// - at all arrival locations, unless it's a layover to a subsequent transit element TODO
// - when leaving non-transit events
QQC2.ToolButton
{
visible
:
place
.
geo
.
isValid
&&
!
isRangeBegin
visible
:
place
!=
undefined
&&
place
.
geo
.
isValid
&&
!
isRangeBegin
icon.name
:
"
view-calendar-day
"
onClicked
:
{
applicationWindow
().
pageStack
.
push
(
departuresPage
);
...
...
src/app/TicketTokenDelegate.qml
View file @
2e9434b6
...
...
@@ -20,7 +20,7 @@ ColumnLayout {
property
var
resIds
readonly
property
var
currentReservationId
:
ticketModel
.
reservationIdAt
(
travelerBox
.
currentIndex
)
readonly
property
var
currentTicket
:
ticketModel
.
reservationAt
(
travelerBox
.
currentIndex
).
reservedTicket
readonly
property
var
currentTicket
:
ticketModel
.
reservationAt
(
travelerBox
.
currentIndex
)
?
ticketModel
.
reservationAt
(
travelerBox
.
currentIndex
).
reservedTicket
:
undefined
Layout.fillWidth
:
true
TicketTokenModel
{
...
...
@@ -53,7 +53,7 @@ ColumnLayout {
anchors.bottom
:
barcodeContainer
.
bottom
color
:
"
white
"
// aim at 50x50mm for 2d codes, and 25mm height for 1d codes, if we have the space for it
property
bool
is1dCode
:
currentTicket
.
ticketTokenType
==
Ticket
.
Code128
property
bool
is1dCode
:
currentTicket
?
currentTicket
.
ticketTokenType
==
Ticket
.
Code128
:
false
// if this gets too wide, we need to rotate by 90°
property
bool
showVertical
:
is1dCode
&&
barcodeTargetWidth
>
root
.
width
...
...
Write
Preview
Supports
Markdown
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