diff options
author | Peter Rustler <peter.rustler@basyskom.com> | 2015-01-14 17:01:49 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-02-02 08:01:48 +0000 |
commit | 907f7b906dd0ed37620a221f8327f3ce49e5a594 (patch) | |
tree | 0ee03709d77287c8515cb6cb0c04351ae947ef72 /src | |
parent | 7f1f193529f464c6a99aebab1b41821159b02cff (diff) |
Insert newIntent listener if it is not already in list, only
The listener of the nfc intents will not be inserted into
the listener list if it is already in.
Change-Id: I572768cccdbd02c49966e5d399e9a3df6903d15b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/nfc/android/androidmainnewintentlistener.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nfc/android/androidmainnewintentlistener.cpp b/src/nfc/android/androidmainnewintentlistener.cpp index 9146f70e..d27dac18 100644 --- a/src/nfc/android/androidmainnewintentlistener.cpp +++ b/src/nfc/android/androidmainnewintentlistener.cpp @@ -71,7 +71,8 @@ bool MainNfcNewIntentListener::handleNewIntent(JNIEnv *env, jobject intent) bool MainNfcNewIntentListener::registerListener(AndroidNfcListenerInterface *listener) { listenersLock.lockForWrite(); - listeners.push_back(listener); + if (!listeners.contains(listener)) + listeners.push_back(listener); listenersLock.unlock(); return true; } |