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
34590459
Commit
34590459
authored
Mar 04, 2018
by
Volker Krause
Browse files
Clean up Pass internals a bit
parent
04efe0ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pkpass/pass.cpp
View file @
34590459
...
...
@@ -40,11 +40,6 @@ using namespace KPkPass;
static
const
char
*
const
passTypes
[]
=
{
"boardingPass"
,
"coupon"
,
"eventTicket"
,
"generic"
,
"storeCard"
};
static
const
auto
passTypesCount
=
sizeof
(
passTypes
)
/
sizeof
(
passTypes
[
0
]);
QJsonObject
PassPrivate
::
data
()
const
{
return
passObj
;
}
QJsonObject
PassPrivate
::
passData
()
const
{
return
passObj
.
value
(
QLatin1String
(
passTypes
[
passType
])).
toObject
();
...
...
@@ -324,14 +319,14 @@ QVector<Barcode> Pass::barcodes() const
QVector
<
Barcode
>
codes
;
// barcodes array
const
auto
a
=
d
->
data
()
.
value
(
QLatin1String
(
"barcodes"
)).
toArray
();
const
auto
a
=
d
->
passObj
.
value
(
QLatin1String
(
"barcodes"
)).
toArray
();
codes
.
reserve
(
a
.
size
());
for
(
const
auto
&
bc
:
a
)
codes
.
push_back
(
Barcode
(
bc
.
toObject
(),
this
));
// just a single barcode
if
(
codes
.
isEmpty
())
{
const
auto
bc
=
d
->
data
()
.
value
(
QLatin1String
(
"barcode"
)).
toObject
();
const
auto
bc
=
d
->
passObj
.
value
(
QLatin1String
(
"barcode"
)).
toObject
();
if
(
!
bc
.
isEmpty
())
codes
.
push_back
(
Barcode
(
bc
,
this
));
}
...
...
src/pkpass/pass_p.h
View file @
34590459
...
...
@@ -29,8 +29,6 @@
namespace
KPkPass
{
class
PassPrivate
{
public:
/** Content of the pass.json file. */
QJsonObject
data
()
const
;
/** The pass data structure of the pass.json file. */
QJsonObject
passData
()
const
;
/** Localized message for the given key. */
...
...
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