Skip to content

Commit

Permalink
Fix raster temporal properties were never saved
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 12, 2020
1 parent 835f928 commit eef889a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -1960,6 +1960,8 @@ bool QgsRasterLayer::readXml( const QDomNode &layer_node, QgsReadWriteContext &c
}
}

mTemporalProperties->readXml( layer_node.toElement(), context );

readStyleManager( layer_node );

return res;
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterlayertemporalproperties.cpp
Expand Up @@ -102,7 +102,7 @@ bool QgsRasterLayerTemporalProperties::readXml( const QDomElement &element, cons
Q_UNUSED( context )
// TODO add support for raster layers with multi-temporal properties.

QDomElement temporalNode = element.elementsByTagName( QStringLiteral( "temporal" ) ).at( 0 ).toElement();
QDomElement temporalNode = element.firstChildElement( QStringLiteral( "temporal" ) );

mMode = static_cast< TemporalMode >( temporalNode.attribute( QStringLiteral( "mode" ), QStringLiteral( "0" ) ). toInt() );
mIntervalHandlingMethod = static_cast< QgsRasterDataProviderTemporalCapabilities::IntervalHandlingMethod >( temporalNode.attribute( QStringLiteral( "fetchMode" ), QStringLiteral( "0" ) ). toInt() );
Expand Down
3 changes: 0 additions & 3 deletions src/gui/raster/qgsrasterlayerproperties.cpp
Expand Up @@ -1032,9 +1032,6 @@ void QgsRasterLayerProperties::apply()
hueSaturationFilter->setColorizeStrength( sliderColorizeStrength->value() );
}

// Update temporal properties
mTemporalWidget->saveTemporalProperties();

//set the blend mode for the layer
mRasterLayer->setBlendMode( mBlendModeComboBox->blendMode() );

Expand Down
2 changes: 1 addition & 1 deletion src/gui/raster/qgsrasterlayertemporalpropertieswidget.cpp
Expand Up @@ -44,7 +44,7 @@ void QgsRasterLayerTemporalPropertiesWidget::init()
setDateTimeInputsLimit();
setDateTimeInputsLocale();

mFetchModeComboBox->addItem( tr( "Use Whole Temporal Range" ), QgsRasterDataProviderTemporalCapabilities::MatchExactUsingStartOfRange );
mFetchModeComboBox->addItem( tr( "Use Whole Temporal Range" ), QgsRasterDataProviderTemporalCapabilities::MatchUsingWholeRange );
mFetchModeComboBox->addItem( tr( "Match to Start of Range" ), QgsRasterDataProviderTemporalCapabilities::MatchExactUsingStartOfRange );
mFetchModeComboBox->addItem( tr( "Match to End of Range" ), QgsRasterDataProviderTemporalCapabilities::MatchExactUsingEndOfRange );

Expand Down

0 comments on commit eef889a

Please sign in to comment.