Skip to content

Commit

Permalink
Refresh the style manager only when a change has been done to it.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14604 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 13, 2010
1 parent ec6e56e commit dea0e2c
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions src/gui/symbology-ng/qgsstylev2managerdialog.cpp
Expand Up @@ -168,21 +168,25 @@ QString QgsStyleV2ManagerDialog::currentItemName()

void QgsStyleV2ManagerDialog::addItem()
{
bool changed = false;
if ( currentItemType() < 3 )
{
addSymbol();
changed = addSymbol();
}
else if ( currentItemType() == 3 )
{
addColorRamp();
changed = addColorRamp();
}
else
{
Q_ASSERT( 0 && "not implemented" );
}

populateList();
populateTypes();
if ( changed )
{
populateList();
populateTypes();
}
}

bool QgsStyleV2ManagerDialog::addSymbol()
Expand Down Expand Up @@ -303,20 +307,22 @@ bool QgsStyleV2ManagerDialog::addColorRamp()

void QgsStyleV2ManagerDialog::editItem()
{
bool changed = false;
if ( currentItemType() < 3 )
{
editSymbol();
changed = editSymbol();
}
else if ( currentItemType() == 3 )
{
editColorRamp();
changed = editColorRamp();
}
else
{
Q_ASSERT( 0 && "not implemented" );
}

populateList();
if ( changed )
populateList();
}

bool QgsStyleV2ManagerDialog::editSymbol()
Expand Down Expand Up @@ -392,21 +398,25 @@ bool QgsStyleV2ManagerDialog::editColorRamp()

void QgsStyleV2ManagerDialog::removeItem()
{
bool changed = false;
if ( currentItemType() < 3 )
{
removeSymbol();
changed = removeSymbol();
}
else if ( currentItemType() == 3 )
{
removeColorRamp();
changed = removeColorRamp();
}
else
{
Q_ASSERT( 0 && "not implemented" );
}

populateList();
populateTypes();
if ( changed )
{
populateList();
populateTypes();
}
}

bool QgsStyleV2ManagerDialog::removeSymbol()
Expand Down

0 comments on commit dea0e2c

Please sign in to comment.