fix android test
This commit is contained in:
@@ -656,4 +656,5 @@ maemo{
|
|||||||
|
|
||||||
android_test{
|
android_test{
|
||||||
DEFINES += ANDROID
|
DEFINES += ANDROID
|
||||||
|
DEFINES += ANDROID_TEST
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,9 +74,10 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
|
int api = -2;
|
||||||
|
#ifndef ANDROID_TEST
|
||||||
JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0);
|
JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0);
|
||||||
JNIEnv* env;
|
JNIEnv* env;
|
||||||
int api = -2;
|
|
||||||
if (currVM->AttachCurrentThread(&env, NULL)<0) {
|
if (currVM->AttachCurrentThread(&env, NULL)<0) {
|
||||||
qCritical()<<"AttachCurrentThread failed";
|
qCritical()<<"AttachCurrentThread failed";
|
||||||
} else {
|
} else {
|
||||||
@@ -86,6 +87,7 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
|||||||
}
|
}
|
||||||
currVM->DetachCurrentThread();
|
currVM->DetachCurrentThread();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
label_pokerthVersion->setText(QString(tr("PokerTH %1 for Android (API%2)").arg(POKERTH_BETA_RELEASE_STRING).arg(api)));
|
label_pokerthVersion->setText(QString(tr("PokerTH %1 for Android (API%2)").arg(POKERTH_BETA_RELEASE_STRING).arg(api)));
|
||||||
#else
|
#else
|
||||||
label_pokerthVersion->setText(QString(tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING)));
|
label_pokerthVersion->setText(QString(tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING)));
|
||||||
|
|||||||
Reference in New Issue
Block a user