Skip to content

Commit 9cd1edf

Browse files
committed
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.
1 parent 766bfa1 commit 9cd1edf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/app/qgsvectorlayerproperties.cpp

+9-1
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)