Skip to content

Commit 0df4cbe

Browse files
committed
Merge pull request #2625 from SebDieBln/FixAppendingNotSupported
Fix accumulating "Not supported" hints
2 parents 5a42728 + 9cd1edf commit 0df4cbe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/app/qgsvectorlayerproperties.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,16 +435,24 @@ void QgsVectorLayerProperties::syncToLayer( void )
435435
mSimplifyDrawingGroupBox->setChecked( simplifyMethod.simplifyHints() != QgsVectorSimplifyMethod::NoSimplification );
436436
mSimplifyDrawingSpinBox->setValue( simplifyMethod.threshold() );
437437

438+
QString remark = QString( " (%1)" ).arg( tr( "Not supported" ) );
438439
if ( !( layer->dataProvider()->capabilities() & QgsVectorDataProvider::SimplifyGeometries ) )
439440
{
440441
mSimplifyDrawingAtProvider->setChecked( false );
441442
mSimplifyDrawingAtProvider->setEnabled( false );
442-
mSimplifyDrawingAtProvider->setText( QString( "%1 (%2)" ).arg( mSimplifyDrawingAtProvider->text(), tr( "Not supported" ) ) );
443+
if ( !mSimplifyDrawingAtProvider->text().endsWith( remark ) )
444+
mSimplifyDrawingAtProvider->setText( mSimplifyDrawingAtProvider->text().append( remark ) );
443445
}
444446
else
445447
{
446448
mSimplifyDrawingAtProvider->setChecked( !simplifyMethod.forceLocalOptimization() );
447449
mSimplifyDrawingAtProvider->setEnabled( mSimplifyDrawingGroupBox->isChecked() );
450+
if ( mSimplifyDrawingAtProvider->text().endsWith( remark ) )
451+
{
452+
QString newText = mSimplifyDrawingAtProvider->text();
453+
newText.chop( remark.size() );
454+
mSimplifyDrawingAtProvider->setText( newText );
455+
}
448456
}
449457

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

0 commit comments

Comments
 (0)