Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update QgsMapLayer to current naming convention for CRS; srs() functi…
…on left for API compatability (note was added to warn of future changes in 2.0)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11943 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer committed Nov 7, 2009
1 parent 1212a32 commit d061c1a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
12 changes: 11 additions & 1 deletion python/core/qgsmaplayer.sip
Expand Up @@ -188,7 +188,17 @@ public:
*/
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 */
Expand Down
7 changes: 7 additions & 0 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -427,8 +427,15 @@ void QgsMapLayer::setSubLayerVisibility( QString name, bool vis )
// 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;
}

Expand Down
11 changes: 10 additions & 1 deletion src/core/qgsmaplayer.h
Expand Up @@ -190,7 +190,16 @@ class CORE_EXPORT QgsMapLayer : public QObject
*/
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 */
Expand Down

0 comments on commit d061c1a

Please sign in to comment.