Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Deprecate QgsDataItem API for setting item CRS
This is no longer used by QGIS (it was only ever used by the standalone
browser)

(cherry picked from commit d61694c)
  • Loading branch information
nyalldawson committed Feb 7, 2019
1 parent 0a15809 commit 964c99f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion python/core/auto_generated/qgsdataitem.sip.in
Expand Up @@ -205,10 +205,12 @@ Items that return valid URI will be returned in mime data when dragging a select
typedef QFlags<QgsDataItem::Capability> Capabilities;


virtual bool setCrs( const QgsCoordinateReferenceSystem &crs );
virtual bool setCrs( const QgsCoordinateReferenceSystem &crs ) /Deprecated/;
%Docstring
Writes the selected crs into data source. The original data source will be modified when calling this
method.

.. deprecated:: since QGIS 3.6. This method is no longer used by QGIS and will be removed in QGIS 4.0.
%End

virtual bool rename( const QString &name );
Expand Down
10 changes: 8 additions & 2 deletions src/core/qgsdataitem.h
Expand Up @@ -207,7 +207,7 @@ class CORE_EXPORT QgsDataItem : public QObject
enum Capability
{
NoCapabilities = 0,
SetCrs = 1 << 0, //!< Can set CRS on layer or group of layers
SetCrs = 1 << 0, //!< Can set CRS on layer or group of layers. \deprecated in QGIS 3.6 -- no longer used by QGIS and will be removed in QGIS 4.0
Fertile = 1 << 1, //!< Can create children. Even items without this capability may have children, but cannot create them, it means that children are created by item ancestors.
Fast = 1 << 2, //!< CreateChildren() is fast enough to be run in main thread when refreshing items, most root items (wms,wfs,wcs,postgres...) are considered fast because they are reading data only from QgsSettings
Collapse = 1 << 3, //!< The collapse/expand status for this items children should be ignored in order to avoid undesired network connections (wms etc.)
Expand All @@ -218,8 +218,14 @@ class CORE_EXPORT QgsDataItem : public QObject
/**
* Writes the selected crs into data source. The original data source will be modified when calling this
* method.
*
* \deprecated since QGIS 3.6. This method is no longer used by QGIS and will be removed in QGIS 4.0.
*/
virtual bool setCrs( const QgsCoordinateReferenceSystem &crs ) { Q_UNUSED( crs ); return false; }
Q_DECL_DEPRECATED virtual bool setCrs( const QgsCoordinateReferenceSystem &crs ) SIP_DEPRECATED
{
Q_UNUSED( crs );
return false;
}

/**
* Sets a new \a name for the item, and returns true if the item was successfully renamed.
Expand Down

0 comments on commit 964c99f

Please sign in to comment.