summaryrefslogtreecommitdiffstats
path: root/src/nfc/qnearfieldtarget_emulator.cpp
diff options
context:
space:
mode:
authorAaron McCarthy <mccarthy.aaron@gmail.com>2012-10-01 13:28:16 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-01 12:04:55 +0200
commitf3d8f66116af4319650d8f3e7ca069275fdfa780 (patch)
tree2b7dc73c029adfdf0302409a2422b3df4d9e5c54 /src/nfc/qnearfieldtarget_emulator.cpp
parent3f4a920f87842e1bbb20f72ce04d6da7a866ab1d (diff)
Further porting of NFC module from mobility to Qt 5.
Includes the following changes: * Conditionally enables building of the NFC module when qmake is run with CONFIG+=nfc. * Correctly build within the QtNfc namespace. * Fix compile errors in examples, enable building of NFC examples. * Fix compile errors in tests, enable building of NFC tests. Mark the some NFC tests as insignificant as they currently crash. Notably does not enable NFC documentation generation. Task-number: QTBUG-22015 Change-Id: I9ff170c45848c8f0215e9427797922f840c2f015 Reviewed-by: Alex <ablasche@gmail.com>
Diffstat (limited to 'src/nfc/qnearfieldtarget_emulator.cpp')
-rw-r--r--src/nfc/qnearfieldtarget_emulator.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nfc/qnearfieldtarget_emulator.cpp b/src/nfc/qnearfieldtarget_emulator.cpp
index 3661ea2a..a4bd888c 100644
--- a/src/nfc/qnearfieldtarget_emulator.cpp
+++ b/src/nfc/qnearfieldtarget_emulator.cpp
@@ -48,13 +48,12 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QDateTime>
-#include <QtCore/QDebug>
+QTNFC_BEGIN_NAMESPACE
static QMutex tagMutex;
static QMap<TagBase *, bool> tagMap;
static TagActivator tagActivator;
-
TagType1::TagType1(TagBase *tag, QObject *parent)
: QNearFieldTagType1(parent), m_tag(tag)
{
@@ -226,13 +225,11 @@ void TagActivator::initialize()
target.endGroup();
if (tagType == QLatin1String("TagType1")) {
- qDebug() << "loading" << targetFilename << "as NfcTagType1";
NfcTagType1 *tag = new NfcTagType1;
tag->load(&target);
tagMap.insert(tag, false);
} else if (tagType == QLatin1String("TagType2")) {
- qDebug() << "loading" << targetFilename << "as NfcTagType2";
NfcTagType2 *tag = new NfcTagType2;
tag->load(&target);
@@ -277,8 +274,10 @@ void TagActivator::timerEvent(QTimerEvent *e)
*m_current = false;
+ TagBase *tag = m_current.key();
+
tagMutex.unlock();
- emit tagDeactivated(m_current.key());
+ emit tagDeactivated(tag);
tagMutex.lock();
}
@@ -289,12 +288,14 @@ void TagActivator::timerEvent(QTimerEvent *e)
if (m_current != tagMap.end()) {
*m_current = true;
- tagMutex.unlock();
+ TagBase *tag = m_current.key();
- emit tagActivated(m_current.key());
+ tagMutex.unlock();
+ emit tagActivated(tag);
tagMutex.lock();
}
tagMutex.unlock();
}
+QTNFC_END_NAMESPACE