fix android test

This commit is contained in:
doitux
2012-12-22 00:18:54 +01:00
parent 2b1543a453
commit 8ffa29b34a
2 changed files with 13 additions and 10 deletions
+1
View File
@@ -656,4 +656,5 @@ maemo{
android_test{ android_test{
DEFINES += ANDROID DEFINES += ANDROID
DEFINES += ANDROID_TEST
} }
+3 -1
View File
@@ -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)));