Skip to content
Permalink
Browse files

Don't use an event loop to wait for task starting

This is already handled in a MUCH nicer way by QgsTask::waitForFinished
(mutex based, not eventloop based)
  • Loading branch information
nyalldawson authored and rldhont committed May 21, 2020
1 parent ed4a14e commit c52a0ba62c7d45e82f82a1bf7e0ffaf3b77ff95b
Showing with 0 additions and 9 deletions.
  1. +0 −9 src/core/qgsabstractcontentcache.h
@@ -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 ) )
{

0 comments on commit c52a0ba

Please sign in to comment.
You can’t perform that action at this time.