Skip to content

Commit 049d490

Browse files
author
jef
committed
fix API QgsMapLayer::getLayerID() to id()), some warnings and use doxygen deprecation tag.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15168 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4a706f5 commit 049d490

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+221
-200
lines changed

python/core/qgsapplication.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
159159
static const QStringList svgPaths();
160160

161161
//! Returns the path to the applications svg paths
162-
//! @note deprecated
162+
//! @deprecated
163163
static const QString svgPath();
164164

165165
//! Returns the path to the application prefix directory.

python/core/qgscomposermap.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class QgsComposerMap : QgsComposerItem
4747
BoundaryDirection
4848
};
4949

50-
/**This function is deprecated*/
50+
/**@deprecated*/
5151
void draw( QPainter *painter, const QgsRectangle& extent, const QSize& size, int dpi );
5252

5353
/** \brief Draw to paint device

python/core/qgslabel.sip

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public:
4949

5050

5151
/** \brief render label
52-
\note deprecated
52+
\deprecated
5353
*/
5454
void renderLabel ( QPainter* painter, QgsRectangle& viewExtent,
5555
QgsCoordinateTransform* coordinateTransform,
@@ -83,8 +83,7 @@ public:
8383
QMap<int, QgsField> & fields ( );
8484

8585
/** Pointer to default attributes.
86-
* @note this will be deprecated in version 2 as it is
87-
* badly named. Rather use attributes.
86+
* @deprecated in version 2 badly named. Rather use attributes.
8887
* @see labelAttributes method rather */
8988
QgsLabelAttributes *layerAttributes( );
9089

python/core/qgsmaplayer.sip

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ public:
5757
*/
5858
QgsMapLayer::LayerType type() const;
5959

60-
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry */
60+
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry
61+
* @note added in 1.7
62+
*/
63+
QString id() const;
64+
65+
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry
66+
* @deprecated in 1.7
67+
*/
6168
QString getLayerID() const;
6269

6370
/** Set the display name of the layer
@@ -215,7 +222,7 @@ public:
215222

216223
/** Returns layer's spatial reference system
217224
@note This method is here for API compatibility
218-
and will be deprecited in 2.0
225+
and will be deprecated in 2.0
219226
@see crs()
220227
*/
221228
const QgsCoordinateReferenceSystem& srs();

python/core/qgsoverlayobject.sip

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ class QgsOverlayObject
1414
//this function fill not be wrapped to not depend on geos python bindings
1515
/**Returns the feature geometry in geos format. The calling function does _not_ take
1616
ownership of the generated object. The geometry is in map coordinates
17-
@note: this function is deprecated. Please use geometry() and QgsGeometry::asGeos instead*/
17+
@deprecated Please use geometry() and QgsGeometry::asGeos instead*/
1818
//GEOSGeometry* getGeosGeometry();
19-
/**Feature geometry is released when object is destructed so this function is empty. This function is deprecated and does nothing*/
19+
/**Feature geometry is released when object is destructed so this function is empty.
20+
@deprecated nop */
2021
//void releaseGeosGeometry( GEOSGeometry *the_geom )
2122

2223
//getters

python/core/qgsrenderer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class QgsRenderer
4040
@param widthScale scale factor
4141
@param rasterScaleFactor scale factor for rasters
4242

43-
deprecated */
43+
@deprecated */
4444
void renderFeature(QPainter* p, QgsFeature& f,QImage* pic, bool selected, double widthScale = 1.0, double rasterScaleFactor = 1.0);
4545

4646
/**A vector layer passes features to a renderer object to change the brush ans pen of the qpainter

python/core/qgssearchtreenode.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class QgsSearchTreeNode
104104
//! @note attributes and optional geom parameter replace with feature in 1.6
105105
bool checkAgainst( const QMap<int,QgsField>& fields, QgsFeature &f );
106106

107-
//! @note deprecated
107+
//! @deprecated
108108
bool checkAgainst( const QMap<int,QgsField>& fields, const QMap<int, QVariant>& attributes, QgsGeometry* geom = 0 );
109109

110110
//! checks if there were errors during evaluation
@@ -119,7 +119,7 @@ class QgsSearchTreeNode
119119
bool getValue( QgsSearchTreeValue& value /Out/, QgsSearchTreeNode* node,
120120
const QMap<int,QgsField>& fields, QgsFeature &f );
121121

122-
//! @note deprecated
122+
//! @deprecated
123123
bool getValue( QgsSearchTreeValue& value /Out/, QgsSearchTreeNode* node,
124124
const QMap<int,QgsField>& fields, const QMap<int,QVariant>& attributes, QgsGeometry* geom = 0 );
125125

@@ -149,7 +149,7 @@ class QgsSearchTreeNode
149149
//! @note attribute/geom replaced by feature in 1.6
150150
QgsSearchTreeValue valueAgainst( const QMap<int,QgsField>& fields, QgsFeature &f );
151151

152-
//! @note deprecated
152+
//! @deprecated
153153
QgsSearchTreeValue valueAgainst( const QMap<int,QgsField>& fields, const QMap<int,QVariant>& attributes, QgsGeometry* geom = 0 );
154154

155155
//! strips mText when node is of string type

python/core/qgsvectordataprovider.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class QgsVectorDataProvider : QgsDataProvider
196196
* Adds new attributes
197197
* @param attributes map with attribute name as key and type as value
198198
* @return true in case of success and false in case of failure
199-
* @note deprecated
199+
* @deprecated
200200
*/
201201
virtual bool addAttributes(const QMap<QString, QString> &attributes);
202202

@@ -283,7 +283,7 @@ class QgsVectorDataProvider : QgsDataProvider
283283
const QList< QgsVectorDataProvider::NativeType > &nativeTypes() const;
284284

285285
/**Returns the names of the numerical types
286-
@note deprecated */
286+
@deprecated */
287287
const QMap<QString,QVariant::Type> &supportedNativeTypes() const;
288288

289289
/**

python/core/qgsvectorlayer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public:
390390

391391
/** add an attribute field (but does not commit it)
392392
returns true in case of success
393-
@note deprecated
393+
@deprecated
394394
*/
395395
bool addAttribute( QString name, QString type );
396396

python/plugins/osm/OsmDatabaseManager.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,21 @@ def layerRemoved(self,layerID):
143143
key=dbFileName.toLatin1().data()
144144

145145
# remove map layers that belong to dbFileName database
146-
if key in self.lineLayers.keys() and layer.getLayerID()==self.lineLayers[key].getLayerID():
146+
if key in self.lineLayers.keys() and layer.id()==self.lineLayers[key].getLayerID():
147147
del self.lineLayers[key]
148148

149-
elif key in self.pointLayers.keys() and layer.getLayerID()==self.pointLayers[key].getLayerID():
149+
elif key in self.pointLayers.keys() and layer.id()==self.pointLayers[key].id():
150150
del self.pointLayers[key]
151151
if key in self.lineLayers.keys():
152152
if self.lineLayers[key]:
153-
lineLayID=self.lineLayers[key].getLayerID()
153+
lineLayID=self.lineLayers[key].id()
154154
self.mapReg.removeMapLayer(lineLayID,True)
155155

156-
elif key in self.polygonLayers.keys() and layer.getLayerID()==self.polygonLayers[key].getLayerID():
156+
elif key in self.polygonLayers.keys() and layer.id()==self.polygonLayers[key].id():
157157
del self.polygonLayers[key]
158158
if key in self.pointLayers.keys():
159159
if self.pointLayers[key]:
160-
pointLayID=self.pointLayers[key].getLayerID()
160+
pointLayID=self.pointLayers[key].id()
161161
self.mapReg.removeMapLayer(pointLayID,True)
162162

163163
if key in self.dbConns.keys():
@@ -177,7 +177,7 @@ def removeAllOsmLayers(self):
177177
continue
178178

179179
if layer.type()==QgsMapLayer.VectorLayer and layer.dataProvider().name()=="osm":
180-
QgsMapLayerRegistry.instance().removeMapLayer(layer.getLayerID(),True)
180+
QgsMapLayerRegistry.instance().removeMapLayer(layer.id(),True)
181181

182182
self.dbConns={} # map dbFileName->sqlite3ConnectionObject
183183
self.pointLayers={}

python/plugins/osm/OsmLoadDlg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def onOK(self):
131131

132132
if replacing:
133133
# remove layers of current data first
134-
QgsMapLayerRegistry.instance().removeMapLayer(self.canvas.currentLayer().getLayerID(),True)
134+
QgsMapLayerRegistry.instance().removeMapLayer(self.canvas.currentLayer().id(),True)
135135

136136
if self.chkCustomRenderer.isChecked():
137137
styleFile=self.styleFiles[self.styleCombo.currentIndex()]

src/app/legend/qgsapplegendinterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,5 @@ QList< QgsMapLayer * > QgsAppLegendInterface::layers() const
134134

135135
void QgsAppLegendInterface::refreshLayerSymbology( QgsMapLayer *ml )
136136
{
137-
mLegend->refreshLayerSymbology( ml->getLayerID() );
137+
mLegend->refreshLayerSymbology( ml->id() );
138138
}

src/app/legend/qgslegend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void QgsLegend::removeLayer( QString layerId )
230230
// save legend layer (parent of a legend layer file we're going to delete)
231231
QgsLegendLayer* ll = qobject_cast<QgsLegendLayer *>( li );
232232

233-
if ( ll && ll->layer() && ll->layer()->getLayerID() == layerId )
233+
if ( ll && ll->layer() && ll->layer()->id() == layerId )
234234
{
235235
removeItem( ll );
236236
delete ll;

src/app/legend/qgslegendlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ void QgsLegendLayer::updateAfterLayerModification( bool onlyGeomChanged )
540540
{
541541
widthScale = canvas->map()->paintDevice().logicalDpiX() / 25.4;
542542
}
543-
refreshSymbology( mLyr.layer()->getLayerID(), widthScale );
543+
refreshSymbology( mLyr.layer()->id(), widthScale );
544544
}
545545

546546
void QgsLegendLayer::updateItemListCountV2( SymbologyList& itemList, QgsVectorLayer* layer )

src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4920,7 +4920,7 @@ void QgisApp::layerSubsetString()
49204920
mMapCanvas->refresh();
49214921
if ( mMapLegend )
49224922
{
4923-
mMapLegend->refreshLayerSymbology( vlayer->getLayerID(), false );
4923+
mMapLegend->refreshLayerSymbology( vlayer->id(), false );
49244924
}
49254925
}
49264926
}

src/app/qgisappinterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void QgisAppInterface::refreshLegend( QgsMapLayer *l )
220220
{
221221
if ( l && qgis && qgis->legend() )
222222
{
223-
qgis->legend()->refreshLayerSymbology( l->getLayerID() );
223+
qgis->legend()->refreshLayerSymbology( l->id() );
224224
}
225225
}
226226

src/app/qgsaddjoindialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ QgsAddJoinDialog::QgsAddJoinDialog( QgsVectorLayer* layer, QWidget * parent, Qt:
4444
if ( currentVectorLayer && currentVectorLayer != mLayer )
4545
{
4646
if ( currentVectorLayer->dataProvider() && currentVectorLayer->dataProvider()->supportsSubsetString() )
47-
mJoinLayerComboBox->addItem( currentLayer->name(), QVariant( currentLayer->getLayerID() ) );
47+
mJoinLayerComboBox->addItem( currentLayer->name(), QVariant( currentLayer->id() ) );
4848
}
4949
}
5050
}

src/app/qgsattributedialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
288288
mFormNr = smFormCounter++;
289289
QgisApp::instance()->runPythonString( QString( "_qgis_featureform_%1 = wrapinstance( %2, QtGui.QDialog )" ).arg( mFormNr ).arg(( unsigned long ) mDialog ) );
290290

291-
QString expr = QString( "%1(_qgis_featureform_%2,'%3',%4)" ).arg( vl->editFormInit() ).arg( mFormNr ).arg( vl->getLayerID() ).arg( mFeature->id() );
291+
QString expr = QString( "%1(_qgis_featureform_%2,'%3',%4)" ).arg( vl->editFormInit() ).arg( mFormNr ).arg( vl->id() ).arg( mFeature->id() );
292292
QgsDebugMsg( QString( "running featureForm init: %1" ).arg( expr ) );
293293
QgisApp::instance()->runPythonString( expr );
294294
}

src/app/qgsmaptoolidentify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void QgsMapToolIdentify::canvasReleaseEvent( QMouseEvent * e )
120120
emit identifyProgress( i, mCanvas->layerCount() );
121121
emit identifyMessage( tr( "Identifying on %1..." ).arg( layer->name() ) );
122122

123-
if ( noIdentifyLayerIdList.contains( layer->getLayerID() ) )
123+
if ( noIdentifyLayerIdList.contains( layer->id() ) )
124124
continue;
125125

126126
if ( identifyLayer( layer, e->x(), e->y() ) )

src/app/qgsprojectproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
159159
twIdentifyLayers->setItem( i, 1, twi );
160160

161161
QCheckBox *cb = new QCheckBox();
162-
cb->setChecked( !noIdentifyLayerIdList.contains( currentLayer->getLayerID() ) );
162+
cb->setChecked( !noIdentifyLayerIdList.contains( currentLayer->id() ) );
163163
twIdentifyLayers->setCellWidget( i, 2, cb );
164164
}
165165

src/app/qgsrasterlayerproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ void QgsRasterLayerProperties::apply()
13931393
pixmapThumbnail->setPixmap( myQPixmap );
13941394

13951395
// update symbology
1396-
emit refreshLegend( mRasterLayer->getLayerID(), false );
1396+
emit refreshLegend( mRasterLayer->id(), false );
13971397

13981398
//no need to delete the old one, maplayer will do it if needed
13991399
mRasterLayer->setCacheImage( 0 );

src/app/qgssnappingdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void QgsSnappingDialog::update()
157157

158158
QCheckBox *cbxEnable = new QCheckBox( mLayerTreeWidget );
159159
mLayerTreeWidget->setItemWidget( item, 0, cbxEnable );
160-
item->setData( 0, Qt::UserRole, currentVectorLayer->getLayerID() );
160+
item->setData( 0, Qt::UserRole, currentVectorLayer->id() );
161161

162162
item->setText( 1, currentVectorLayer->name() );
163163

src/app/qgsvectorlayerproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ void QgsVectorLayerProperties::apply()
683683
}
684684

685685
// update symbology
686-
emit refreshLegend( layer->getLayerID(), false );
686+
emit refreshLegend( layer->id(), false );
687687

688688
//no need to delete the old one, maplayer will do it if needed
689689
layer->setCacheImage( 0 );

src/core/composer/qgscomposerattributetable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ void QgsComposerAttributeTable::removeLayer( QString layerId )
193193
{
194194
if ( mVectorLayer )
195195
{
196-
if ( layerId == mVectorLayer->getLayerID() )
196+
if ( layerId == mVectorLayer->id() )
197197
{
198198
mVectorLayer = 0;
199199
}

src/core/composer/qgslegendmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ int QgsLegendModel::addVectorLayerItems( QStandardItem* layerItem, QgsVectorLaye
210210
continue;
211211
}
212212

213-
QStandardItem* currentSymbolItem = itemFromSymbol( *symbolIt, opacity, vlayer->getLayerID() );
213+
QStandardItem* currentSymbolItem = itemFromSymbol( *symbolIt, opacity, vlayer->id() );
214214
if ( !currentSymbolItem )
215215
{
216216
continue;

src/core/qgsapplication.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class CORE_EXPORT QgsApplication: public QApplication
110110
static const QStringList svgPaths();
111111

112112
//! Returns the paths to svg applications svg directory.
113-
//! @note deprecated since 1.4
113+
//! @deprecated since 1.4
114114
static const QString svgPath();
115115

116116
//! Returns the path to the application prefix directory.

src/core/qgslabel.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ class CORE_EXPORT QgsLabel
146146
QgsFieldMap & fields( void );
147147

148148
/** Pointer to default attributes.
149-
* @note this will be deprecated in version 2 as it is
150-
* badly named. Rather use attributes.
149+
* @deprecated in version 2 as it is badly named. Rather use attributes.
151150
* @see labelAttributes method rather */
152151
QgsLabelAttributes *layerAttributes( void );
153152

src/core/qgsmaplayer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ QgsMapLayer::LayerType QgsMapLayer::type() const
9595
}
9696

9797
/** Get this layer's unique ID */
98-
QString QgsMapLayer::getLayerID() const
98+
QString QgsMapLayer::id() const
9999
{
100100
return mID;
101101
}
@@ -282,11 +282,11 @@ bool QgsMapLayer::writeXML( QDomNode & layer_node, QDomDocument & document )
282282
maplayer.setAttribute( "maximumScale", maximumScale() );
283283

284284
// ID
285-
QDomElement id = document.createElement( "id" );
286-
QDomText idText = document.createTextNode( getLayerID() );
287-
id.appendChild( idText );
285+
QDomElement layerId = document.createElement( "id" );
286+
QDomText layerIdText = document.createTextNode( id() );
287+
layerId.appendChild( layerIdText );
288288

289-
maplayer.appendChild( id );
289+
maplayer.appendChild( layerId );
290290

291291
// data source
292292
QDomElement dataSource = document.createElement( "datasource" );

src/core/qgsmaplayer.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,15 @@ class CORE_EXPORT QgsMapLayer : public QObject
6767
*/
6868
QgsMapLayer::LayerType type() const;
6969

70-
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry */
71-
QString getLayerID() const;
70+
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry
71+
* @note added in 1.7
72+
**/
73+
QString id() const;
74+
75+
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry
76+
* @deprecated use id()
77+
**/
78+
QString getLayerID() const { return id(); }
7279

7380
/** Set the display name of the layer
7481
* @param name New name for the layer

src/core/qgsmaplayerregistry.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ QgsMapLayerRegistry::addMapLayer( QgsMapLayer * theMapLayer, bool theEmitSignal
7272
}
7373

7474
//check the layer is not already registered!
75-
QMap<QString, QgsMapLayer*>::iterator myIterator = mMapLayers.find( theMapLayer->getLayerID() );
75+
QMap<QString, QgsMapLayer*>::iterator myIterator = mMapLayers.find( theMapLayer->id() );
7676
//if myIterator returns mMapLayers.end() then it does not exist in registry and its safe to add it
7777
if ( myIterator == mMapLayers.end() )
7878
{
79-
mMapLayers[theMapLayer->getLayerID()] = theMapLayer;
79+
mMapLayers[theMapLayer->id()] = theMapLayer;
8080

8181
if ( theEmitSignal )
8282
emit layerWasAdded( theMapLayer );
8383

84-
return mMapLayers[theMapLayer->getLayerID()];
84+
return mMapLayers[theMapLayer->id()];
8585
}
8686
else
8787
{

src/core/qgsmaprenderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
134134
void updateScale();
135135

136136
//! Return the measuring object
137-
//! @note deprecated.
137+
//! @deprecated
138138
QgsDistanceArea* distanceArea() { return mDistArea; }
139139
QGis::UnitType mapUnits() const;
140140
void setMapUnits( QGis::UnitType u );

0 commit comments

Comments
 (0)