summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qjnienvironment.h
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2021-05-06 17:18:31 +0300
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2021-06-02 08:20:17 +0000
commit78ed8034d24a4914c01546db188aa4832c71d551 (patch)
treed0f53ae5fd97642bb6c5f92b77ca4014d13e99a3 /src/corelib/kernel/qjnienvironment.h
parent6d72896d0c09717c92fa1efb4dd48f372096753d (diff)
Add a const JNINativeMethod[] overload for registerNativeMethods()
The JNI interface expects a const JNINativeMethod[] and our wrapper takes a non-const. Also, this was causing refactoring of exisisting code with a const JNINativeMethod[] to fail because the call expects a non-const. Change-Id: If790c401650cb33fe31f93bafe41aab7714488e9 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/kernel/qjnienvironment.h')
-rw-r--r--src/corelib/kernel/qjnienvironment.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/kernel/qjnienvironment.h b/src/corelib/kernel/qjnienvironment.h
index c98a1d39ed..610dd054fe 100644
--- a/src/corelib/kernel/qjnienvironment.h
+++ b/src/corelib/kernel/qjnienvironment.h
@@ -62,8 +62,14 @@ public:
jmethodID findMethod(jclass clazz, const char *methodName, const char *signature);
jmethodID findStaticMethod(jclass clazz, const char *methodName, const char *signature);
static JavaVM *javaVM();
+ bool registerNativeMethods(const char *className, const JNINativeMethod methods[], int size);
+ bool registerNativeMethods(jclass clazz, const JNINativeMethod methods[], int size);
+
+#if QT_DEPRECATED_SINCE(6, 2)
+ // ### Qt 7: remove
+ QT_DEPRECATED_VERSION_X_6_2("Use the overload with a const JNINativeMethod[] instead.")
bool registerNativeMethods(const char *className, JNINativeMethod methods[], int size);
- bool registerNativeMethods(jclass clazz, JNINativeMethod methods[], int size);
+#endif
enum class OutputMode {
Silent,