fixed compilation of QZXingLive for platforms other than Android

This commit is contained in:
favoritas37 2017-03-16 16:26:48 +02:00
parent a69cd45ac6
commit f581e879de
3 changed files with 12 additions and 9 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@ debug/
.gradle .gradle
.idea .idea
.build .build
.obj

View File

@ -12,10 +12,12 @@ CONFIG(debug, debug|release) {
} }
HEADERS += \ HEADERS += \
application.h application.h \
native.h
SOURCES += main.cpp \ SOURCES += main.cpp \
application.cpp application.cpp \
native.cpp
RESOURCES += qml.qrc RESOURCES += qml.qrc
@ -30,12 +32,6 @@ include(deployment.pri)
android { android {
QT += androidextras QT += androidextras
HEADERS += \
native.h
SOURCES += \
native.cpp
DISTFILES += \ DISTFILES += \
android/AndroidManifest.xml \ android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \ android/gradle/wrapper/gradle-wrapper.jar \

View File

@ -1,9 +1,13 @@
#if defined(Q_OS_ANDROID)
#include <jni.h> #include <jni.h>
#endif //Q_OS_ANDROID
#include "native.h" #include "native.h"
#include <QMetaObject> #include <QMetaObject>
QObject *NativeHelpers::application_p_ = 0; QObject *NativeHelpers::application_p_ = 0;
#if defined(Q_OS_ANDROID)
// define our native static functions // define our native static functions
// these are the functions that Java part will call directly from Android UI thread // these are the functions that Java part will call directly from Android UI thread
static void onPermissionsGranted(JNIEnv * /*env*/, jobject /*obj*/) static void onPermissionsGranted(JNIEnv * /*env*/, jobject /*obj*/)
@ -45,3 +49,5 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/)
return JNI_VERSION_1_6; return JNI_VERSION_1_6;
} }
#endif // Q_OS_ANDROID