"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/app/qgsrasterlayerproperties.cpp" between
QGIS-final-3_10_11.tar.gz and QGIS-final-3_10_12.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Long-term release (3.10.x series).

qgsrasterlayerproperties.cpp  (QGIS-final-3_10_11):qgsrasterlayerproperties.cpp  (QGIS-final-3_10_12)
skipping to change at line 661 skipping to change at line 661
Previously this dialog was created anew with each right-click pop-up menu Previously this dialog was created anew with each right-click pop-up menu
invocation. Changed so that the dialog always exists after first invocation. Changed so that the dialog always exists after first
invocation, and is just re-synchronized with its layer's state when invocation, and is just re-synchronized with its layer's state when
re-shown. re-shown.
*/ */
void QgsRasterLayerProperties::sync() void QgsRasterLayerProperties::sync()
{ {
QgsSettings myQSettings; QgsSettings myQSettings;
if ( mRasterLayer->dataProvider()->dataType( 1 ) == Qgis::ARGB32 const QgsRasterDataProvider *provider = mRasterLayer->dataProvider();
|| mRasterLayer->dataProvider()->dataType( 1 ) == Qgis::ARGB32_Premultipl if ( !provider )
ied ) return;
if ( provider->dataType( 1 ) == Qgis::ARGB32
|| provider->dataType( 1 ) == Qgis::ARGB32_Premultiplied )
{ {
gboxNoDataValue->setEnabled( false ); gboxNoDataValue->setEnabled( false );
gboxCustomTransparency->setEnabled( false ); gboxCustomTransparency->setEnabled( false );
mOptionsStackedWidget->setCurrentWidget( mOptsPage_Server ); mOptionsStackedWidget->setCurrentWidget( mOptsPage_Server );
} }
// TODO: Wouldn't it be better to just removeWidget() the tabs than delete the m? [LS] // TODO: Wouldn't it be better to just removeWidget() the tabs than delete the m? [LS]
if ( !( mRasterLayer->dataProvider()->capabilities() & QgsRasterDataProvider:: BuildPyramids ) ) if ( !( provider->capabilities() & QgsRasterDataProvider::BuildPyramids ) )
{ {
if ( mOptsPage_Pyramids ) if ( mOptsPage_Pyramids )
{ {
delete mOptsPage_Pyramids; delete mOptsPage_Pyramids;
mOptsPage_Pyramids = nullptr; mOptsPage_Pyramids = nullptr;
} }
} }
if ( !( mRasterLayer->dataProvider()->capabilities() & QgsRasterDataProvider:: Size ) ) if ( !( provider->capabilities() & QgsRasterDataProvider::Size ) )
{ {
if ( mOptsPage_Histogram ) if ( mOptsPage_Histogram )
{ {
delete mOptsPage_Histogram; delete mOptsPage_Histogram;
mOptsPage_Histogram = nullptr; mOptsPage_Histogram = nullptr;
delete mHistogramWidget; delete mHistogramWidget;
mHistogramWidget = nullptr; mHistogramWidget = nullptr;
} }
} }
skipping to change at line 720 skipping to change at line 724
QgsRasterRenderer *renderer = mRasterLayer->renderer(); QgsRasterRenderer *renderer = mRasterLayer->renderer();
if ( renderer ) if ( renderer )
{ {
mOpacityWidget->setOpacity( renderer->opacity() ); mOpacityWidget->setOpacity( renderer->opacity() );
cboxTransparencyBand->setBand( renderer->alphaBand() ); cboxTransparencyBand->setBand( renderer->alphaBand() );
} }
//add current NoDataValue to NoDataValue line edit //add current NoDataValue to NoDataValue line edit
// TODO: should be per band // TODO: should be per band
// TODO: no data ranges // TODO: no data ranges
if ( mRasterLayer->dataProvider()->sourceHasNoDataValue( 1 ) ) if ( provider->sourceHasNoDataValue( 1 ) )
{ {
lblSrcNoDataValue->setText( QgsRasterBlock::printValue( mRasterLayer->dataPr ovider()->sourceNoDataValue( 1 ) ) ); lblSrcNoDataValue->setText( QgsRasterBlock::printValue( provider->sourceNoDa taValue( 1 ) ) );
} }
else else
{ {
lblSrcNoDataValue->setText( tr( "not defined" ) ); lblSrcNoDataValue->setText( tr( "not defined" ) );
} }
mSrcNoDataValueCheckBox->setChecked( mRasterLayer->dataProvider()->useSourceNo DataValue( 1 ) ); mSrcNoDataValueCheckBox->setChecked( provider->useSourceNoDataValue( 1 ) );
bool enableSrcNoData = mRasterLayer->dataProvider()->sourceHasNoDataValue( 1 ) && !std::isnan( mRasterLayer->dataProvider()->sourceNoDataValue( 1 ) ); bool enableSrcNoData = provider->sourceHasNoDataValue( 1 ) && !std::isnan( pro vider->sourceNoDataValue( 1 ) );
mSrcNoDataValueCheckBox->setEnabled( enableSrcNoData ); mSrcNoDataValueCheckBox->setEnabled( enableSrcNoData );
lblSrcNoDataValue->setEnabled( enableSrcNoData ); lblSrcNoDataValue->setEnabled( enableSrcNoData );
QgsRasterRangeList noDataRangeList = mRasterLayer->dataProvider()->userNoDataV alues( 1 ); QgsRasterRangeList noDataRangeList = provider->userNoDataValues( 1 );
QgsDebugMsg( QStringLiteral( "noDataRangeList.size = %1" ).arg( noDataRangeLis t.size() ) ); QgsDebugMsg( QStringLiteral( "noDataRangeList.size = %1" ).arg( noDataRangeLis t.size() ) );
if ( !noDataRangeList.isEmpty() ) if ( !noDataRangeList.isEmpty() )
{ {
leNoDataValue->insert( QgsRasterBlock::printValue( noDataRangeList.value( 0 ).min() ) ); leNoDataValue->insert( QgsRasterBlock::printValue( noDataRangeList.value( 0 ).min() ) );
} }
else else
{ {
leNoDataValue->insert( QString() ); leNoDataValue->insert( QString() );
} }
 End of changes. 8 change blocks. 
10 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)