iOS: Don't use IOKit in QTestLib, it's a private framework on iOS

Change-Id: I271a480b79c7768942911a28c84d6bb5a8d840d3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This commit is contained in:
Tor Arne Vestbø 2012-11-14 14:54:13 +01:00
parent e71ca36161
commit d8b3465dd3

View File

@ -82,7 +82,7 @@
#include <time.h> #include <time.h>
#endif #endif
#ifdef Q_OS_MAC #if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
#include <IOKit/pwr_mgt/IOPMLib.h> #include <IOKit/pwr_mgt/IOPMLib.h>
#endif #endif
@ -2078,7 +2078,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
int callgrindChildExitCode = 0; int callgrindChildExitCode = 0;
#endif #endif
#ifdef Q_OS_MAC #if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0); bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0);
IOPMAssertionID powerID; IOPMAssertionID powerID;
#endif #endif
@ -2093,7 +2093,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX); SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
#endif #endif
#ifdef Q_OS_MAC #if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
if (macNeedsActivate) { if (macNeedsActivate) {
CFStringRef reasonForActivity= CFSTR("No Display Sleep"); CFStringRef reasonForActivity= CFSTR("No Display Sleep");
IOReturn ok = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &powerID); IOReturn ok = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &powerID);
@ -2146,7 +2146,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
} }
QTestLog::stopLogging(); QTestLog::stopLogging();
#ifdef Q_OS_MAC #if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
if (macNeedsActivate) { if (macNeedsActivate) {
IOPMAssertionRelease(powerID); IOPMAssertionRelease(powerID);
} }
@ -2163,7 +2163,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
QSignalDumper::endDump(); QSignalDumper::endDump();
#ifdef Q_OS_MAC #if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
if (macNeedsActivate) { if (macNeedsActivate) {
IOPMAssertionRelease(powerID); IOPMAssertionRelease(powerID);
} }