diff options
author | Christian Strømme <christian.stromme@digia.com> | 2014-04-07 15:13:42 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-09 16:13:38 +0200 |
commit | 8a047ef087cebba5953ad3ed7b2d99df7966b695 (patch) | |
tree | 717d97640f1fe73f982975b9fcdea4e36b14b836 /src/plugins/android | |
parent | 03672d570dc06ed0439c8ab3d31506f53d38f31a (diff) | |
download | qtmultimedia-8a047ef087cebba5953ad3ed7b2d99df7966b695.tar.gz qtmultimedia-8a047ef087cebba5953ad3ed7b2d99df7966b695.tar.bz2 qtmultimedia-8a047ef087cebba5953ad3ed7b2d99df7966b695.zip |
Android: Use Q_GLOBAL_STATIC instead of a static QMap
Change-Id: I7b65e0874051c4ef504914a0bd66e8471ec34fa7
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/plugins/android')
-rw-r--r-- | src/plugins/android/src/wrappers/jmediarecorder.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/android/src/wrappers/jmediarecorder.cpp b/src/plugins/android/src/wrappers/jmediarecorder.cpp index 81d5c114..0b1498d9 100644 --- a/src/plugins/android/src/wrappers/jmediarecorder.cpp +++ b/src/plugins/android/src/wrappers/jmediarecorder.cpp @@ -48,18 +48,19 @@ QT_BEGIN_NAMESPACE static jclass g_qtMediaRecorderListenerClass = 0; -static QMap<jlong, JMediaRecorder*> g_objectMap; +typedef QMap<jlong, JMediaRecorder*> MediaRecorderMap; +Q_GLOBAL_STATIC(MediaRecorderMap, mediaRecorders) static void notifyError(JNIEnv* , jobject, jlong id, jint what, jint extra) { - JMediaRecorder *obj = g_objectMap.value(id, 0); + JMediaRecorder *obj = mediaRecorders->value(id, 0); if (obj) emit obj->error(what, extra); } static void notifyInfo(JNIEnv* , jobject, jlong id, jint what, jint extra) { - JMediaRecorder *obj = g_objectMap.value(id, 0); + JMediaRecorder *obj = mediaRecorders->value(id, 0); if (obj) emit obj->info(what, extra); } @@ -77,13 +78,13 @@ JMediaRecorder::JMediaRecorder() m_mediaRecorder.callMethod<void>("setOnInfoListener", "(Landroid/media/MediaRecorder$OnInfoListener;)V", listener.object()); - g_objectMap.insert(m_id, this); + mediaRecorders->insert(m_id, this); } } JMediaRecorder::~JMediaRecorder() { - g_objectMap.remove(m_id); + mediaRecorders->remove(m_id); } void JMediaRecorder::release() |