summaryrefslogtreecommitdiffstats
path: root/vcl/unx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2013-11-15 14:51:09 +0100
committerThorsten Behrens <thb@documentfoundation.org>2013-11-20 07:27:20 -0600
commit20f029c653abbd7578ceee968065f4c5d66f375f (patch)
treeb791e060e14a1595a8ae9a1791c542169bc5cbf4 /vcl/unx
parentRewrite Qt4 based nested yield mutex locking. (diff)
downloadcore-20f029c653abbd7578ceee968065f4c5d66f375f.tar.gz
core-20f029c653abbd7578ceee968065f4c5d66f375f.zip
Simplify KDE4 yielding.
QAbstractEventDispatcher::processEvents always processes all pending events, so we can ignore the the second Yield parameter (bHandleAllCurrentEvents). Change-Id: I49a70ed13d0215b89f48eed93d78eef2f083dc0d Reviewed-on: https://gerrit.libreoffice.org/6686 Reviewed-by: Thorsten Behrens <thb@documentfoundation.org> Tested-by: Thorsten Behrens <thb@documentfoundation.org>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx20
1 files changed, 8 insertions, 12 deletions
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 67d7a4d4f31e..28dbd5d63b99 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -329,20 +329,16 @@ void KDEXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
}
}
-void KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents )
+// Qts processEvent always processes all pending events,
+// so we can ignore the second parameter 'bHandleAllCurrentEvents'.
+void KDEXLib::processYield( bool bWait, bool )
{
- QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance( qApp->thread());
- bool wasEvent = false;
- for( int cnt = bHandleAllCurrentEvents ? 100 : 1;
- cnt > 0;
- --cnt )
- {
- if( !dispatcher->processEvents( QEventLoop::AllEvents ))
- break;
- wasEvent = true;
- }
- if( bWait && !wasEvent )
+ QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance( qApp->thread() );
+
+ if ( bWait )
dispatcher->processEvents( QEventLoop::WaitForMoreEvents );
+ else
+ dispatcher->processEvents( QEventLoop::AllEvents );
}
void KDEXLib::StartTimer( sal_uLong nMS )