JNI: pass same QJniEnvironment object to QAndroidPlatformClipboard
... registerNatives() call. Change-Id: I42539846249880ed4a215522bdcafb3a2ffa4d14 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
bc8f0911a9
commit
742f45f7cf
@ -947,7 +947,7 @@ Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void */*reserved*/)
|
||||
|| !QtAndroidMenu::registerNatives(env)
|
||||
|| !QtAndroidAccessibility::registerNatives(env)
|
||||
|| !QtAndroidDialogHelpers::registerNatives(env)
|
||||
|| !QAndroidPlatformClipboard::registerNatives()) {
|
||||
|| !QAndroidPlatformClipboard::registerNatives(env)) {
|
||||
__android_log_print(ANDROID_LOG_FATAL, "Qt", "registerNatives failed");
|
||||
return -1;
|
||||
}
|
||||
|
@ -106,9 +106,8 @@ bool QAndroidPlatformClipboard::supportsMode(QClipboard::Mode mode) const
|
||||
return QClipboard::Clipboard == mode;
|
||||
}
|
||||
|
||||
bool QAndroidPlatformClipboard::registerNatives()
|
||||
bool QAndroidPlatformClipboard::registerNatives(QJniEnvironment &env)
|
||||
{
|
||||
QJniEnvironment env;
|
||||
bool success = env.registerNativeMethods(Traits<QtClipboardManager>::className(),
|
||||
{ Q_JNI_NATIVE_SCOPED_METHOD(onClipboardDataChanged, QAndroidPlatformClipboard) });
|
||||
if (!success) {
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override;
|
||||
bool supportsMode(QClipboard::Mode mode) const override;
|
||||
|
||||
static bool registerNatives();
|
||||
static bool registerNatives(QJniEnvironment &env);
|
||||
|
||||
private:
|
||||
QMimeData *getClipboardMimeData();
|
||||
|
Loading…
Reference in New Issue
Block a user