diff options
Diffstat (limited to 'examples/nfc/ndefeditor/mainwindow.cpp')
-rw-r--r-- | examples/nfc/ndefeditor/mainwindow.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/nfc/ndefeditor/mainwindow.cpp b/examples/nfc/ndefeditor/mainwindow.cpp index 527ff6c7..28c2054a 100644 --- a/examples/nfc/ndefeditor/mainwindow.cpp +++ b/examples/nfc/ndefeditor/mainwindow.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNfc module of the Qt Toolkit. ** @@ -17,8 +17,8 @@ ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** @@ -235,6 +235,8 @@ void MainWindow::targetDetected(QNearFieldTarget *target) this, SLOT(targetError(QNearFieldTarget::Error,QNearFieldTarget::RequestId))); m_request = target->readNdefMessages(); + if (!m_request.isValid()) // cannot read messages + targetError(QNearFieldTarget::NdefReadError, m_request); break; case WriteNdef: connect(target, SIGNAL(ndefMessagesWritten()), this, SLOT(ndefMessageWritten())); @@ -242,6 +244,8 @@ void MainWindow::targetDetected(QNearFieldTarget *target) this, SLOT(targetError(QNearFieldTarget::Error,QNearFieldTarget::RequestId))); m_request = target->writeNdefMessages(QList<QNdefMessage>() << ndefMessage()); + if (!m_request.isValid()) // cannot write messages + targetError(QNearFieldTarget::NdefWriteError, m_request); break; } } |