[QGIS Commit] r14604 - trunk/qgis/src/gui/symbology-ng

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Nov 13 11:40:10 EST 2010


Author: wonder
Date: 2010-11-13 08:40:10 -0800 (Sat, 13 Nov 2010)
New Revision: 14604

Modified:
   trunk/qgis/src/gui/symbology-ng/qgsstylev2managerdialog.cpp
Log:
Refresh the style manager only when a change has been done to it.


Modified: trunk/qgis/src/gui/symbology-ng/qgsstylev2managerdialog.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgsstylev2managerdialog.cpp	2010-11-13 16:39:41 UTC (rev 14603)
+++ trunk/qgis/src/gui/symbology-ng/qgsstylev2managerdialog.cpp	2010-11-13 16:40:10 UTC (rev 14604)
@@ -168,21 +168,25 @@
 
 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()
@@ -303,20 +307,22 @@
 
 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()
@@ -392,21 +398,25 @@
 
 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()



More information about the QGIS-commit mailing list