Skip to content

Commit

Permalink
WFS provider: use QApplication instead of QgsApplication for use in s…
Browse files Browse the repository at this point in the history
…tandalone applications
  • Loading branch information
github-actions[bot] authored and nyalldawson committed Nov 19, 2020
1 parent 2d3c9a3 commit 3fbd7ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/providers/wfs/qgsbackgroundcachedfeatureiterator.cpp
Expand Up @@ -766,7 +766,7 @@ bool QgsBackgroundCachedFeatureIterator::fetchFeature( QgsFeature &f )
mWaitCond.wait( &mMutex, timeout );
if ( requestMadeFromMainThread && mProcessEvents )
{
QgsApplication::instance()->processEvents();
QApplication::instance()->processEvents();
mProcessEvents = false;
}
if ( mInterruptionChecker && mInterruptionChecker->isCanceled() )
Expand Down
4 changes: 2 additions & 2 deletions src/providers/wfs/qgsbasenetworkrequest.cpp
Expand Up @@ -153,7 +153,7 @@ bool QgsBaseNetworkRequest::sendGET( const QUrl &url, const QString &acceptHeade

std::function<void()> downloaderFunction = [ this, request, synchronous, &waitConditionMutex, &waitCondition, &threadFinished, &success ]()
{
if ( QThread::currentThread() != QgsApplication::instance()->thread() )
if ( QThread::currentThread() != QApplication::instance()->thread() )
QgsNetworkAccessManager::instance( Qt::DirectConnection );

success = true;
Expand Down Expand Up @@ -229,7 +229,7 @@ bool QgsBaseNetworkRequest::sendGET( const QUrl &url, const QString &acceptHeade
{
waitConditionMutex.unlock();

QgsApplication::instance()->processEvents();
QApplication::instance()->processEvents();
// we don't need to wake up the worker thread - it will automatically be woken when
// the auth request has been dealt with by QgsNetworkAccessManager
}
Expand Down
4 changes: 2 additions & 2 deletions src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -16,7 +16,6 @@
***************************************************************************/

#include "qgis.h"
#include "qgsapplication.h"
#include "qgsfeature.h"
#include "qgsfields.h"
#include "qgsgeometry.h"
Expand All @@ -36,6 +35,7 @@
#include "qgswfsutils.h"
#include "qgssettings.h"

#include <QApplication>
#include <QDomDocument>
#include <QMessageBox>
#include <QDomNodeList>
Expand Down Expand Up @@ -131,7 +131,7 @@ QgsWFSProvider::QgsWFSProvider( const QString &uri, const ProviderOptions &optio
{
auto processEvents = []()
{
QgsApplication::instance()->processEvents();
QApplication::instance()->processEvents();
};
connect( downloader.get(), &QgsFeatureDownloader::resumeMainThread,
this, processEvents );
Expand Down

0 comments on commit 3fbd7ac

Please sign in to comment.