Skip to content
Permalink
Browse files
add QGISDEPRECATED macro and fix a bunch of warnings
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15197 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 18, 2011
1 parent 0a32a04 commit 007cc0704e7e8df9c4fd32891c6458f62f04e71b
Showing with 340 additions and 274 deletions.
  1. +11 −0 cmake/SIPMacros.cmake
  2. +18 −0 python/core/conversions.sip
  3. +0 −2 python/pyspatialite/src/statement.c
  4. +9 −0 src/analysis/CMakeLists.txt
  5. +3 −0 src/app/CMakeLists.txt
  6. +12 −12 src/app/legend/qgslegend.cpp
  7. +2 −2 src/app/qgssnappingdialog.cpp
  8. +1 −1 src/core/composer/qgscomposerattributetable.cpp
  9. +2 −2 src/core/composer/qgslegendmodel.cpp
  10. +14 −0 src/core/qgis.h
  11. +3 −1 src/core/qgsapplication.h
  12. +6 −6 src/core/qgslabel.h
  13. +2 −1 src/core/qgsmaplayer.h
  14. +1 −1 src/core/qgsmaprenderer.h
  15. +2 −2 src/core/qgsoverlayobject.h
  16. +8 −7 src/core/qgssearchtreenode.h
  17. +7 −3 src/core/qgsvectordataprovider.cpp
  18. +3 −3 src/core/qgsvectordataprovider.h
  19. +9 −9 src/core/qgsvectorfilewriter.h
  20. +5 −4 src/core/qgsvectorlayer.cpp
  21. +1 −1 src/core/qgsvectorlayer.h
  22. +5 −0 src/gui/CMakeLists.txt
  23. +13 −5 src/gui/qgisinterface.h
  24. +3 −3 src/gui/qgsmapcanvasmap.h
  25. +1 −1 src/mapserver/qgis_map_serv.cpp
  26. +1 −1 src/mapserver/qgscomparisonfilter.cpp
  27. +2 −2 src/mapserver/qgsprojectparser.cpp
  28. +1 −1 src/mapserver/qgssldparser.cpp
  29. +3 −3 src/mapserver/qgswmsserver.cpp
  30. +3 −2 src/plugins/diagram_overlay/qgsdiagramoverlayplugin.cpp
  31. +2 −2 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  32. +2 −2 src/plugins/offline_editing/offline_editing.cpp
  33. +42 −54 src/plugins/ogr_converter/ogrconverterguibase.ui
  34. +1 −1 src/plugins/spatialquery/qgsspatialquerydialog.cpp
  35. +124 −123 src/plugins/sqlanywhere/sanewconnectionbase.ui
  36. +5 −5 src/providers/sqlanywhere/qgssqlanywhereprovider.cpp
  37. +1 −0 src/providers/sqlanywhere/sqlanyconnection/CMakeLists.txt
  38. +1 −1 tests/src/core/regression992.cpp
  39. +1 −1 tests/src/core/testqgsmaprenderer.cpp
  40. +4 −4 tests/src/core/testqgsrasterlayer.cpp
  41. +3 −3 tests/src/core/testqgsrenderers.cpp
  42. +3 −3 tests/src/core/testqgsvectorlayer.cpp
@@ -85,6 +85,17 @@ MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)
ENDIF( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} )
ENDFOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} )

# Suppress warnings
IF(MSVC AND PEDANTIC)
# 4996 deprecation warnings (bindings re-export deprecated methods)
# 4701 potentially uninitialized variable used (sip generated code)
# 4702 unreachable code (sip generated code)
ADD_DEFINITIONS( /wd4996 /wd4701 /wd4702 )
ELSE(MSVC)
# disable all warnings
ADD_DEFINITIONS( -w )
ENDIF(MSVC)

ADD_CUSTOM_COMMAND(
OUTPUT ${_sip_output_files}
COMMAND ${CMAKE_COMMAND} -E echo ${message}
@@ -36,6 +36,8 @@ template <TYPE>
#include <QVector>
#if (SIP_VERSION >= 0x040900)
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
#endif
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c00)
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
@@ -116,6 +118,8 @@ template <TYPE>
#include <QVector>
#if (SIP_VERSION >= 0x040900)
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
#endif
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c00)
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
@@ -274,6 +278,8 @@ template <TYPE>
#include <QSet>
#if (SIP_VERSION >= 0x040900)
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
#endif
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c00)
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
@@ -329,6 +335,8 @@ template <TYPE>
#include <QSet>
#if (SIP_VERSION >= 0x040900)
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
#endif
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c00)
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
@@ -404,6 +412,8 @@ template<TYPE>
#include <QMap>
#if (SIP_VERSION >= 0x040900)
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
#endif
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c00)
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
@@ -525,6 +535,8 @@ template<TYPE>
#include <QMap>
#if (SIP_VERSION >= 0x040900)
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
#endif
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c00)
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
@@ -630,6 +642,8 @@ template<TYPE1, TYPE2>
#include <QMap>
#if (SIP_VERSION >= 0x040900)
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
#endif
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c00)
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
@@ -842,6 +856,8 @@ template<double, TYPE2>
#include <QMultiMap>
#if (SIP_VERSION >= 0x040900)
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
#endif
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c00)
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
@@ -964,6 +980,8 @@ template<double, TYPE2>
#include <QMap>
#if (SIP_VERSION >= 0x040900)
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
#endif
#if (SIP_VERSION >= 0x040900 && SIP_VERSION < 0x040c00)
#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
@@ -490,8 +490,6 @@ static int pysqlite_check_remaining_sql(const char* tail)

pos++;
}

return 0;
}

PyTypeObject pysqlite_StatementType = {
@@ -42,6 +42,15 @@ ADD_FLEX_FILES_PREFIX(QGIS_ANALYSIS_SRCS raster raster/qgsrastercalclexer.ll)

ADD_BISON_FILES_PREFIX(QGIS_ANALYSIS_SRCS raster raster/qgsrastercalcparser.yy)

IF (MSVC AND PEDANTIC)
# disable warnings
# 4065 switch with default and no case
# 4702 unreachable code
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/analysis/qgsrastercalcparser.cpp
PROPERTIES COMPILE_FLAGS "-wd4065 -wd4702")
ENDIF (MSVC AND PEDANTIC)

SET(QGIS_ANALYSIS_MOC_HDRS
)

@@ -321,6 +321,9 @@ QT4_WRAP_CPP(QGIS_APP_MOC_SRCS ${QGIS_APP_MOC_HDRS})
IF (WIN32)
IF (MSVC)
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc)

# disable deprecation warnings
SET_SOURCE_FILES_PROPERTIES(qgisappinterface.cpp PROPERTIES COMPILE_FLAGS /wd4996)
ELSE(MSVC)

# Icon for windows MINGW
@@ -626,7 +626,7 @@ void QgsLegend::addLayer( QgsMapLayer * layer )

setItemExpanded( llayer, true );

refreshLayerSymbology( layer->getLayerID() );
refreshLayerSymbology( layer->id() );

updateMapCanvasLayerSet();

@@ -738,7 +738,7 @@ void QgsLegend::removeGroup( QgsLegendGroup *lg )
QgsLegendGroup *cg = dynamic_cast<QgsLegendGroup *>( child );

if ( cl )
QgsMapLayerRegistry::instance()->removeMapLayer( cl->layer()->getLayerID() );
QgsMapLayerRegistry::instance()->removeMapLayer( cl->layer()->id() );
else if ( cg )
removeGroup( cg );

@@ -755,7 +755,7 @@ void QgsLegend::moveLayer( QgsMapLayer *ml, int groupIndex )
if ( !ml )
return;

QgsLegendLayer *layer = findLegendLayer( ml->getLayerID() );
QgsLegendLayer *layer = findLegendLayer( ml->id() );
if ( !layer )
return;

@@ -915,7 +915,7 @@ bool QgsLegend::writeXML( QList<QTreeWidgetItem *> items, QDomNode &node, QDomDo
QDomElement legendlayerfilenode = document.createElement( "legendlayerfile" );

// layer id
legendlayerfilenode.setAttribute( "layerid", layer->getLayerID() );
legendlayerfilenode.setAttribute( "layerid", layer->id() );
layerfilegroupnode.appendChild( legendlayerfilenode );

// visible flag
@@ -1022,7 +1022,7 @@ bool QgsLegend::readXML( QgsLegendGroup *parent, const QDomNode &node )
}

// load symbology
refreshLayerSymbology( currentLayer->layer()->getLayerID() );
refreshLayerSymbology( currentLayer->layer()->id() );

if ( isOpen )
{
@@ -1101,7 +1101,7 @@ QgsLegendLayer* QgsLegend::findLegendLayer( const QString& layerKey )
theLegendLayer = dynamic_cast<QgsLegendLayer *>( theItem );
if ( theLegendLayer ) //item is a legend layer
{
if ( theLegendLayer->layer()->getLayerID() == layerKey )
if ( theLegendLayer->layer()->id() == layerKey )
{
return theLegendLayer;
}
@@ -1221,7 +1221,7 @@ QList< GroupLayerInfo > QgsLegend::groupLayerRelationship()
if ( lLayer->layer() )
{
QList<QString> layerList;
layerList.push_back( lLayer->layer()->getLayerID() );
layerList.push_back( lLayer->layer()->id() );
groupLayerList.push_back( qMakePair( QString(), layerList ) );
}
}
@@ -1240,7 +1240,7 @@ QList< GroupLayerInfo > QgsLegend::groupLayerRelationship()
{
if ( lLayer->layer() )
{
layerList.push_back( lLayer->layer()->getLayerID() );
layerList.push_back( lLayer->layer()->id() );
}
}

@@ -1449,7 +1449,7 @@ QStringList QgsLegend::layerIDs()
if ( ll )
{
QgsMapLayer *lyr = ll->layer();
layers.push_front( lyr->getLayerID() );
layers.push_front( lyr->id() );
}
}

@@ -1729,8 +1729,8 @@ void QgsLegend::legendLayerStretchUsingCurrentExtent()
}

layer->setMinimumMaximumUsingLastExtent();
layer->setCacheImage(NULL);
refreshLayerSymbology( layer->getLayerID() );
layer->setCacheImage( NULL );
refreshLayerSymbology( layer->id() );
mMapCanvas->refresh();
}
}
@@ -1847,7 +1847,7 @@ void QgsLegend::removeSelectedLayers()
QgsLegendLayer *ll = dynamic_cast<QgsLegendLayer *>( item );
if ( ll && ll->layer() )
{
QgsMapLayerRegistry::instance()->removeMapLayer( ll->layer()->getLayerID() );
QgsMapLayerRegistry::instance()->removeMapLayer( ll->layer()->id() );
continue;
}
}
@@ -191,7 +191,7 @@ void QgsSnappingDialog::update()
mLayerTreeWidget->setItemWidget( item, 5, cbxAvoidIntersection );
}

int idx = layerIdList.indexOf( currentVectorLayer->getLayerID() );
int idx = layerIdList.indexOf( currentVectorLayer->id() );
if ( idx < 0 )
{
// no settings for this layer yet
@@ -218,7 +218,7 @@ void QgsSnappingDialog::update()
cbxUnits->setCurrentIndex( toleranceUnitList[idx].toInt() );
if ( cbxAvoidIntersection )
{
cbxAvoidIntersection->setChecked( avoidIntersectionsList.contains( currentVectorLayer->getLayerID() ) );
cbxAvoidIntersection->setChecked( avoidIntersectionsList.contains( currentVectorLayer->id() ) );
}
}

@@ -231,7 +231,7 @@ bool QgsComposerAttributeTable::writeXML( QDomElement& elem, QDomDocument & doc
}
if ( mVectorLayer )
{
composerTableElem.setAttribute( "vectorLayer", mVectorLayer->getLayerID() );
composerTableElem.setAttribute( "vectorLayer", mVectorLayer->id() );
}

//display attributes
@@ -242,7 +242,7 @@ int QgsLegendModel::addRasterLayerItem( QStandardItem* layerItem, QgsMapLayer* r
{
currentSymbolItem->setIcon( QIcon( rasterLayer->legendAsPixmap( true ) ) );
}
currentSymbolItem->setLayerID( rasterLayer->getLayerID() );
currentSymbolItem->setLayerID( rasterLayer->id() );
int currentRowCount = layerItem->rowCount();
layerItem->setChild( currentRowCount, 0, currentSymbolItem );

@@ -338,7 +338,7 @@ void QgsLegendModel::addLayer( QgsMapLayer* theMapLayer )
}

QgsComposerLayerItem* layerItem = new QgsComposerLayerItem( theMapLayer->name() );
layerItem->setLayerID( theMapLayer->getLayerID() );
layerItem->setLayerID( theMapLayer->id() );
layerItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );

invisibleRootItem()->setChild( invisibleRootItem()->rowCount(), layerItem );
@@ -189,4 +189,18 @@ const double DEFAULT_LINE_WIDTH = 0.26;
#endif
#endif

#ifndef QGISDEPRECATED
#ifndef Q_MOC_RUN
#ifdef _MSC_VER
# define QGISDEPRECATED __declspec(deprecated)
#elif __GNUC__
# define QGISDEPRECATED __attribute__((__deprecated__))
#else
# define QGISDEPRECATED
#endif
#else
#define QGISDEPRECATED
#endif
#endif

#endif
@@ -18,6 +18,8 @@

#include <QApplication>

#include <qgis.h>

/** \ingroup core
* Extends QApplication to provide access to QGIS specific resources such
* as theme paths, database paths etc.
@@ -111,7 +113,7 @@ class CORE_EXPORT QgsApplication: public QApplication

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

//! Returns the path to the application prefix directory.
static const QString prefixPath();
@@ -103,11 +103,11 @@ class CORE_EXPORT QgsLabel
* \param rasterScaleFactor raster scale
* \deprecated
*/
void renderLabel( QPainter* painter, const QgsRectangle& viewExtent,
QgsCoordinateTransform* coordinateTransform,
const QgsMapToPixel *transform,
QgsFeature &feature, bool selected, QgsLabelAttributes *classAttributes = 0,
double sizeScale = 1., double rasterScaleFactor = 1.0 )
QGISDEPRECATED void renderLabel( QPainter* painter, const QgsRectangle& viewExtent,
QgsCoordinateTransform* coordinateTransform,
const QgsMapToPixel *transform,
QgsFeature &feature, bool selected, QgsLabelAttributes *classAttributes = 0,
double sizeScale = 1., double rasterScaleFactor = 1.0 )
{
QgsRenderContext r;
r.setExtent( viewExtent );
@@ -148,7 +148,7 @@ class CORE_EXPORT QgsLabel
/** Pointer to default attributes.
* @deprecated in version 2 as it is badly named. Rather use attributes.
* @see labelAttributes method rather */
QgsLabelAttributes *layerAttributes( void );
QGISDEPRECATED QgsLabelAttributes *layerAttributes( void );

/** Pointer to default attributes.
* @note this replaces the to-be-deprecated layerAttributes method.
@@ -25,6 +25,7 @@
#include <QVariant>
#include <QImage>

#include "qgis.h"
#include "qgsrectangle.h"

class QgsRenderContext;
@@ -75,7 +76,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
/** 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(); }
QGISDEPRECATED QString getLayerID() const { return id(); }

/** Set the display name of the layer
* @param name New name for the layer
@@ -135,7 +135,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject

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

@@ -43,11 +43,11 @@ class CORE_EXPORT QgsOverlayObject
/**Returns the feature geometry in geos format. The calling function does _not_ take
ownership of the generated object. The geometry is in map coordinates
@deprecated Please use geometry() and QgsGeometry::asGeos instead*/
GEOSGeometry* getGeosGeometry();
QGISDEPRECATED GEOSGeometry* getGeosGeometry();
/**Feature geometry is released when object is destructed so this function is empty.
* @deprecated nop
*/
void releaseGeosGeometry( GEOSGeometry *the_geom ) { Q_UNUSED( the_geom ); }
QGISDEPRECATED void releaseGeosGeometry( GEOSGeometry *the_geom ) { Q_UNUSED( the_geom ); }

//getters
int width() const {return mWidth;}
Loading

0 comments on commit 007cc07

Please sign in to comment.