Skip to content

Commit

Permalink
fixed small misunderstood
Browse files Browse the repository at this point in the history
  • Loading branch information
MorriganR authored and nyalldawson committed May 5, 2021
1 parent dcf2049 commit a69199c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -2019,18 +2019,18 @@ void QgsMapLayer::setRefreshOnNotifyEnabled( bool enabled )
{
QgsDataProvider *lDataProvider = dataProvider();

if ( !lDataProvider || !lDataProvider->isValid() || !( providerType() == QStringLiteral("postgres") ) )
if ( !lDataProvider || !lDataProvider->isValid() )
return;

if ( enabled && !isRefreshOnNotifyEnabled() )
{
lDataProvider->setListening( enabled );
connect( lDataProvider, &QgsVectorDataProvider::notify, this, &QgsMapLayer::onNotified );
connect( lDataProvider, &QgsDataProvider::notify, this, &QgsMapLayer::onNotified );
}
else if ( !enabled && isRefreshOnNotifyEnabled() )
{
// we don't want to disable provider listening because someone else could need it (e.g. actions)
disconnect( lDataProvider, &QgsVectorDataProvider::notify, this, &QgsMapLayer::onNotified );
disconnect( lDataProvider, &QgsDataProvider::notify, this, &QgsMapLayer::onNotified );
}
mIsRefreshOnNofifyEnabled = enabled;
}
Expand Down

0 comments on commit a69199c

Please sign in to comment.