Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Also forward proxyAuthentication and sslErrors to main thread
  • Loading branch information
m-kuhn committed Jun 14, 2018
1 parent 6dd3529 commit 478d6d0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/providers/wfs/qgswfsrequest.cpp
Expand Up @@ -158,7 +158,7 @@ bool QgsWfsRequest::sendGET( const QUrl &url, bool synchronous, bool forceRefres

if ( synchronous )
{
connect( QgsNetworkAccessManager::instance(), &QgsNetworkAccessManager::authenticationRequired, this, [&waitConditionMutex, &waitCondition]()
auto resumeMainThread = [&waitConditionMutex, &waitCondition]()
{
waitConditionMutex.lock();
waitCondition.wakeAll();
Expand All @@ -167,8 +167,14 @@ bool QgsWfsRequest::sendGET( const QUrl &url, bool synchronous, bool forceRefres
waitConditionMutex.lock();
waitCondition.wait( &waitConditionMutex );
waitConditionMutex.unlock();
}, Qt::DirectConnection
);
};

connect( QgsNetworkAccessManager::instance(), &QgsNetworkAccessManager::authenticationRequired, this, resumeMainThread, Qt::DirectConnection );
connect( QgsNetworkAccessManager::instance(), &QgsNetworkAccessManager::proxyAuthenticationRequired, this, resumeMainThread, Qt::DirectConnection );

#ifndef QT_NO_SSL
connect( QgsNetworkAccessManager::instance(), &QgsNetworkAccessManager::sslErrors, this, resumeMainThread, Qt::DirectConnection );
#endif
QEventLoop loop;
connect( this, &QgsWfsRequest::downloadFinished, &loop, &QEventLoop::quit, Qt::DirectConnection );
loop.exec();
Expand Down

0 comments on commit 478d6d0

Please sign in to comment.