Skip to content

Commit

Permalink
Don't try to update raster layer data source's if they haven't changed
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 21, 2020
1 parent f3ae6c1 commit d4a6ef0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/raster/qgsrasterlayerproperties.cpp
Expand Up @@ -1227,7 +1227,9 @@ void QgsRasterLayerProperties::updateSourceStaticTime()
{
QgsProviderMetadata *metadata = QgsProviderRegistry::instance()->providerMetadata(
mRasterLayer->providerType() );
QVariantMap uri = metadata->decodeUri( mRasterLayer->dataProvider()->dataSourceUri() );
const QVariantMap currentUri = metadata->decodeUri( mRasterLayer->dataProvider()->dataSourceUri() );

QVariantMap uri = currentUri;

if ( mWmstGroup->isVisibleTo( this ) )
uri[ QStringLiteral( "allowTemporalUpdates" ) ] = mWmstGroup->isChecked();
Expand Down Expand Up @@ -1276,8 +1278,9 @@ void QgsRasterLayerProperties::updateSourceStaticTime()
qobject_cast< QgsRasterLayerTemporalProperties * >( mRasterLayer->temporalProperties() )->setIntervalHandlingMethod( static_cast< QgsRasterDataProviderTemporalCapabilities::IntervalHandlingMethod >(
mFetchModeComboBox->currentData().toInt() ) );
}
mRasterLayer->setDataSource( metadata->encodeUri( uri ), mRasterLayer->name(), mRasterLayer->providerType(), QgsDataProvider::ProviderOptions() );

if ( currentUri != uri )
mRasterLayer->setDataSource( metadata->encodeUri( uri ), mRasterLayer->name(), mRasterLayer->providerType(), QgsDataProvider::ProviderOptions() );
}

void QgsRasterLayerProperties::setSourceStaticTimeState()
Expand Down

0 comments on commit d4a6ef0

Please sign in to comment.