[Libreoffice-commits] core.git: vcl/unx

Jan-Marek Glogowski glogow at fbihome.de
Wed Nov 20 05:27:44 PST 2013


 vcl/unx/kde4/KDEXLib.cxx |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

New commits:
commit 20f029c653abbd7578ceee968065f4c5d66f375f
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Fri Nov 15 14:51:09 2013 +0100

    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 at documentfoundation.org>
    Tested-by: Thorsten Behrens <thb at documentfoundation.org>

diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 67d7a4d..28dbd5d 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 )


More information about the Libreoffice-commits mailing list