Navigation Menu

Skip to content

Commit

Permalink
Don't use an event loop to wait for task starting
Browse files Browse the repository at this point in the history
This is already handled in a MUCH nicer way by QgsTask::waitForFinished
(mutex based, not eventloop based)
  • Loading branch information
nyalldawson committed Mar 18, 2020
1 parent dd5928c commit e6344c1
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/core/qgsabstractcontentcache.h
Expand Up @@ -458,15 +458,6 @@ class CORE_EXPORT QgsAbstractContentCache : public QgsAbstractContentCacheBase
*/
bool waitForTaskFinished( QgsNetworkContentFetcherTask *task ) const
{
// First step, waiting for task running
if ( task->status() != QgsTask::Running )
{
QEventLoop loop;
connect( task, &QgsNetworkContentFetcherTask::begun, &loop, &QEventLoop::quit );
if ( task->status() != QgsTask::Running )
loop.exec();
}

// Second step, wait 5 seconds for task finished
if ( task->waitForFinished( 5000 ) )
{
Expand Down

0 comments on commit e6344c1

Please sign in to comment.