summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-09-29 14:29:05 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-10 07:47:58 +0200
commit9fa6e8f627d0c61fd5a3b993903a362dc04bf707 (patch)
tree56858ef0994ef4b300d5f6928fa51b0844bf1861 /src/testlib
parent33233ca3e3d79152744eedd353106c5d95737e00 (diff)
Clean-up a macro for Cocoa
Remove the usage of Q_MAC_USE_COCOA and Carbon code paths. Change-Id: Ib569ad8c6d9ffe258f454b3c3b06e95294a10112 Reviewed-on: http://codereview.qt-project.org/5100 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Sanity-Review: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestcase.cpp14
-rw-r--r--src/testlib/qtestmouse.h4
2 files changed, 4 insertions, 14 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 1178b50ee4..41bdd9b62a 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -78,11 +78,7 @@
#ifdef Q_WS_MAC
#include <Carbon/Carbon.h> // for SetFrontProcess
-#ifdef QT_MAC_USE_COCOA
#include <IOKit/pwr_mgt/IOPMLib.h>
-#else
-#include <Security/AuthSession.h>
-#endif
#undef verify
#endif
@@ -1797,10 +1793,8 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
#ifdef Q_WS_MAC
bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0);
-#ifdef QT_MAC_USE_COCOA
IOPMAssertionID powerID;
#endif
-#endif
#ifndef QT_NO_EXCEPTIONS
try {
#endif
@@ -1816,13 +1810,9 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
if (macNeedsActivate) {
ProcessSerialNumber psn = { 0, kCurrentProcess };
SetFrontProcess(&psn);
-#ifdef QT_MAC_USE_COCOA
IOReturn ok = IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &powerID);
if (ok != kIOReturnSuccess)
macNeedsActivate = false; // no need to release the assertion on exit.
-#else
- UpdateSystemActivity(1); // Wake the display.
-#endif
}
#endif
@@ -1873,7 +1863,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
}
QTestLog::stopLogging();
-#ifdef QT_MAC_USE_COCOA
+#ifdef Q_WS_MAC
if (macNeedsActivate) {
IOPMAssertionRelease(powerID);
}
@@ -1887,7 +1877,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
#endif
currentTestObject = 0;
-#ifdef QT_MAC_USE_COCOA
+#ifdef Q_WS_MAC
if (macNeedsActivate) {
IOPMAssertionRelease(powerID);
}
diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h
index dd6d632505..7a928a0693 100644
--- a/src/testlib/qtestmouse.h
+++ b/src/testlib/qtestmouse.h
@@ -117,7 +117,7 @@ namespace QTest
case MouseMove:
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),lastButton);
//QCursor::setPos(window->mapToGlobal(pos));
-#ifdef QT_MAC_USE_COCOA
+#ifdef Q_OS_MAC
QTest::qWait(20);
#else
qApp->processEvents();
@@ -183,7 +183,7 @@ namespace QTest
break;
case MouseMove:
QCursor::setPos(widget->mapToGlobal(pos));
-#ifdef QT_MAC_USE_COCOA
+#ifdef Q_OS_MAC
QTest::qWait(20);
#else
qApp->processEvents();