summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qjnienvironment.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2023-10-19 20:56:32 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-10-21 00:55:04 +0200
commitf1c2a24255ce66a6866d41bf7677ba00dfb50e86 (patch)
tree368a5282ba0c5824f30b3697ebc8eec4894427c1 /src/corelib/kernel/qjnienvironment.cpp
parent8cf199077fa3f443fe94d2cb6c8a57efd6ff7869 (diff)
JNI: clean up QJniEnvironment a bit
Remove superfluous explicit function prototypes in documentation, and remove the unused QJniScopedLocalRefPrivate specialization of QScopedPointer<_jobject>. Change-Id: I6407522746bc9756cdaceea8e0e0a32d0830eeee Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/corelib/kernel/qjnienvironment.cpp')
-rw-r--r--src/corelib/kernel/qjnienvironment.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/corelib/kernel/qjnienvironment.cpp b/src/corelib/kernel/qjnienvironment.cpp
index 7fda44a21e..97c5584ea2 100644
--- a/src/corelib/kernel/qjnienvironment.cpp
+++ b/src/corelib/kernel/qjnienvironment.cpp
@@ -46,29 +46,10 @@ public:
}
};
-struct QJniLocalRefDeleterPrivate
-{
- static void cleanup(jobject obj)
- {
- if (!obj)
- return;
-
- QJniEnvironment env;
- env->DeleteLocalRef(obj);
- }
-};
-
-// To simplify this we only define it for jobjects.
-typedef QScopedPointer<_jobject, QJniLocalRefDeleterPrivate> QJniScopedLocalRefPrivate;
-
-
Q_GLOBAL_STATIC(QThreadStorage<QJniEnvironmentPrivateTLS *>, jniEnvTLS)
-
/*!
- \fn QJniEnvironment::QJniEnvironment()
-
Constructs a new JNI Environment object and attaches the current thread to the Java VM.
*/
QJniEnvironment::QJniEnvironment()
@@ -111,8 +92,6 @@ bool QJniEnvironment::isValid() const
}
/*!
- \fn JNIEnv *QJniEnvironment::operator->() const
-
Provides access to the JNI Environment's \c JNIEnv pointer.
*/
JNIEnv *QJniEnvironment::operator->() const
@@ -121,8 +100,6 @@ JNIEnv *QJniEnvironment::operator->() const
}
/*!
- \fn JNIEnv &QJniEnvironment::operator*() const
-
Returns the JNI Environment's \c JNIEnv object.
*/
JNIEnv &QJniEnvironment::operator*() const
@@ -131,8 +108,6 @@ JNIEnv &QJniEnvironment::operator*() const
}
/*!
- \fn JNIEnv *QJniEnvironment::jniEnv() const
-
Returns the JNI Environment's \c JNIEnv pointer.
*/
JNIEnv *QJniEnvironment::jniEnv() const
@@ -323,8 +298,6 @@ jfieldID QJniEnvironment::findStaticField(jclass clazz, const char *fieldName, c
*/
/*!
- \fn JavaVM *QJniEnvironment::javaVM()
-
Returns the Java VM interface for the current process. Although it might
be possible to have multiple Java VMs per process, Android allows only one.
@@ -448,7 +421,7 @@ bool QJniEnvironment::checkAndClearExceptions(QJniEnvironment::OutputMode output
namespace {
// Any pending exception need to be cleared before calling this
- QString exceptionMessage(JNIEnv *env, const jthrowable &exception)
+ QString exceptionMessage(JNIEnv *env, jthrowable exception)
{
if (!exception)
return {};
@@ -496,8 +469,6 @@ namespace {
} // end namespace
/*!
- \fn QJniEnvironment::checkAndClearExceptions(JNIEnv *env, OutputMode outputMode = OutputMode::Verbose)
-
Cleans any pending exceptions for \a env, either silently or reporting
stack backtrace, depending on the \a outputMode. This is useful when you
already have a \c JNIEnv pointer such as in a native function implementation.