Skip to content

Commit

Permalink
Merge pull request #2625 from SebDieBln/FixAppendingNotSupported
Browse files Browse the repository at this point in the history
Fix accumulating "Not supported" hints
  • Loading branch information
nyalldawson committed Jan 1, 2016
2 parents 5a42728 + 9cd1edf commit 0df4cbe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0df4cbe

Please sign in to comment.