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
99adf99d
Commit
99adf99d
authored
Mar 10, 2018
by
Volker Krause
Browse files
Add barcode message encoding property
parent
7fde7996
Changes
3
Hide whitespace changes
Inline
Side-by-side
autotests/pkpasstest.cpp
View file @
99adf99d
...
...
@@ -70,6 +70,8 @@ private slots:
auto
bc
=
barcodes
.
at
(
0
);
QCOMPARE
(
bc
.
format
(),
KPkPass
::
Barcode
::
QR
);
QVERIFY
(
!
bc
.
message
().
isEmpty
());
QVERIFY
(
bc
.
alternativeText
().
isEmpty
());
QCOMPARE
(
bc
.
messageEncoding
(),
QLatin1String
(
"iso-8859-1"
));
}
};
...
...
src/pkpass/barcode.cpp
View file @
99adf99d
...
...
@@ -73,3 +73,8 @@ QString Barcode::message() const
{
return
d
->
obj
.
value
(
QLatin1String
(
"message"
)).
toString
();
}
QString
Barcode
::
messageEncoding
()
const
{
return
d
->
obj
.
value
(
QLatin1String
(
"messageEncoding"
)).
toString
();
}
src/pkpass/barcode.h
View file @
99adf99d
...
...
@@ -41,6 +41,7 @@ class KPKPASS_EXPORT Barcode
Q_PROPERTY
(
QString
alternativeText
READ
alternativeText
CONSTANT
)
Q_PROPERTY
(
Format
format
READ
format
CONSTANT
)
Q_PROPERTY
(
QString
message
READ
message
CONSTANT
)
Q_PROPERTY
(
QString
messageEncoding
READ
messageEncoding
CONSTANT
)
public:
enum
Format
{
...
...
@@ -61,8 +62,9 @@ public:
Format
format
()
const
;
/** The message encoded in the barcode. */
QString
message
()
const
;
/** Encoding used for the message() content. */
QString
messageEncoding
()
const
;
// TODO add codec property
private:
friend
class
Pass
;
explicit
Barcode
(
const
QJsonObject
&
obj
,
const
Pass
*
file
);
...
...
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