diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-11-26 16:01:29 +0100 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-11-26 16:06:09 +0100 |
commit | f7d66442963e1380a4f2db3d24cb24aa9d5c63ad (patch) | |
tree | 3dd40149263a2f8b5a842205a4545b61f2d31f9c /src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp | |
parent | 71abe300263d9f6bcd6e061e889a58111c48f92a (diff) |
Make the openKODE use the new eventloopintegration api.
And also make it work with the new GL functionality in Lighthouse
Diffstat (limited to 'src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp')
-rw-r--r-- | src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp b/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp index 73d874c97e..aefabf0907 100644 --- a/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp +++ b/src/plugins/platforms/openkode/qopenkodeeventloopintegration.cpp @@ -79,7 +79,7 @@ void kdprocessevent( const KDEvent *event) qDebug() << "KD_EVENT_INPUT_KEY_ATX"; break; case QT_EVENT_WAKEUP_EVENTLOOP: -// qDebug() << "QT_EVENT_WAKEUP_EVENTLOOP"; + QPlatformEventLoopIntegration::processEvents(); break; default: break; @@ -90,25 +90,34 @@ void kdprocessevent( const KDEvent *event) } QOpenKODEEventLoopIntegration::QOpenKODEEventLoopIntegration() + : m_quit(false) { m_kdThread = kdThreadSelf(); kdInstallCallback(&kdprocessevent,QT_EVENT_WAKEUP_EVENTLOOP,this); } -void QOpenKODEEventLoopIntegration::processEvents(qint64 msec) +void QOpenKODEEventLoopIntegration::startEventLoop() { - if (msec == 0) - msec = -1; - const KDEvent *event = kdWaitEvent(msec*1000); - if (event) { - kdDefaultEvent(event); - while ((event = kdWaitEvent(0)) != 0) { + + while(!m_quit) { + qint64 msec = nextTimerEvent(); + const KDEvent *event = kdWaitEvent(msec); + if (event) { kdDefaultEvent(event); + while ((event = kdWaitEvent(0)) != 0) { + kdDefaultEvent(event); + } } + QPlatformEventLoopIntegration::processEvents(); } } -void QOpenKODEEventLoopIntegration::wakeup() +void QOpenKODEEventLoopIntegration::quitEventLoop() +{ + m_quit = true; +} + +void QOpenKODEEventLoopIntegration::qtNeedsToProcessEvents() { KDEvent *event = kdCreateEvent(); event->type = QT_EVENT_WAKEUP_EVENTLOOP; |