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
This commit is contained in:
cfarmer 2009-11-07 08:47:44 +00:00
parent 05a5712ef8
commit b4a6b417db
3 changed files with 28 additions and 2 deletions

View File

@ -188,7 +188,17 @@ public:
*/ */
virtual QString lastError(); 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(); const QgsCoordinateReferenceSystem& srs();
/** Sets layer's spatial reference system */ /** Sets layer's spatial reference system */

View File

@ -427,8 +427,15 @@ void QgsMapLayer::setSubLayerVisibility( QString name, bool vis )
// NOOP // NOOP
} }
const QgsCoordinateReferenceSystem& QgsMapLayer::crs()
{
return *mCRS;
}
const QgsCoordinateReferenceSystem& QgsMapLayer::srs() const QgsCoordinateReferenceSystem& QgsMapLayer::srs()
{ {
// This will be dropped in QGIS 2.0 due to conflicting name
// Please use crs() in the future
return *mCRS; return *mCRS;
} }

View File

@ -190,7 +190,16 @@ class CORE_EXPORT QgsMapLayer : public QObject
*/ */
virtual QString lastError(); 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(); const QgsCoordinateReferenceSystem& srs();
/** Sets layer's spatial reference system */ /** Sets layer's spatial reference system */