Skip to content
Permalink
Browse files

fix appending "Not supported" multiple times to label

The term "Not supported" is not appended to the label when it is already present.
The term is removed when no longer applicable.
  • Loading branch information
SebDieBln committed Dec 31, 2015
1 parent 766bfa1 commit 9cd1edfda1510172e174f627ef711faf55057f52
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/app/qgsvectorlayerproperties.cpp
@@ -435,16 +435,24 @@ void QgsVectorLayerProperties::syncToLayer( void )
mSimplifyDrawingGroupBox->setChecked( simplifyMethod.simplifyHints() != QgsVectorSimplifyMethod::NoSimplification );
mSimplifyDrawingSpinBox->setValue( simplifyMethod.threshold() );

QString remark = QString( " (%1)" ).arg( tr( "Not supported" ) );
if ( !( layer->dataProvider()->capabilities() & QgsVectorDataProvider::SimplifyGeometries ) )
{
mSimplifyDrawingAtProvider->setChecked( false );
mSimplifyDrawingAtProvider->setEnabled( false );
mSimplifyDrawingAtProvider->setText( QString( "%1 (%2)" ).arg( mSimplifyDrawingAtProvider->text(), tr( "Not supported" ) ) );
if ( !mSimplifyDrawingAtProvider->text().endsWith( remark ) )
mSimplifyDrawingAtProvider->setText( mSimplifyDrawingAtProvider->text().append( remark ) );
}
else
{
mSimplifyDrawingAtProvider->setChecked( !simplifyMethod.forceLocalOptimization() );
mSimplifyDrawingAtProvider->setEnabled( mSimplifyDrawingGroupBox->isChecked() );
if ( mSimplifyDrawingAtProvider->text().endsWith( remark ) )
{
QString newText = mSimplifyDrawingAtProvider->text();
newText.chop( remark.size() );
mSimplifyDrawingAtProvider->setText( newText );
}
}

// disable simplification for point layers, now it is not implemented

0 comments on commit 9cd1edf

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