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>
This commit is contained in:
committed by
Thorsten Behrens
parent
13a34f4c63
commit
20f029c653
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user