Skip to content
Permalink
Browse files

Also forward proxyAuthentication and sslErrors to main thread

  • Loading branch information
m-kuhn committed Jun 14, 2018
1 parent 6dd3529 commit 478d6d0880b726d1eac164176d10a338b17ca776
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/providers/wfs/qgswfsrequest.cpp
@@ -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();
@@ -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();

0 comments on commit 478d6d0

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