Commit 99adf99d authored by Volker Krause's avatar Volker Krause
Browse files

Add barcode message encoding property

parent 7fde7996
......@@ -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"));
}
};
......
......@@ -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();
}
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment