Skip to content

Commit 34361ae

Browse files
committed
Move setCrs() back to QgsDataItem from QgsLayerItem.
The rationale is that some data sources (providers) share CRS for a whole set of layers (e.g. GRASS)
1 parent 215d50b commit 34361ae

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/core/qgsdataitem.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ class CORE_EXPORT QgsDataItem : public QObject
7777

7878
virtual QWidget * paramWidget() { return 0; }
7979

80+
//
81+
82+
enum Capability
83+
{
84+
NoCapabilities = 0,
85+
SetCrs = 1 //Can set CRS on layer or group of layers
86+
};
87+
88+
// This will _write_ selected crs in data source
89+
virtual bool setCrs ( QgsCoordinateReferenceSystem crs ) { return false; }
90+
91+
virtual Capability capabilities() { return NoCapabilities; }
92+
8093
// static methods
8194

8295
static QPixmap getThemePixmap( const QString theName );
@@ -133,12 +146,6 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem
133146
Table
134147
};
135148

136-
enum Capability
137-
{
138-
NoCapabilities = 0,
139-
SetCrs = 1 //Can set CRS on layer or group of layers
140-
};
141-
142149
QgsLayerItem(QgsDataItem* parent, QString name, QString path, QString uri, LayerType layerType, QString providerKey);
143150

144151
// --- reimplemented from QgsDataItem ---
@@ -156,11 +163,6 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem
156163
// Returns provider key
157164
QString providerKey() { return mProviderKey; }
158165

159-
// This will _write_ selected crs in data source
160-
virtual bool setCrs ( QgsCoordinateReferenceSystem crs ) { return false; }
161-
162-
virtual Capability capabilities() { return NoCapabilities; }
163-
164166
protected:
165167

166168
QString mProviderKey;

0 commit comments

Comments
 (0)