[QGIS Commit] r12405 - in trunk/qgis/src: app core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Dec 11 05:27:14 EST 2009


Author: jef
Date: 2009-12-11 05:27:14 -0500 (Fri, 11 Dec 2009)
New Revision: 12405

Modified:
   trunk/qgis/src/app/qgsidentifyresults.cpp
   trunk/qgis/src/core/qgsmaplayer.cpp
   trunk/qgis/src/core/qgsmaplayer.h
Log:
fix #2255

Modified: trunk/qgis/src/app/qgsidentifyresults.cpp
===================================================================
--- trunk/qgis/src/app/qgsidentifyresults.cpp	2009-12-11 10:25:43 UTC (rev 12404)
+++ trunk/qgis/src/app/qgsidentifyresults.cpp	2009-12-11 10:27:14 UTC (rev 12405)
@@ -159,6 +159,7 @@
     if ( vlayer )
     {
       connect( vlayer, SIGNAL( layerDeleted() ), this, SLOT( layerDestroyed() ) );
+      connect( vlayer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
       connect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
       connect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
       connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
@@ -166,6 +167,7 @@
     else
     {
       connect( layer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) );
+      connect( layer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
     }
   }
 

Modified: trunk/qgis/src/core/qgsmaplayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.cpp	2009-12-11 10:25:43 UTC (rev 12404)
+++ trunk/qgis/src/core/qgsmaplayer.cpp	2009-12-11 10:27:14 UTC (rev 12405)
@@ -440,9 +440,11 @@
   return *mCRS;
 }
 
-void QgsMapLayer::setCrs( const QgsCoordinateReferenceSystem& srs )
+void QgsMapLayer::setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal )
 {
   *mCRS = srs;
+  if ( emitSignal )
+    emit layerCrsChanged();
 }
 
 unsigned int QgsMapLayer::getTransparency()

Modified: trunk/qgis/src/core/qgsmaplayer.h
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.h	2009-12-11 10:25:43 UTC (rev 12404)
+++ trunk/qgis/src/core/qgsmaplayer.h	2009-12-11 10:27:14 UTC (rev 12405)
@@ -211,8 +211,9 @@
     */
     const QgsCoordinateReferenceSystem& srs();
 
-    /** Sets layer's spatial reference system */
-    void setCrs( const QgsCoordinateReferenceSystem& srs );
+    /** Sets layer's spatial reference system
+    @note emitSignal added in 1.4 */
+    void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );
 
 
     /** A convenience function to capitalise the layer name */
@@ -320,9 +321,14 @@
     /** Emit a signal with status (e.g. to be caught by QgisApp and display a msg on status bar) */
     void statusChanged( QString theStatus );
 
-    /** Emit a signal that layer name has been changed */
+    /** Emit a signal that the layer name has been changed */
     void layerNameChanged();
 
+    /** Emit a signal that layer's CRS has been reset
+     added in 1.4
+     */
+    void layerCrsChanged();
+
     /** This signal should be connected with the slot QgsMapCanvas::refresh()
      * @TODO: to be removed - GUI dependency
      */



More information about the QGIS-commit mailing list