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

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Apr 17 12:07:29 EDT 2011


Author: rblazek
Date: 2011-04-17 09:07:29 -0700 (Sun, 17 Apr 2011)
New Revision: 15750

Modified:
   trunk/qgis/src/app/legend/qgslegendlayer.cpp
   trunk/qgis/src/app/legend/qgslegendlayer.h
Log:
legend refresh after data reload

Modified: trunk/qgis/src/app/legend/qgslegendlayer.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegendlayer.cpp	2011-04-17 15:13:18 UTC (rev 15749)
+++ trunk/qgis/src/app/legend/qgslegendlayer.cpp	2011-04-17 16:07:29 UTC (rev 15750)
@@ -94,6 +94,10 @@
     connect( layer, SIGNAL( editingStopped() ), this, SLOT( updateIcon() ) );
     connect( layer, SIGNAL( layerModified( bool ) ), this, SLOT( updateAfterLayerModification( bool ) ) );
   }
+  if ( qobject_cast<QgsRasterLayer *>( layer ) )
+  {
+    connect( layer, SIGNAL( dataChanged() ), this, SLOT( updateAfterLayerModification() ) );
+  }
   connect( layer, SIGNAL( layerNameChanged() ), this, SLOT( layerNameChanged() ) );
 
   updateIcon();
@@ -545,6 +549,10 @@
   setText( 0, name );
 }
 
+void QgsLegendLayer::updateAfterLayerModification()
+{
+  updateAfterLayerModification( false );
+}
 void QgsLegendLayer::updateAfterLayerModification( bool onlyGeomChanged )
 {
   if ( onlyGeomChanged )

Modified: trunk/qgis/src/app/legend/qgslegendlayer.h
===================================================================
--- trunk/qgis/src/app/legend/qgslegendlayer.h	2011-04-17 15:13:18 UTC (rev 15749)
+++ trunk/qgis/src/app/legend/qgslegendlayer.h	2011-04-17 16:07:29 UTC (rev 15750)
@@ -90,6 +90,7 @@
 
     /**Update symbology (e.g. to update feature count in the legend after editing operations)*/
     void updateAfterLayerModification( bool onlyGeomChanged );
+    void updateAfterLayerModification();
 
     void setShowFeatureCount( bool show, bool update = true );
     bool showFeatureCount() const { return mShowFeatureCount; }



More information about the QGIS-commit mailing list