Skip to content

Commit

Permalink
avoiding double call of dataChanged
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Dec 17, 2019
1 parent b89f1e0 commit 0755647
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 0 additions & 2 deletions python/core/auto_generated/qgsdataprovider.sip.in
Expand Up @@ -269,8 +269,6 @@ Reloads the data from the source by calling reloadProviderData() implemented
by providers with data caches to synchronize, changes in the data source, feature
counts and other specific actions.
Emits the `dataChanged` signal

.. seealso:: :py:func:`reloadProviderData`
%End

virtual QDateTime timestamp() const;
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsdataprovider.h
Expand Up @@ -360,7 +360,6 @@ class CORE_EXPORT QgsDataProvider : public QObject
* by providers with data caches to synchronize, changes in the data source, feature
* counts and other specific actions.
* Emits the `dataChanged` signal
* \see reloadProviderData()
*/
virtual void reloadData();

Expand Down
12 changes: 8 additions & 4 deletions src/providers/wfs/qgsoapifprovider.cpp
Expand Up @@ -234,6 +234,7 @@ QgsRectangle QgsOapifProvider::extent() const

void QgsOapifProvider::reloadProviderData()
{
mUpdateFeatureCountAtNextFeatureCountRequest = true;
mShared->invalidateCache();
}

Expand Down Expand Up @@ -301,13 +302,16 @@ bool QgsOapifProvider::setSubsetString( const QString &filter, bool updateFeatur
if ( !mShared->computeServerFilter( errorMsg ) )
QgsMessageLog::logMessage( errorMsg, tr( "OAPIF" ) );

reloadData();

if ( updateFeatureCount )
{
mUpdateFeatureCountAtNextFeatureCountRequest = true;
reloadData();
}
else
{
mShared->invalidateCache();
emit dataChanged();
}

emit dataChanged();

return true;
}
Expand Down
4 changes: 3 additions & 1 deletion src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -755,7 +755,9 @@ bool QgsWFSProvider::setSubsetString( const QString &theSQL, bool updateFeatureC
QString errorMsg;
if ( !mShared->computeFilter( errorMsg ) )
QgsMessageLog::logMessage( errorMsg, tr( "WFS" ) );
reloadData();


mShared->invalidateCache();
if ( updateFeatureCount )
featureCount();

Expand Down

0 comments on commit 0755647

Please sign in to comment.