Skip to content
Permalink
Browse files

fix API QgsMapLayer::getLayerID() to id()), some warnings and use dox…

…ygen deprecation tag.

git-svn-id: http://svn.osgeo.org/qgis/trunk@15168 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Feb 13, 2011
1 parent 61baa8b commit 132088f6d2e6691895a8136e4b34b87e45c301db
Showing with 221 additions and 200 deletions.
  1. +1 −1 python/core/qgsapplication.sip
  2. +1 −1 python/core/qgscomposermap.sip
  3. +2 −3 python/core/qgslabel.sip
  4. +9 −2 python/core/qgsmaplayer.sip
  5. +3 −2 python/core/qgsoverlayobject.sip
  6. +1 −1 python/core/qgsrenderer.sip
  7. +3 −3 python/core/qgssearchtreenode.sip
  8. +2 −2 python/core/qgsvectordataprovider.sip
  9. +1 −1 python/core/qgsvectorlayer.sip
  10. +6 −6 python/plugins/osm/OsmDatabaseManager.py
  11. +1 −1 python/plugins/osm/OsmLoadDlg.py
  12. +1 −1 src/app/legend/qgsapplegendinterface.cpp
  13. +1 −1 src/app/legend/qgslegend.cpp
  14. +1 −1 src/app/legend/qgslegendlayer.cpp
  15. +1 −1 src/app/qgisapp.cpp
  16. +1 −1 src/app/qgisappinterface.cpp
  17. +1 −1 src/app/qgsaddjoindialog.cpp
  18. +1 −1 src/app/qgsattributedialog.cpp
  19. +1 −1 src/app/qgsmaptoolidentify.cpp
  20. +1 −1 src/app/qgsprojectproperties.cpp
  21. +1 −1 src/app/qgsrasterlayerproperties.cpp
  22. +1 −1 src/app/qgssnappingdialog.cpp
  23. +1 −1 src/app/qgsvectorlayerproperties.cpp
  24. +1 −1 src/core/composer/qgscomposerattributetable.cpp
  25. +1 −1 src/core/composer/qgslegendmodel.cpp
  26. +1 −1 src/core/qgsapplication.h
  27. +1 −2 src/core/qgslabel.h
  28. +5 −5 src/core/qgsmaplayer.cpp
  29. +9 −2 src/core/qgsmaplayer.h
  30. +3 −3 src/core/qgsmaplayerregistry.cpp
  31. +1 −1 src/core/qgsmaprenderer.h
  32. +4 −2 src/core/qgsoverlayobject.h
  33. +2 −2 src/core/qgspallabeling.cpp
  34. +1 −1 src/core/qgspluginlayerregistry.cpp
  35. +3 −3 src/core/qgssearchtreenode.h
  36. +2 −2 src/core/qgsvectordataprovider.h
  37. +1 −1 src/core/qgsvectorfilewriter.h
  38. +6 −6 src/core/qgsvectorlayer.cpp
  39. +1 −1 src/core/qgsvectorlayer.h
  40. +1 −1 src/gui/qgisinterface.h
  41. +1 −1 src/gui/qgsformannotationitem.cpp
  42. +4 −4 src/gui/qgsmapcanvas.cpp
  43. +1 −1 src/mapserver/qgsconfigparser.cpp
  44. +1 −1 src/mapserver/qgsprojectparser.cpp
  45. +1 −1 src/mapserver/qgswmsserver.cpp
  46. +1 −1 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  47. +1 −1 src/plugins/grass/qgsgrassplugin.cpp
  48. +2 −0 src/plugins/grass/qtermwidget/TerminalDisplay.cpp
  49. +1 −1 src/plugins/offline_editing/offline_editing.cpp
  50. +1 −1 src/plugins/raster_terrain_analysis/qgsrasterterrainanalysisdialog.cpp
  51. +1 −1 src/plugins/roadgraph/exportdlg.cpp
  52. +2 −1 src/plugins/roadgraph/settingsdlg.cpp
  53. +1 −1 src/plugins/spatialquery/qgsspatialquerydialog.cpp
  54. +18 −18 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  55. +100 −97 src/providers/memory/qgsmemoryprovider.cpp
@@ -159,7 +159,7 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
static const QStringList svgPaths();

//! Returns the path to the applications svg paths
//! @note deprecated
//! @deprecated
static const QString svgPath();

//! Returns the path to the application prefix directory.
@@ -47,7 +47,7 @@ class QgsComposerMap : QgsComposerItem
BoundaryDirection
};

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

/** \brief Draw to paint device
@@ -49,7 +49,7 @@ public:


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

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

@@ -57,7 +57,14 @@ public:
*/
QgsMapLayer::LayerType type() const;

/** Get this layer's unique ID, this ID is used to access this layer from map layer registry */
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry
* @note added in 1.7
*/
QString id() const;

/** Get this layer's unique ID, this ID is used to access this layer from map layer registry
* @deprecated in 1.7
*/
QString getLayerID() const;

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

/** Returns layer's spatial reference system
@note This method is here for API compatibility
and will be deprecited in 2.0
and will be deprecated in 2.0
@see crs()
*/
const QgsCoordinateReferenceSystem& srs();
@@ -14,9 +14,10 @@ class QgsOverlayObject
//this function fill not be wrapped to not depend on geos python bindings
/**Returns the feature geometry in geos format. The calling function does _not_ take
ownership of the generated object. The geometry is in map coordinates
@note: this function is deprecated. Please use geometry() and QgsGeometry::asGeos instead*/
@deprecated Please use geometry() and QgsGeometry::asGeos instead*/
//GEOSGeometry* getGeosGeometry();
/**Feature geometry is released when object is destructed so this function is empty. This function is deprecated and does nothing*/
/**Feature geometry is released when object is destructed so this function is empty.
@deprecated nop */
//void releaseGeosGeometry( GEOSGeometry *the_geom )

//getters
@@ -40,7 +40,7 @@ class QgsRenderer
@param widthScale scale factor
@param rasterScaleFactor scale factor for rasters

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

/**A vector layer passes features to a renderer object to change the brush ans pen of the qpainter
@@ -104,7 +104,7 @@ class QgsSearchTreeNode
//! @note attributes and optional geom parameter replace with feature in 1.6
bool checkAgainst( const QMap<int,QgsField>& fields, QgsFeature &f );

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

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

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

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

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

//! strips mText when node is of string type
@@ -196,7 +196,7 @@ class QgsVectorDataProvider : QgsDataProvider
* Adds new attributes
* @param attributes map with attribute name as key and type as value
* @return true in case of success and false in case of failure
* @note deprecated
* @deprecated
*/
virtual bool addAttributes(const QMap<QString, QString> &attributes);

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

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

/**
@@ -390,7 +390,7 @@ public:

/** add an attribute field (but does not commit it)
returns true in case of success
@note deprecated
@deprecated
*/
bool addAttribute( QString name, QString type );

@@ -143,21 +143,21 @@ def layerRemoved(self,layerID):
key=dbFileName.toLatin1().data()

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

elif key in self.pointLayers.keys() and layer.getLayerID()==self.pointLayers[key].getLayerID():
elif key in self.pointLayers.keys() and layer.id()==self.pointLayers[key].id():
del self.pointLayers[key]
if key in self.lineLayers.keys():
if self.lineLayers[key]:
lineLayID=self.lineLayers[key].getLayerID()
lineLayID=self.lineLayers[key].id()
self.mapReg.removeMapLayer(lineLayID,True)

elif key in self.polygonLayers.keys() and layer.getLayerID()==self.polygonLayers[key].getLayerID():
elif key in self.polygonLayers.keys() and layer.id()==self.polygonLayers[key].id():
del self.polygonLayers[key]
if key in self.pointLayers.keys():
if self.pointLayers[key]:
pointLayID=self.pointLayers[key].getLayerID()
pointLayID=self.pointLayers[key].id()
self.mapReg.removeMapLayer(pointLayID,True)

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

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

self.dbConns={} # map dbFileName->sqlite3ConnectionObject
self.pointLayers={}
@@ -131,7 +131,7 @@ def onOK(self):

if replacing:
# remove layers of current data first
QgsMapLayerRegistry.instance().removeMapLayer(self.canvas.currentLayer().getLayerID(),True)
QgsMapLayerRegistry.instance().removeMapLayer(self.canvas.currentLayer().id(),True)

if self.chkCustomRenderer.isChecked():
styleFile=self.styleFiles[self.styleCombo.currentIndex()]
@@ -134,5 +134,5 @@ QList< QgsMapLayer * > QgsAppLegendInterface::layers() const

void QgsAppLegendInterface::refreshLayerSymbology( QgsMapLayer *ml )
{
mLegend->refreshLayerSymbology( ml->getLayerID() );
mLegend->refreshLayerSymbology( ml->id() );
}
@@ -230,7 +230,7 @@ void QgsLegend::removeLayer( QString layerId )
// save legend layer (parent of a legend layer file we're going to delete)
QgsLegendLayer* ll = qobject_cast<QgsLegendLayer *>( li );

if ( ll && ll->layer() && ll->layer()->getLayerID() == layerId )
if ( ll && ll->layer() && ll->layer()->id() == layerId )
{
removeItem( ll );
delete ll;
@@ -540,7 +540,7 @@ void QgsLegendLayer::updateAfterLayerModification( bool onlyGeomChanged )
{
widthScale = canvas->map()->paintDevice().logicalDpiX() / 25.4;
}
refreshSymbology( mLyr.layer()->getLayerID(), widthScale );
refreshSymbology( mLyr.layer()->id(), widthScale );
}

void QgsLegendLayer::updateItemListCountV2( SymbologyList& itemList, QgsVectorLayer* layer )
@@ -4920,7 +4920,7 @@ void QgisApp::layerSubsetString()
mMapCanvas->refresh();
if ( mMapLegend )
{
mMapLegend->refreshLayerSymbology( vlayer->getLayerID(), false );
mMapLegend->refreshLayerSymbology( vlayer->id(), false );
}
}
}
@@ -220,7 +220,7 @@ void QgisAppInterface::refreshLegend( QgsMapLayer *l )
{
if ( l && qgis && qgis->legend() )
{
qgis->legend()->refreshLayerSymbology( l->getLayerID() );
qgis->legend()->refreshLayerSymbology( l->id() );
}
}

@@ -44,7 +44,7 @@ QgsAddJoinDialog::QgsAddJoinDialog( QgsVectorLayer* layer, QWidget * parent, Qt:
if ( currentVectorLayer && currentVectorLayer != mLayer )
{
if ( currentVectorLayer->dataProvider() && currentVectorLayer->dataProvider()->supportsSubsetString() )
mJoinLayerComboBox->addItem( currentLayer->name(), QVariant( currentLayer->getLayerID() ) );
mJoinLayerComboBox->addItem( currentLayer->name(), QVariant( currentLayer->id() ) );
}
}
}
@@ -288,7 +288,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
mFormNr = smFormCounter++;
QgisApp::instance()->runPythonString( QString( "_qgis_featureform_%1 = wrapinstance( %2, QtGui.QDialog )" ).arg( mFormNr ).arg(( unsigned long ) mDialog ) );

QString expr = QString( "%1(_qgis_featureform_%2,'%3',%4)" ).arg( vl->editFormInit() ).arg( mFormNr ).arg( vl->getLayerID() ).arg( mFeature->id() );
QString expr = QString( "%1(_qgis_featureform_%2,'%3',%4)" ).arg( vl->editFormInit() ).arg( mFormNr ).arg( vl->id() ).arg( mFeature->id() );
QgsDebugMsg( QString( "running featureForm init: %1" ).arg( expr ) );
QgisApp::instance()->runPythonString( expr );
}
@@ -120,7 +120,7 @@ void QgsMapToolIdentify::canvasReleaseEvent( QMouseEvent * e )
emit identifyProgress( i, mCanvas->layerCount() );
emit identifyMessage( tr( "Identifying on %1..." ).arg( layer->name() ) );

if ( noIdentifyLayerIdList.contains( layer->getLayerID() ) )
if ( noIdentifyLayerIdList.contains( layer->id() ) )
continue;

if ( identifyLayer( layer, e->x(), e->y() ) )
@@ -159,7 +159,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
twIdentifyLayers->setItem( i, 1, twi );

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

@@ -1393,7 +1393,7 @@ void QgsRasterLayerProperties::apply()
pixmapThumbnail->setPixmap( myQPixmap );

// update symbology
emit refreshLegend( mRasterLayer->getLayerID(), false );
emit refreshLegend( mRasterLayer->id(), false );

//no need to delete the old one, maplayer will do it if needed
mRasterLayer->setCacheImage( 0 );
@@ -157,7 +157,7 @@ void QgsSnappingDialog::update()

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

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

@@ -683,7 +683,7 @@ void QgsVectorLayerProperties::apply()
}

// update symbology
emit refreshLegend( layer->getLayerID(), false );
emit refreshLegend( layer->id(), false );

//no need to delete the old one, maplayer will do it if needed
layer->setCacheImage( 0 );
@@ -193,7 +193,7 @@ void QgsComposerAttributeTable::removeLayer( QString layerId )
{
if ( mVectorLayer )
{
if ( layerId == mVectorLayer->getLayerID() )
if ( layerId == mVectorLayer->id() )
{
mVectorLayer = 0;
}
@@ -210,7 +210,7 @@ int QgsLegendModel::addVectorLayerItems( QStandardItem* layerItem, QgsVectorLaye
continue;
}

QStandardItem* currentSymbolItem = itemFromSymbol( *symbolIt, opacity, vlayer->getLayerID() );
QStandardItem* currentSymbolItem = itemFromSymbol( *symbolIt, opacity, vlayer->id() );
if ( !currentSymbolItem )
{
continue;
@@ -110,7 +110,7 @@ class CORE_EXPORT QgsApplication: public QApplication
static const QStringList svgPaths();

//! Returns the paths to svg applications svg directory.
//! @note deprecated since 1.4
//! @deprecated since 1.4
static const QString svgPath();

//! Returns the path to the application prefix directory.
@@ -146,8 +146,7 @@ class CORE_EXPORT QgsLabel
QgsFieldMap & fields( void );

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

@@ -95,7 +95,7 @@ QgsMapLayer::LayerType QgsMapLayer::type() const
}

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

// ID
QDomElement id = document.createElement( "id" );
QDomText idText = document.createTextNode( getLayerID() );
id.appendChild( idText );
QDomElement layerId = document.createElement( "id" );
QDomText layerIdText = document.createTextNode( id() );
layerId.appendChild( layerIdText );

maplayer.appendChild( id );
maplayer.appendChild( layerId );

// data source
QDomElement dataSource = document.createElement( "datasource" );
@@ -67,8 +67,15 @@ class CORE_EXPORT QgsMapLayer : public QObject
*/
QgsMapLayer::LayerType type() const;

/** Get this layer's unique ID, this ID is used to access this layer from map layer registry */
QString getLayerID() const;
/** Get this layer's unique ID, this ID is used to access this layer from map layer registry
* @note added in 1.7
**/
QString id() const;

/** Get this layer's unique ID, this ID is used to access this layer from map layer registry
* @deprecated use id()
**/
QString getLayerID() const { return id(); }

/** Set the display name of the layer
* @param name New name for the layer
@@ -72,16 +72,16 @@ QgsMapLayerRegistry::addMapLayer( QgsMapLayer * theMapLayer, bool theEmitSignal
}

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

if ( theEmitSignal )
emit layerWasAdded( theMapLayer );

return mMapLayers[theMapLayer->getLayerID()];
return mMapLayers[theMapLayer->id()];
}
else
{
@@ -134,7 +134,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
void updateScale();

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

0 comments on commit 132088f

Please sign in to comment.
You can’t perform that action at this time.