@@ -1088,9 +1088,9 @@ int QgsStyleManagerDialog::addTag()
1088
1088
1089
1089
// block the auto-repopulation of groups when the style emits groupsModified
1090
1090
// instead, we manually update the model items for better state retention
1091
- mBlockGroupUpdates = true ;
1091
+ mBlockGroupUpdates ++ ;
1092
1092
id = mStyle ->addTag ( itemName );
1093
- mBlockGroupUpdates = false ;
1093
+ mBlockGroupUpdates -- ;
1094
1094
1095
1095
if ( !id )
1096
1096
{
@@ -1130,9 +1130,9 @@ int QgsStyleManagerDialog::addSmartgroup()
1130
1130
1131
1131
// block the auto-repopulation of groups when the style emits groupsModified
1132
1132
// instead, we manually update the model items for better state retention
1133
- mBlockGroupUpdates = true ;
1133
+ mBlockGroupUpdates ++ ;
1134
1134
id = mStyle ->addSmartgroup ( dlg.smartgroupName (), dlg.conditionOperator (), dlg.conditionMap () );
1135
- mBlockGroupUpdates = false ;
1135
+ mBlockGroupUpdates -- ;
1136
1136
1137
1137
if ( !id )
1138
1138
return 0 ;
@@ -1166,7 +1166,7 @@ void QgsStyleManagerDialog::removeGroup()
1166
1166
1167
1167
// block the auto-repopulation of groups when the style emits groupsModified
1168
1168
// instead, we manually update the model items for better state retention
1169
- mBlockGroupUpdates = true ;
1169
+ mBlockGroupUpdates ++ ;
1170
1170
1171
1171
if ( parentItem->data ( Qt::UserRole + 1 ).toString () == QLatin1String ( " smartgroups" ) )
1172
1172
{
@@ -1177,7 +1177,7 @@ void QgsStyleManagerDialog::removeGroup()
1177
1177
mStyle ->remove ( QgsStyle::TagEntity, index .data ( Qt::UserRole + 1 ).toInt () );
1178
1178
}
1179
1179
1180
- mBlockGroupUpdates = false ;
1180
+ mBlockGroupUpdates -- ;
1181
1181
parentItem->removeRow ( index .row () );
1182
1182
}
1183
1183
@@ -1186,6 +1186,7 @@ void QgsStyleManagerDialog::groupRenamed( QStandardItem *item )
1186
1186
QgsDebugMsg ( QStringLiteral ( " Symbol group edited: data=%1 text=%2" ).arg ( item->data ( Qt::UserRole + 1 ).toString (), item->text () ) );
1187
1187
int id = item->data ( Qt::UserRole + 1 ).toInt ();
1188
1188
QString name = item->text ();
1189
+ mBlockGroupUpdates ++;
1189
1190
if ( item->parent ()->data ( Qt::UserRole + 1 ) == " smartgroups" )
1190
1191
{
1191
1192
mStyle ->rename ( QgsStyle::SmartgroupEntity, id, name );
@@ -1194,6 +1195,7 @@ void QgsStyleManagerDialog::groupRenamed( QStandardItem *item )
1194
1195
{
1195
1196
mStyle ->rename ( QgsStyle::TagEntity, id, name );
1196
1197
}
1198
+ mBlockGroupUpdates --;
1197
1199
}
1198
1200
1199
1201
void QgsStyleManagerDialog::tagSymbolsAction ()
@@ -1548,8 +1550,10 @@ void QgsStyleManagerDialog::editSmartgroupAction()
1548
1550
if ( dlg.exec () == QDialog::Rejected )
1549
1551
return ;
1550
1552
1553
+ mBlockGroupUpdates ++;
1551
1554
mStyle ->remove ( QgsStyle::SmartgroupEntity, item->data ().toInt () );
1552
1555
int id = mStyle ->addSmartgroup ( dlg.smartgroupName (), dlg.conditionOperator (), dlg.conditionMap () );
1556
+ mBlockGroupUpdates --;
1553
1557
if ( !id )
1554
1558
{
1555
1559
QMessageBox::critical ( this , tr ( " Edit Smart Group" ),
0 commit comments