[QGIS Commit] r11943 - in trunk/qgis: python/core src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Nov 7 03:47:45 EST 2009


Author: cfarmer
Date: 2009-11-07 03:47:44 -0500 (Sat, 07 Nov 2009)
New Revision: 11943

Modified:
   trunk/qgis/python/core/qgsmaplayer.sip
   trunk/qgis/src/core/qgsmaplayer.cpp
   trunk/qgis/src/core/qgsmaplayer.h
Log:
Update QgsMapLayer to current naming convention for CRS; srs() function left for API compatability (note was added to warn of future changes in 2.0)

Modified: trunk/qgis/python/core/qgsmaplayer.sip
===================================================================
--- trunk/qgis/python/core/qgsmaplayer.sip	2009-11-06 16:39:58 UTC (rev 11942)
+++ trunk/qgis/python/core/qgsmaplayer.sip	2009-11-07 08:47:44 UTC (rev 11943)
@@ -188,7 +188,17 @@
      */
     virtual QString lastError();
 
-    /** Returns layer's spatial reference system */
+    /** Returns layer's spatial reference system
+    @note This was introduced in QGIS 1.4
+    */
+    
+    const QgsCoordinateReferenceSystem& crs();
+
+    /** Returns layer's spatial reference system
+    @note This method is here for API compatibility
+    and will be deprecited in 2.0
+    @see crs()
+    */
     const QgsCoordinateReferenceSystem& srs();
     
     /** Sets layer's spatial reference system */

Modified: trunk/qgis/src/core/qgsmaplayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.cpp	2009-11-06 16:39:58 UTC (rev 11942)
+++ trunk/qgis/src/core/qgsmaplayer.cpp	2009-11-07 08:47:44 UTC (rev 11943)
@@ -427,8 +427,15 @@
   // NOOP
 }
 
+const QgsCoordinateReferenceSystem& QgsMapLayer::crs()
+{
+  return *mCRS;
+}
+
 const QgsCoordinateReferenceSystem& QgsMapLayer::srs()
 {
+  // This will be dropped in QGIS 2.0 due to conflicting name
+  // Please use crs() in the future
   return *mCRS;
 }
 

Modified: trunk/qgis/src/core/qgsmaplayer.h
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.h	2009-11-06 16:39:58 UTC (rev 11942)
+++ trunk/qgis/src/core/qgsmaplayer.h	2009-11-07 08:47:44 UTC (rev 11943)
@@ -190,7 +190,16 @@
      */
     virtual QString lastError();
 
-    /** Returns layer's spatial reference system */
+    /** Returns layer's spatial reference system
+    @note This was introduced in QGIS 1.4
+    */
+    const QgsCoordinateReferenceSystem& crs();
+
+    /** Returns layer's spatial reference system
+    @note This method is here for API compatibility
+    and will be deprecited in 2.0
+    @see crs()
+    */
     const QgsCoordinateReferenceSystem& srs();
 
     /** Sets layer's spatial reference system */



More information about the QGIS-commit mailing list