Skip to content

Commit dea0e2c

Browse files
author
wonder
committed
Refresh the style manager only when a change has been done to it.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14604 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent ec6e56e commit dea0e2c

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

src/gui/symbology-ng/qgsstylev2managerdialog.cpp

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,25 @@ QString QgsStyleV2ManagerDialog::currentItemName()
168168

169169
void QgsStyleV2ManagerDialog::addItem()
170170
{
171+
bool changed = false;
171172
if ( currentItemType() < 3 )
172173
{
173-
addSymbol();
174+
changed = addSymbol();
174175
}
175176
else if ( currentItemType() == 3 )
176177
{
177-
addColorRamp();
178+
changed = addColorRamp();
178179
}
179180
else
180181
{
181182
Q_ASSERT( 0 && "not implemented" );
182183
}
183184

184-
populateList();
185-
populateTypes();
185+
if ( changed )
186+
{
187+
populateList();
188+
populateTypes();
189+
}
186190
}
187191

188192
bool QgsStyleV2ManagerDialog::addSymbol()
@@ -303,20 +307,22 @@ bool QgsStyleV2ManagerDialog::addColorRamp()
303307

304308
void QgsStyleV2ManagerDialog::editItem()
305309
{
310+
bool changed = false;
306311
if ( currentItemType() < 3 )
307312
{
308-
editSymbol();
313+
changed = editSymbol();
309314
}
310315
else if ( currentItemType() == 3 )
311316
{
312-
editColorRamp();
317+
changed = editColorRamp();
313318
}
314319
else
315320
{
316321
Q_ASSERT( 0 && "not implemented" );
317322
}
318323

319-
populateList();
324+
if ( changed )
325+
populateList();
320326
}
321327

322328
bool QgsStyleV2ManagerDialog::editSymbol()
@@ -392,21 +398,25 @@ bool QgsStyleV2ManagerDialog::editColorRamp()
392398

393399
void QgsStyleV2ManagerDialog::removeItem()
394400
{
401+
bool changed = false;
395402
if ( currentItemType() < 3 )
396403
{
397-
removeSymbol();
404+
changed = removeSymbol();
398405
}
399406
else if ( currentItemType() == 3 )
400407
{
401-
removeColorRamp();
408+
changed = removeColorRamp();
402409
}
403410
else
404411
{
405412
Q_ASSERT( 0 && "not implemented" );
406413
}
407414

408-
populateList();
409-
populateTypes();
415+
if ( changed )
416+
{
417+
populateList();
418+
populateTypes();
419+
}
410420
}
411421

412422
bool QgsStyleV2ManagerDialog::removeSymbol()

0 commit comments

Comments
 (0)