Skip to content

Commit bdcd876

Browse files
committed
Add comment to explain the nasty details
1 parent 143ee82 commit bdcd876

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/providers/wfs/qgswfsrequest.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ bool QgsWfsRequest::sendGET( const QUrl &url, bool synchronous, bool forceRefres
133133
bool success = true;
134134
mReply = QgsNetworkAccessManager::instance()->get( request );
135135

136-
Q_ASSERT( QThread::currentThread() == mReply->thread() );
137-
138136
mReply->setReadBufferSize( READ_BUFFER_SIZE_HINT );
139137
if ( !mUri.auth().setAuthorizationReply( mReply ) )
140138
{
@@ -145,6 +143,9 @@ bool QgsWfsRequest::sendGET( const QUrl &url, bool synchronous, bool forceRefres
145143
}
146144
else
147145
{
146+
// We are able to use direct connection here, because we
147+
// * either run on the thread mReply lives in, so DirectConnection is standard and safe anyway (if it is not the main thread)
148+
// * or the owner thread of mReply is currently not doing anything because it's blocked in future.waitForFinished() (if it is the main thread)
148149
connect( mReply, &QNetworkReply::finished, this, &QgsWfsRequest::replyFinished, Qt::DirectConnection );
149150
connect( mReply, &QNetworkReply::downloadProgress, this, &QgsWfsRequest::replyProgress, Qt::DirectConnection );
150151

0 commit comments

Comments
 (0)