Skip to content

Commit b4a6b41

Browse files
author
cfarmer
committedNov 7, 2009
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)
git-svn-id: http://svn.osgeo.org/qgis/trunk@11943 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 05a5712 commit b4a6b41

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed
 

‎python/core/qgsmaplayer.sip

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,17 @@ public:
188188
*/
189189
virtual QString lastError();
190190

191-
/** Returns layer's spatial reference system */
191+
/** Returns layer's spatial reference system
192+
@note This was introduced in QGIS 1.4
193+
*/
194+
195+
const QgsCoordinateReferenceSystem& crs();
196+
197+
/** Returns layer's spatial reference system
198+
@note This method is here for API compatibility
199+
and will be deprecited in 2.0
200+
@see crs()
201+
*/
192202
const QgsCoordinateReferenceSystem& srs();
193203

194204
/** Sets layer's spatial reference system */

‎src/core/qgsmaplayer.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,15 @@ void QgsMapLayer::setSubLayerVisibility( QString name, bool vis )
427427
// NOOP
428428
}
429429

430+
const QgsCoordinateReferenceSystem& QgsMapLayer::crs()
431+
{
432+
return *mCRS;
433+
}
434+
430435
const QgsCoordinateReferenceSystem& QgsMapLayer::srs()
431436
{
437+
// This will be dropped in QGIS 2.0 due to conflicting name
438+
// Please use crs() in the future
432439
return *mCRS;
433440
}
434441

‎src/core/qgsmaplayer.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,16 @@ class CORE_EXPORT QgsMapLayer : public QObject
190190
*/
191191
virtual QString lastError();
192192

193-
/** Returns layer's spatial reference system */
193+
/** Returns layer's spatial reference system
194+
@note This was introduced in QGIS 1.4
195+
*/
196+
const QgsCoordinateReferenceSystem& crs();
197+
198+
/** Returns layer's spatial reference system
199+
@note This method is here for API compatibility
200+
and will be deprecited in 2.0
201+
@see crs()
202+
*/
194203
const QgsCoordinateReferenceSystem& srs();
195204

196205
/** Sets layer's spatial reference system */

0 commit comments

Comments
 (0)
Please sign in to comment.