Skip to content

Commit 964c99f

Browse files
committed
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)
1 parent 0a15809 commit 964c99f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

python/core/auto_generated/qgsdataitem.sip.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,12 @@ Items that return valid URI will be returned in mime data when dragging a select
205205
typedef QFlags<QgsDataItem::Capability> Capabilities;
206206

207207

208-
virtual bool setCrs( const QgsCoordinateReferenceSystem &crs );
208+
virtual bool setCrs( const QgsCoordinateReferenceSystem &crs ) /Deprecated/;
209209
%Docstring
210210
Writes the selected crs into data source. The original data source will be modified when calling this
211211
method.
212+
213+
.. deprecated:: since QGIS 3.6. This method is no longer used by QGIS and will be removed in QGIS 4.0.
212214
%End
213215

214216
virtual bool rename( const QString &name );

src/core/qgsdataitem.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class CORE_EXPORT QgsDataItem : public QObject
207207
enum Capability
208208
{
209209
NoCapabilities = 0,
210-
SetCrs = 1 << 0, //!< Can set CRS on layer or group of layers
210+
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
211211
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.
212212
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
213213
Collapse = 1 << 3, //!< The collapse/expand status for this items children should be ignored in order to avoid undesired network connections (wms etc.)
@@ -218,8 +218,14 @@ class CORE_EXPORT QgsDataItem : public QObject
218218
/**
219219
* Writes the selected crs into data source. The original data source will be modified when calling this
220220
* method.
221+
*
222+
* \deprecated since QGIS 3.6. This method is no longer used by QGIS and will be removed in QGIS 4.0.
221223
*/
222-
virtual bool setCrs( const QgsCoordinateReferenceSystem &crs ) { Q_UNUSED( crs ); return false; }
224+
Q_DECL_DEPRECATED virtual bool setCrs( const QgsCoordinateReferenceSystem &crs ) SIP_DEPRECATED
225+
{
226+
Q_UNUSED( crs );
227+
return false;
228+
}
223229

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

0 commit comments

Comments
 (0)