From aecf1408552a440b81b1157c4f701533833c09c8 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 6 Apr 2016 12:38:16 +0200 Subject: Fix Annotated URL Example on Android QNearFieldManager::registerNdefMessageHandler() is supposed to register the current app as platform handler for certain tag types. The example is written around this concept and doesn't start the target detection when such a registration succeeded. Unfortunately the Android implementation does something completely different. Therefore the startTargetDetection() and connect() calls after the current return is necessary to make the example useful. For now we simply ignore the feature and always start target detection. Since neither NEARD/Linux nor Android (the only two supported platforms) have an implementation for the feature the modified example works as expected. Considering the current state it should be considered to remove this NDEF message registration feature in Qt 6 altogether. The only platform which ever supported the feature was BB10 and its implementation was removed a long time ago. Task-number: QTBUG-52154 Change-Id: Ibef9e77ac33b9629b6d81aa70eaa01ab1702cfcb Reviewed-by: Peter Rustler Reviewed-by: Alex Blasche --- examples/nfc/annotatedurl/annotatedurl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/nfc/annotatedurl/annotatedurl.cpp b/examples/nfc/annotatedurl/annotatedurl.cpp index cf7dd17a..a07aadcc 100644 --- a/examples/nfc/annotatedurl/annotatedurl.cpp +++ b/examples/nfc/annotatedurl/annotatedurl.cpp @@ -77,8 +77,8 @@ AnnotatedUrl::AnnotatedUrl(QObject *parent) SLOT(handleMessage(QNdefMessage,QNearFieldTarget*))); //! [QNearFieldManager register handler] - if (result != -1) - return; + if (result < 0) + qWarning() << "Platform does not support NDEF message handler registration"; manager->startTargetDetection(); connect(manager, SIGNAL(targetDetected(QNearFieldTarget*)), -- cgit v1.2.3