summaryrefslogtreecommitdiff
path: root/src/nfc/qnearfieldtarget_neard_p.h
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2014-12-11 12:25:38 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2014-12-11 14:34:53 +0100
commitb94aad106215faebb68d3a58828054ffec3fc62c (patch)
treef849f022f9fae6702ddcac4165d7fa18be57c75b /src/nfc/qnearfieldtarget_neard_p.h
parent66671f8574d2beff94601a6b0b0413cb824cc308 (diff)
downloadqtconnectivity-b94aad106215faebb68d3a58828054ffec3fc62c.tar.gz
Neard: Read all availabe SmartPoster data
So far, Size, Action and MimeType were not read when detecting a smartposter tag. Change-Id: Ica283eac8248ef5ed73f8538eac76050b1310eef Reviewed-by: Martin Leutelt <martin.leutelt@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/nfc/qnearfieldtarget_neard_p.h')
-rw-r--r--src/nfc/qnearfieldtarget_neard_p.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/nfc/qnearfieldtarget_neard_p.h b/src/nfc/qnearfieldtarget_neard_p.h
index 6b374a27..b35db0b5 100644
--- a/src/nfc/qnearfieldtarget_neard_p.h
+++ b/src/nfc/qnearfieldtarget_neard_p.h
@@ -268,10 +268,9 @@ private:
const QString &locale = reply.value().value(QStringLiteral("Language")).toString();
const QString &encoding = reply.value().value(QStringLiteral("Encoding")).toString();
const QString &uri = reply.value().value(QStringLiteral("URI")).toString();
-// const QString &mimetype = reply.value().value(QStringLiteral("MIMEType")).toString();
+
// const QString &mime = reply.value().value(QStringLiteral("MIME")).toString();
// const QString &arr = reply.value().value(QStringLiteral("ARR")).toString();
-// const QString &size = reply.value().value(QStringLiteral("Size")).toString();
const QString type = reply.value().value(QStringLiteral("Type")).toString();
if (type == QStringLiteral("Text")) {
@@ -292,12 +291,26 @@ private:
if (!uri.isEmpty())
spRecord.setUri(QUrl(uri));
-// const QString &actionString = reply.value().value(QStringLiteral("Action")).toString();
-// if (!action.isEmpty()) {
-// QNdefNfcSmartPosterRecord::Action action;
+ const QString &action = reply.value().value(QStringLiteral("Action")).toString();
+ if (!action.isEmpty()) {
+ if (action == QStringLiteral("Do"))
+ spRecord.setAction(QNdefNfcSmartPosterRecord::DoAction);
+ else if (action == QStringLiteral("Save"))
+ spRecord.setAction(QNdefNfcSmartPosterRecord::SaveAction);
+ else if (action == QStringLiteral("Edit"))
+ spRecord.setAction(QNdefNfcSmartPosterRecord::EditAction);
+ }
+
+ if (reply.value().contains(QStringLiteral("Size"))) {
+ uint size = reply.value().value(QStringLiteral("Size")).toUInt();
+ spRecord.setSize(size);
+ }
+
+ const QString &mimeType = reply.value().value(QStringLiteral("MIMEType")).toString();
+ if (!mimeType.isEmpty()) {
+ spRecord.setTypeInfo(mimeType.toUtf8());
+ }
-// spRecord.setAction(acti);
-// }
return spRecord;
} else if (type == QStringLiteral("URI")) {