#include <time.h>
#endif
-#ifdef Q_WS_MAC
-#include <Carbon/Carbon.h> // for SetFrontProcess
+#ifdef Q_OS_MAC
#include <IOKit/pwr_mgt/IOPMLib.h>
-#undef verify
#endif
QT_BEGIN_NAMESPACE
int callgrindChildExitCode = 0;
#endif
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0);
IOPMAssertionID powerID;
#endif
SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
#endif
-#ifdef Q_WS_MAC
- // Starting with Qt 4.4, applications launched from the command line
- // no longer get focus automatically. Since some tests might depend
- // on this, call SetFrontProcess here to get the pre 4.4 behavior.
+#ifdef Q_OS_MAC
if (macNeedsActivate) {
- ProcessSerialNumber psn = { 0, kCurrentProcess };
- SetFrontProcess(&psn);
- IOReturn ok = IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &powerID);
+ CFStringRef reasonForActivity= CFSTR("No Display Sleep");
+ IOReturn ok = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &powerID);
+
if (ok != kIOReturnSuccess)
macNeedsActivate = false; // no need to release the assertion on exit.
}
}
QTestLog::stopLogging();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
if (macNeedsActivate) {
IOPMAssertionRelease(powerID);
}
QSignalDumper::endDump();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
if (macNeedsActivate) {
IOPMAssertionRelease(powerID);
}
mac {
LIBS += -framework IOKit -framework Security
!ios {
- LIBS_PRIVATE += -framework CoreServices
LIBS += -framework ApplicationServices
- } else {
- LIBS_PRIVATE += -framework CoreFoundation
}
}