Skip to content

Commit 666a0e9

Browse files
committed
Parse capabilities immediately
... even when the request is sent in a different thread.
1 parent bdcd876 commit 666a0e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/providers/wfs/qgswfscapabilities.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
QgsWfsCapabilities::QgsWfsCapabilities( const QString &uri )
3131
: QgsWfsRequest( QgsWFSDataSourceURI( uri ) )
3232
{
33-
connect( this, &QgsWfsRequest::downloadFinished, this, &QgsWfsCapabilities::capabilitiesReplyFinished );
33+
// Using Qt::DirectConnection since the download might be running on a different thread.
34+
// In this case, the request was sent from the main thread and is executed with the main
35+
// thread being blocked in future.waitForFinished() so we can run code on this object which
36+
// lives in the main thread without risking havoc.
37+
connect( this, &QgsWfsRequest::downloadFinished, this, &QgsWfsCapabilities::capabilitiesReplyFinished, Qt::DirectConnection );
3438
}
3539

3640
bool QgsWfsCapabilities::requestCapabilities( bool synchronous, bool forceRefresh )

0 commit comments

Comments
 (0)