Skip to content
Permalink
Browse files

fix for circular activation of raster temporal properties

  • Loading branch information
Samweli committed Apr 28, 2020
1 parent 68896bf commit 9fdf50f104aca4ca93205aa2d71fe62e04c2159a
@@ -11079,7 +11079,7 @@ void QgisApp::projectTemporalRangeChanged()
QgsDateTimeRange range = QgsProject::instance()->timeSettings()->temporalRange();
if ( range.begin().isValid() && range.end().isValid() )
{
QString time = range.begin().toString( Qt::ISODateWithMs ) + "/" +
QString time = range.begin().toString( Qt::ISODateWithMs ) + '/' +
range.end().toString( Qt::ISODateWithMs );

uri[ QStringLiteral( "time" ) ] = time;
@@ -127,6 +127,11 @@ QgsRasterLayer::QgsRasterLayer( const QString &uri,

setDataSource( uri, baseName, providerKey, providerOptions, options.loadDefaultStyle );

if ( mValid )
{
mTemporalProperties->setDefaultsFromDataProviderTemporalCapabilities( mDataProvider->temporalCapabilities() );
}

} // QgsRasterLayer ctor

QgsRasterLayer::~QgsRasterLayer()
@@ -871,8 +876,6 @@ void QgsRasterLayer::setDataSource( const QString &dataSource, const QString &ba

if ( mValid )
{
mTemporalProperties->setDefaultsFromDataProviderTemporalCapabilities( mDataProvider->temporalCapabilities() );

// load default style
bool defaultLoadedFlag = false;
bool restoredStyle = false;
@@ -133,6 +133,7 @@ void QgsRasterLayerTemporalProperties::setDefaultsFromDataProviderTemporalCapabi
{
if ( const QgsRasterDataProviderTemporalCapabilities *rasterCaps = dynamic_cast< const QgsRasterDataProviderTemporalCapabilities *>( capabilities ) )
{
setIsActive( rasterCaps->hasTemporalCapabilities() );
setFixedTemporalRange( rasterCaps->availableTemporalRange() );

if ( rasterCaps->hasTemporalCapabilities() )
@@ -1269,11 +1269,11 @@ void QgsRasterLayerProperties::updateSourceStaticTime()
range = QgsProject::instance()->timeSettings()->temporalRange();
if ( range.begin().isValid() && range.end().isValid() )
{
QString time = range.begin().toString( Qt::ISODateWithMs ) + "/" +
QString time = range.begin().toString( Qt::ISODateWithMs ) + '/' +
range.end().toString( Qt::ISODateWithMs );

uri[ QStringLiteral( "time" ) ] = time;
uri[ QStringLiteral( "temporalSource" ) ] = QLatin1String( "project" )
uri[ QStringLiteral( "temporalSource" ) ] = QLatin1String( "project" );
}
}

0 comments on commit 9fdf50f

Please sign in to comment.
You can’t perform that action at this time.