Skip to content
GitLab
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
16d72eac
Commit
16d72eac
authored
Mar 15, 2018
by
Volker Krause
Browse files
Cleanup handling of pass update URLs
parent
b387eba4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pkpass/pass.cpp
View file @
16d72eac
...
...
@@ -36,6 +36,7 @@
#include
<QLocale>
#include
<QTextCodec>
#include
<QImage>
#include
<QUrl>
using
namespace
KPkPass
;
...
...
@@ -373,9 +374,19 @@ QString Pass::authenticationToken() const
return
d
->
passObj
.
value
(
QLatin1String
(
"authenticationToken"
)).
toString
();
}
Q
String
Pass
::
webServiceUrl
()
const
Q
Url
Pass
::
webServiceUrl
()
const
{
return
d
->
passObj
.
value
(
QLatin1String
(
"webServiceURL"
)).
toString
();
return
QUrl
(
d
->
passObj
.
value
(
QLatin1String
(
"webServiceURL"
)).
toString
());
}
QUrl
Pass
::
passUpdateUrl
()
const
{
QUrl
url
(
webServiceUrl
());
if
(
!
url
.
isValid
())
{
return
{};
}
url
.
setPath
(
url
.
path
()
+
QLatin1String
(
"/v1/passes/"
)
+
passTypeIdentifier
()
+
QLatin1Char
(
'/'
)
+
serialNumber
());
return
url
;
}
QVector
<
Barcode
>
Pass
::
barcodes
()
const
...
...
src/pkpass/pass.h
View file @
16d72eac
...
...
@@ -33,6 +33,7 @@
class
QByteArray
;
class
QString
;
class
QUrl
;
namespace
KPkPass
{
...
...
@@ -64,9 +65,6 @@ class KPKPASS_EXPORT Pass : public QObject
Q_PROPERTY
(
QColor
labelColor
READ
labelColor
CONSTANT
)
Q_PROPERTY
(
QString
logoText
READ
logoText
CONSTANT
)
Q_PROPERTY
(
QString
authenticationToken
READ
authenticationToken
CONSTANT
)
Q_PROPERTY
(
QString
webServiceUrl
READ
webServiceUrl
CONSTANT
)
// needs to be QVariantList just for QML (Grantlee would also work with QVector<Field>
Q_PROPERTY
(
QVariantList
barcodes
READ
barcodesVariant
CONSTANT
)
Q_PROPERTY
(
QVariantList
auxiliaryFields
READ
auxiliaryFieldsVariant
CONSTANT
)
...
...
@@ -127,7 +125,11 @@ public:
// web service keys
QString
authenticationToken
()
const
;
QString
webServiceUrl
()
const
;
QUrl
webServiceUrl
()
const
;
/** Pass update URL.
* @see https://developer.apple.com/library/content/documentation/PassKit/Reference/PassKit_WebService/WebService.html
*/
QUrl
passUpdateUrl
()
const
;
QVector
<
Field
>
auxiliaryFields
()
const
;
QVector
<
Field
>
backFields
()
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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