[QGIS Commit] r14934 - trunk/qgis/src/app/legend

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Dec 16 18:26:56 EST 2010


Author: wonder
Date: 2010-12-16 15:26:56 -0800 (Thu, 16 Dec 2010)
New Revision: 14934

Modified:
   trunk/qgis/src/app/legend/qgslegend.cpp
Log:
Fixed a crash when refreshing layer symbology - if the currently selected item has been removed (#3326 and #3003)


Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp	2010-12-16 22:29:54 UTC (rev 14933)
+++ trunk/qgis/src/app/legend/qgslegend.cpp	2010-12-16 23:26:56 UTC (rev 14934)
@@ -1474,7 +1474,7 @@
   }
 
   //store the current item
-  QTreeWidgetItem* theCurrentItem = currentItem();
+  QModelIndex currentItemIndex( currentIndex() );
 
   double widthScale = 1.0;
   if ( mMapCanvas && mMapCanvas->map() )
@@ -1485,7 +1485,7 @@
   theLegendLayer->refreshSymbology( key, widthScale );
 
   //restore the current item again
-  setCurrentItem( theCurrentItem );
+  setCurrentIndex( currentItemIndex );
   adjustIconSize();
   if ( expandItem )
   {



More information about the QGIS-commit mailing list