Skip to content

Commit

Permalink
Parse capabilities immediately
Browse files Browse the repository at this point in the history
... even when the request is sent in a different thread.
  • Loading branch information
m-kuhn committed Jun 14, 2018
1 parent bdcd876 commit 666a0e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/wfs/qgswfscapabilities.cpp
Expand Up @@ -30,7 +30,11 @@
QgsWfsCapabilities::QgsWfsCapabilities( const QString &uri )
: QgsWfsRequest( QgsWFSDataSourceURI( uri ) )
{
connect( this, &QgsWfsRequest::downloadFinished, this, &QgsWfsCapabilities::capabilitiesReplyFinished );
// Using Qt::DirectConnection since the download might be running on a different thread.
// In this case, the request was sent from the main thread and is executed with the main
// thread being blocked in future.waitForFinished() so we can run code on this object which
// lives in the main thread without risking havoc.
connect( this, &QgsWfsRequest::downloadFinished, this, &QgsWfsCapabilities::capabilitiesReplyFinished, Qt::DirectConnection );
}

bool QgsWfsCapabilities::requestCapabilities( bool synchronous, bool forceRefresh )
Expand Down

0 comments on commit 666a0e9

Please sign in to comment.