Revert "Simplify KDE4 yielding."
This reverts commit 20f029c653.
The native X11 and gtk+ backends both have this functionality,
and both with a hard-coded 100, and the gtk+ one has had active
maintenance and testing. I'd like to leave that there, I suspect
it is used in some obscure multi-threaded corner-case where we
want to process events but only a few of them.
This commit is contained in:
@@ -329,16 +329,20 @@ void KDEXLib::Yield( 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 )
|
||||
void KDEXLib::processYield( bool bWait, bool bHandleAllCurrentEvents )
|
||||
{
|
||||
QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance( qApp->thread() );
|
||||
|
||||
if ( bWait )
|
||||
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 )
|
||||
dispatcher->processEvents( QEventLoop::WaitForMoreEvents );
|
||||
else
|
||||
dispatcher->processEvents( QEventLoop::AllEvents );
|
||||
}
|
||||
|
||||
void KDEXLib::StartTimer( sal_uLong nMS )
|
||||
|
||||
Reference in New Issue
Block a user