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
KPkPass
Commits
f0560a2c
Commit
f0560a2c
authored
Mar 11, 2018
by
Volker Krause
Browse files
Complete support for top-level pass properties
parent
659931f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
autotests/pkpasstest.cpp
View file @
f0560a2c
...
...
@@ -84,6 +84,7 @@ private slots:
QCOMPARE
((
int
)
loc
.
latitude
(),
47
);
QCOMPARE
((
int
)
loc
.
longitude
(),
8
);
QCOMPARE
(
loc
.
relevantText
(),
QLatin1String
(
"LX962 Boarding 20:25"
));
QCOMPARE
(
pass
->
maximumDistance
(),
500
);
}
};
...
...
src/pkpass/pass.cpp
View file @
f0560a2c
...
...
@@ -290,6 +290,11 @@ QVector<Location> Pass::locations() const
return
locs
;
}
int
Pass
::
maximumDistance
()
const
{
return
d
->
passObj
.
value
(
QLatin1String
(
"maxDistance"
)).
toInt
(
500
);
}
QDateTime
Pass
::
relevantDate
()
const
{
return
QDateTime
::
fromString
(
d
->
passObj
.
value
(
QLatin1String
(
"relevantDate"
)).
toString
(),
Qt
::
ISODate
);
...
...
src/pkpass/pass.h
View file @
f0560a2c
...
...
@@ -102,7 +102,8 @@ public:
// relevance keys
/** Locations associated with this pass. */
QVector
<
Location
>
locations
()
const
;
// TODO maxDistance
/** Distance in meters to any of the pass locations before this pass becomes relevant. */
int
maximumDistance
()
const
;
QDateTime
relevantDate
()
const
;
// visual appearance keys
...
...
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