From 8ae76518af8ead6efc7b3dcd19a75618e6603755 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Sat, 11 Feb 2012 16:56:51 +0100 Subject: [PATCH] fix warnings from clang/gcc 4.7 --- python/core/qgsmaplayer.sip | 2 +- src/analysis/interpolation/TriDecorator.h | 4 ++-- src/analysis/raster/qgsrastercalcparser.yy | 1 + src/analysis/vector/qgsgeometryanalyzer.cpp | 1 + src/analysis/vector/qgsgeometryanalyzer.h | 2 +- src/app/legend/qgslegend.cpp | 4 ++-- src/app/legend/qgslegend.h | 2 +- src/app/main.cpp | 1 + src/core/pal/hashtable.hpp | 2 +- src/core/qgscoordinatereferencesystem.cpp | 1 + src/core/qgsdataprovider.h | 4 ++-- src/core/qgsdiagram.h | 1 + src/core/qgsexpression.h | 6 +++--- src/core/qgsmaplayer.cpp | 4 ++-- src/core/qgsmaplayer.h | 5 ++--- src/core/qgssearchstringparser.yy | 1 + src/core/raster/qgsrasterlayer.cpp | 2 +- src/core/raster/qgsrasterlayer.h | 8 ++++---- src/core/renderer/qgsgraduatedsymbolrenderer.cpp | 2 +- src/core/spatialite/spatialite.c | 2 +- src/core/symbology-ng/qgsrendererv2registry.h | 1 + src/core/symbology-ng/qgsrulebasedrendererv2.cpp | 4 ++++ src/core/symbology-ng/qgssymbollayerv2registry.h | 2 ++ .../attributetable/qgsattributetablememorymodel.cpp | 3 ++- .../attributetable/qgsattributetablememorymodel.h | 3 ++- .../symbology-ng/qgsrulebasedrendererv2widget.cpp | 2 ++ src/mapserver/qgswmsserver.cpp | 2 +- src/plugins/georeferencer/qgsleastsquares.cpp | 12 ++++++------ src/plugins/globe/globe_plugin.h | 1 + src/plugins/globe/qgsosgearthtilesource.cpp | 4 ++-- src/plugins/globe/qgsosgearthtilesource.h | 5 ++--- src/plugins/grass/qgsgrassedit.cpp | 2 +- src/plugins/grass/qgsgrassmapcalc.cpp | 2 +- src/plugins/grass/qgsgrassmapcalc.h | 2 +- src/plugins/grass/qtermwidget/Screen.cpp | 1 + src/plugins/grass/qtermwidget/ShellCommand.cpp | 2 +- src/plugins/heatmap/heatmapgui.cpp | 4 ++++ src/providers/grass/qgsgrassprovider.cpp | 2 +- src/providers/grass/qgsgrassprovider.h | 2 +- src/providers/mssql/qgsmssqlprovider.cpp | 2 ++ src/providers/mssql/qgsmssqltablemodel.cpp | 4 +++- src/providers/osm/osmhandler.cpp | 5 +---- src/providers/osm/osmhandler.h | 2 +- src/providers/postgres/qgspgtablemodel.cpp | 4 +++- src/providers/postgres/qgspostgresprovider.cpp | 4 +--- src/providers/sqlanywhere/qgssqlanywhereprovider.cpp | 2 +- src/providers/sqlanywhere/qgssqlanywhereprovider.h | 2 +- src/providers/wfs/qgswfsprovider.cpp | 11 ++++++----- src/providers/wfs/qgswfsprovider.h | 6 +++--- src/providers/wms/qgswmsprovider.h | 4 ++-- 50 files changed, 90 insertions(+), 67 deletions(-) diff --git a/python/core/qgsmaplayer.sip b/python/core/qgsmaplayer.sip index d0decd42b6d3..dd4e6f0b8b60 100644 --- a/python/core/qgsmaplayer.sip +++ b/python/core/qgsmaplayer.sip @@ -168,7 +168,7 @@ public: @returns true if successful */ - bool writeXML(QDomNode & layer_node, QDomDocument & document) const; + bool writeXML(QDomNode & layer_node, QDomDocument & document); /** Set a custom property for layer. Properties are stored in a map and saved in project file. * @note Added in v1.4 */ diff --git a/src/analysis/interpolation/TriDecorator.h b/src/analysis/interpolation/TriDecorator.h index 3cc7c51df8a7..f0dd34cc7822 100644 --- a/src/analysis/interpolation/TriDecorator.h +++ b/src/analysis/interpolation/TriDecorator.h @@ -36,8 +36,8 @@ class TriDecorator: public Triangulation virtual bool calcPoint( double x, double y, Point3D* result ); virtual Point3D* getPoint( unsigned int i ) const; virtual int getNumberOfPoints() const; - virtual bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ); - virtual bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 ); + bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ); + bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 ); virtual int getOppositePoint( int p1, int p2 ); virtual QList* getSurroundingTriangles( int pointno ); virtual double getXMax() const; diff --git a/src/analysis/raster/qgsrastercalcparser.yy b/src/analysis/raster/qgsrastercalcparser.yy index 5494191e5023..6bbf1f0cbc3f 100644 --- a/src/analysis/raster/qgsrastercalcparser.yy +++ b/src/analysis/raster/qgsrastercalcparser.yy @@ -110,6 +110,7 @@ void addToTmpNodes(QgsRasterCalcNode* node) void joinTmpNodes(QgsRasterCalcNode* parent, QgsRasterCalcNode* left, QgsRasterCalcNode* right) { bool res; + Q_UNUSED( res ); if (left) { diff --git a/src/analysis/vector/qgsgeometryanalyzer.cpp b/src/analysis/vector/qgsgeometryanalyzer.cpp index f5d29dee3cd4..91d1ff9ad700 100644 --- a/src/analysis/vector/qgsgeometryanalyzer.cpp +++ b/src/analysis/vector/qgsgeometryanalyzer.cpp @@ -1175,6 +1175,7 @@ QgsPoint QgsGeometryAnalyzer::createPointOffset( double x, double y, double dist normalY *= ( dist / normalLength ); double debugLength = sqrt( normalX * normalX + normalY * normalY ); //control + Q_UNUSED( debugLength ); return QgsPoint( x - normalX, y - normalY ); //negative values -> left side, positive values -> right side } diff --git a/src/analysis/vector/qgsgeometryanalyzer.h b/src/analysis/vector/qgsgeometryanalyzer.h index 6fe75587edd5..1c546b1be64e 100644 --- a/src/analysis/vector/qgsgeometryanalyzer.h +++ b/src/analysis/vector/qgsgeometryanalyzer.h @@ -148,7 +148,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer bool forceSingleType = false ); /**Create geometry offset relative to line geometry. @param geom the geometry to modify - @param the line geometry to wich the feature is referenced + @param lineGeom the line geometry to wich the feature is referenced @param offset the offset value in layer unit. Negativ value means offset towards left, positive value is offset to the right side*/ void createOffsetGeometry( QgsGeometry* geom, QgsGeometry* lineGeom, double offset ); QgsPoint createPointOffset( double x, double y, double dist, QgsGeometry* lineGeom ) const; diff --git a/src/app/legend/qgslegend.cpp b/src/app/legend/qgslegend.cpp index 324ebba7fc9b..f9d553dc8d4c 100644 --- a/src/app/legend/qgslegend.cpp +++ b/src/app/legend/qgslegend.cpp @@ -244,7 +244,7 @@ void QgsLegend::removeAll() mDropTarget = 0; } -void QgsLegend::selectAll( bool select ) +void QgsLegend::selectAll( bool visible ) { if ( !mMapCanvas || mMapCanvas->isDrawing() ) { @@ -259,7 +259,7 @@ void QgsLegend::selectAll( bool select ) QgsLegendItem* litem = dynamic_cast( theItem ); if ( litem && litem->type() == QgsLegendItem::LEGEND_LAYER ) { - theItem->setCheckState( 0, select ? Qt::Checked : Qt::Unchecked ); + theItem->setCheckState( 0, visible ? Qt::Checked : Qt::Unchecked ); handleItemChange( theItem, 0 ); } } diff --git a/src/app/legend/qgslegend.h b/src/app/legend/qgslegend.h index 53dddf7485e5..13f7e9647999 100644 --- a/src/app/legend/qgslegend.h +++ b/src/app/legend/qgslegend.h @@ -227,7 +227,7 @@ class QgsLegend : public QTreeWidget * the legend, and in the map. * @return void */ - void selectAll( bool select ); + void selectAll( bool visible ); /*! * Slot called when user wishes to add a new empty layer group to the legend. diff --git a/src/app/main.cpp b/src/app/main.cpp index 8aae12733e6b..5e8ff2307113 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -75,6 +75,7 @@ typedef SInt32 SRefCon; #include "qgslogger.h" #if defined(linux) && ! defined(ANDROID) +#include #include #endif diff --git a/src/core/pal/hashtable.hpp b/src/core/pal/hashtable.hpp index e09589f6024e..ac49667b4d49 100644 --- a/src/core/pal/hashtable.hpp +++ b/src/core/pal/hashtable.hpp @@ -230,7 +230,7 @@ namespace pal template - bool HashTable::removeElement( const char * key ) + bool HashTable::removeElement( const char * ) { // TODO: Remove the element that has this key from the hash table. // Return true if the entry is found or false otherwise. diff --git a/src/core/qgscoordinatereferencesystem.cpp b/src/core/qgscoordinatereferencesystem.cpp index 65e97deea954..cf7e52a46380 100644 --- a/src/core/qgscoordinatereferencesystem.cpp +++ b/src/core/qgscoordinatereferencesystem.cpp @@ -299,6 +299,7 @@ bool QgsCoordinateReferenceSystem::axisInverted() const { OGRAxisOrientation orientation; const char *axis0 = OSRGetAxis( mCRS, mGeoFlag ? "GEOGCS" : "PROJCS", 0, &orientation ); + Q_UNUSED( axis0 ); mAxisInverted = mGeoFlag ? ( orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other ) : ( orientation == OAO_North || orientation == OAO_South ); diff --git a/src/core/qgsdataprovider.h b/src/core/qgsdataprovider.h index 17abd56a8693..70c4b29a0d25 100644 --- a/src/core/qgsdataprovider.h +++ b/src/core/qgsdataprovider.h @@ -191,7 +191,7 @@ class CORE_EXPORT QgsDataProvider : public QObject * (in order from bottom to top) * \note layers must have been previously added. */ - virtual void setLayerOrder( QStringList layers ) + virtual void setLayerOrder( const QStringList &layers ) { //prevent unused var warnings if ( layers.count() < 1 ) @@ -205,7 +205,7 @@ class CORE_EXPORT QgsDataProvider : public QObject /** * Set the visibility of the given sublayer name */ - virtual void setSubLayerVisibility( QString name, bool vis ) + virtual void setSubLayerVisibility( const QString &name, bool vis ) { //prevent unused var warnings if ( name.isEmpty() || !vis ) diff --git a/src/core/qgsdiagram.h b/src/core/qgsdiagram.h index d532a0ddb332..4991c0d800e8 100644 --- a/src/core/qgsdiagram.h +++ b/src/core/qgsdiagram.h @@ -15,6 +15,7 @@ class QgsRenderContext; class CORE_EXPORT QgsDiagram { public: + virtual ~QgsDiagram() {} /**Draws the diagram at the given position (in pixel coordinates)*/ virtual void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) = 0; virtual QString diagramName() const = 0; diff --git a/src/core/qgsexpression.h b/src/core/qgsexpression.h index d8d7a4eab497..617ae6d9d042 100644 --- a/src/core/qgsexpression.h +++ b/src/core/qgsexpression.h @@ -242,7 +242,7 @@ class CORE_EXPORT QgsExpression { public: NodeList() {} - ~NodeList() { foreach( Node* n, mList ) delete n; } + virtual ~NodeList() { foreach( Node* n, mList ) delete n; } void append( Node* node ) { mList.append( node ); } int count() { return mList.count(); } QList list() { return mList; } @@ -314,7 +314,7 @@ class CORE_EXPORT QgsExpression { public: NodeInOperator( Node* node, NodeList* list, bool notin = false ) : mNode( node ), mList( list ), mNotIn( notin ) {} - ~NodeInOperator() { delete mNode; delete mList; } + virtual ~NodeInOperator() { delete mNode; delete mList; } Node* node() { return mNode; } bool isNotIn() { return mNotIn; } @@ -341,7 +341,7 @@ class CORE_EXPORT QgsExpression public: NodeFunction( int fnIndex, NodeList* args ): mFnIndex( fnIndex ), mArgs( args ) {} //NodeFunction( QString name, NodeList* args ) : mName(name), mArgs(args) {} - ~NodeFunction() { delete mArgs; } + virtual ~NodeFunction() { delete mArgs; } int fnIndex() { return mFnIndex; } NodeList* args() { return mArgs; } diff --git a/src/core/qgsmaplayer.cpp b/src/core/qgsmaplayer.cpp index 1bb927c7b3f6..3db1cea8d6a6 100644 --- a/src/core/qgsmaplayer.cpp +++ b/src/core/qgsmaplayer.cpp @@ -480,12 +480,12 @@ float QgsMapLayer::maximumScale() } -QStringList QgsMapLayer::subLayers() +QStringList QgsMapLayer::subLayers() const { return QStringList(); // Empty } -void QgsMapLayer::setLayerOrder( QStringList layers ) +void QgsMapLayer::setLayerOrder( const QStringList &layers ) { Q_UNUSED( layers ); // NOOP diff --git a/src/core/qgsmaplayer.h b/src/core/qgsmaplayer.h index 2544a160bad2..eb164559ae35 100644 --- a/src/core/qgsmaplayer.h +++ b/src/core/qgsmaplayer.h @@ -132,18 +132,17 @@ class CORE_EXPORT QgsMapLayer : public QObject * Returns the sublayers of this layer * (Useful for providers that manage their own layers, such as WMS) */ - virtual QStringList subLayers(); + virtual QStringList subLayers() const; /** * Reorders the *previously selected* sublayers of this layer from bottom to top * (Useful for providers that manage their own layers, such as WMS) */ - virtual void setLayerOrder( QStringList layers ); + virtual void setLayerOrder( const QStringList &layers ); /** Set the visibility of the given sublayer name */ virtual void setSubLayerVisibility( QString name, bool vis ); - /** True if the layer can be edited */ virtual bool isEditable() const; diff --git a/src/core/qgssearchstringparser.yy b/src/core/qgssearchstringparser.yy index ddaaa8dad216..f904e4426597 100644 --- a/src/core/qgssearchstringparser.yy +++ b/src/core/qgssearchstringparser.yy @@ -215,6 +215,7 @@ void addToTmpNodes(QgsSearchTreeNode* node) void joinTmpNodes(QgsSearchTreeNode* parent, QgsSearchTreeNode* left, QgsSearchTreeNode* right) { bool res; + Q_UNUSED( res ); if (left) { diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp index c0a67ccf5a7c..e91795abae2e 100644 --- a/src/core/raster/qgsrasterlayer.cpp +++ b/src/core/raster/qgsrasterlayer.cpp @@ -2837,7 +2837,7 @@ void QgsRasterLayer::setRedBandName( QString const & theBandName ) mRedBandName = validateBandName( theBandName ); } -void QgsRasterLayer::setSubLayerVisibility( QString const & name, bool vis ) +void QgsRasterLayer::setSubLayerVisibility( QString name, bool vis ) { if ( mDataProvider ) diff --git a/src/core/raster/qgsrasterlayer.h b/src/core/raster/qgsrasterlayer.h index 7616a47d9d72..06c9cd6fdc21 100644 --- a/src/core/raster/qgsrasterlayer.h +++ b/src/core/raster/qgsrasterlayer.h @@ -634,7 +634,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer void showProgress( int theValue ); /** \brief Returns the sublayers of this layer - Useful for providers that manage their own layers, such as WMS */ - QStringList subLayers() const; + virtual QStringList subLayers() const; /** \brief Draws a thumbnail of the rasterlayer into the supplied pixmap pointer */ void thumbnailAsPixmap( QPixmap * theQPixmap ); @@ -647,7 +647,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer void triggerRepaint(); // - // Virtural methods + // Virtual methods // /** * Reorders the *previously selected* sublayers of this layer from bottom to top @@ -655,12 +655,12 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer * (Useful for providers that manage their own layers, such as WMS) * */ - virtual void setLayerOrder( const QStringList & layers ); + virtual void setLayerOrder( const QStringList &layers ); /** * Set the visibility of the given sublayer name */ - virtual void setSubLayerVisibility( const QString & name, bool vis ); + virtual void setSubLayerVisibility( QString name, bool vis ); /** Time stamp of data source in the moment when data/metadata were loaded by provider */ virtual QDateTime timestamp() const { return mDataProvider->timestamp() ; } diff --git a/src/core/renderer/qgsgraduatedsymbolrenderer.cpp b/src/core/renderer/qgsgraduatedsymbolrenderer.cpp index 7ec64781ed55..cfcb668dc776 100644 --- a/src/core/renderer/qgsgraduatedsymbolrenderer.cpp +++ b/src/core/renderer/qgsgraduatedsymbolrenderer.cpp @@ -346,7 +346,7 @@ bool QgsGraduatedSymbolRenderer::writeXML( QDomNode & layer_node, QDomDocument & QString modeValue = ""; if ( mMode == QgsGraduatedSymbolRenderer::Empty ) { - modeValue == "Empty"; + modeValue = "Empty"; } else if ( QgsGraduatedSymbolRenderer::Quantile ) { diff --git a/src/core/spatialite/spatialite.c b/src/core/spatialite/spatialite.c index cc2c22bede9c..328f1181b34b 100644 --- a/src/core/spatialite/spatialite.c +++ b/src/core/spatialite/spatialite.c @@ -57581,7 +57581,7 @@ Parse (void *yyp, /* The parser */ #define __STDC_LIMIT_MACROS 1 #endif -/* #include */ +#include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; diff --git a/src/core/symbology-ng/qgsrendererv2registry.h b/src/core/symbology-ng/qgsrendererv2registry.h index bd7ecbe6c07a..bcc49e0ca009 100644 --- a/src/core/symbology-ng/qgsrendererv2registry.h +++ b/src/core/symbology-ng/qgsrendererv2registry.h @@ -24,6 +24,7 @@ class CORE_EXPORT QgsRendererV2AbstractMetadata public: QgsRendererV2AbstractMetadata( QString name, QString visibleName, QIcon icon = QIcon() ) : mName( name ), mVisibleName( visibleName ), mIcon( icon ) {} + virtual ~QgsRendererV2AbstractMetadata() {} QString name() const { return mName; } QString visibleName() const { return mVisibleName; } diff --git a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp index f09c8e3e44bb..427fd4c09571 100644 --- a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp +++ b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp @@ -446,9 +446,13 @@ QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::create( QDomElement& { Rule* childRule = create( childRuleElem, symbolMap ); if ( childRule ) + { rule->appendChild( childRule ); + } else + { QgsDebugMsg( "failed to init a child rule!" ); + } childRuleElem = childRuleElem.nextSiblingElement( "rule" ); } diff --git a/src/core/symbology-ng/qgssymbollayerv2registry.h b/src/core/symbology-ng/qgssymbollayerv2registry.h index b3428aac3b31..9705defdbf3c 100644 --- a/src/core/symbology-ng/qgssymbollayerv2registry.h +++ b/src/core/symbology-ng/qgssymbollayerv2registry.h @@ -19,6 +19,8 @@ class CORE_EXPORT QgsSymbolLayerV2AbstractMetadata QgsSymbolLayerV2AbstractMetadata( QString name, QString visibleName, QgsSymbolV2::SymbolType type ) : mName( name ), mVisibleName( visibleName ), mType( type ) {} + virtual ~QgsSymbolLayerV2AbstractMetadata() {} + QString name() const { return mName; } QString visibleName() const { return mVisibleName; } QgsSymbolV2::SymbolType type() const { return mType; } diff --git a/src/gui/attributetable/qgsattributetablememorymodel.cpp b/src/gui/attributetable/qgsattributetablememorymodel.cpp index 0b02b2ac47d8..99aca68d6506 100755 --- a/src/gui/attributetable/qgsattributetablememorymodel.cpp +++ b/src/gui/attributetable/qgsattributetablememorymodel.cpp @@ -115,10 +115,11 @@ void QgsAttributeTableMemoryModel::featureDeleted( QgsFeatureId fid ) QgsAttributeTableModel::featureDeleted( fid ); } -void QgsAttributeTableMemoryModel::featureAdded( QgsFeatureId fid ) +void QgsAttributeTableMemoryModel::featureAdded( QgsFeatureId fid, bool inOperation ) { QgsDebugMsg( "entered." ); Q_UNUSED( fid ); + Q_UNUSED( inOperation ); loadLayer(); } diff --git a/src/gui/attributetable/qgsattributetablememorymodel.h b/src/gui/attributetable/qgsattributetablememorymodel.h index 76eb9b1d157a..45eb9da3b8f1 100644 --- a/src/gui/attributetable/qgsattributetablememorymodel.h +++ b/src/gui/attributetable/qgsattributetablememorymodel.h @@ -59,8 +59,9 @@ class QgsAttributeTableMemoryModel : public QgsAttributeTableModel /** * Launched when a feature has been deleted * @param fid feature id + * @param inOperation guard insertion with beginInsertRows() / endInsertRows() */ - virtual void featureAdded( QgsFeatureId fid ); + virtual void featureAdded( QgsFeatureId fid, bool inOperation = true ); /** * Launched when layer has been deleted */ diff --git a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp index bb129568c1ca..6159b524ed59 100644 --- a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp +++ b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp @@ -754,7 +754,9 @@ bool QgsRuleBasedRendererV2Model::removeRows( int row, int count, const QModelIn //parentRule->takeChildAt( row ); } else + { QgsDebugMsg( "trying to remove invalid index - this should not happen!" ); + } } endRemoveRows(); diff --git a/src/mapserver/qgswmsserver.cpp b/src/mapserver/qgswmsserver.cpp index dd857b7c414d..1de6a91099c7 100644 --- a/src/mapserver/qgswmsserver.cpp +++ b/src/mapserver/qgswmsserver.cpp @@ -281,7 +281,7 @@ QImage* QgsWMSServer::getLegendGraphics() { if ( !mConfigParser || !mMapRenderer ) { - return false; + return 0; } QStringList layersList, stylesList; diff --git a/src/plugins/georeferencer/qgsleastsquares.cpp b/src/plugins/georeferencer/qgsleastsquares.cpp index 0147b1bbbb31..61aee9dc4ecd 100644 --- a/src/plugins/georeferencer/qgsleastsquares.cpp +++ b/src/plugins/georeferencer/qgsleastsquares.cpp @@ -94,10 +94,10 @@ void QgsLeastSquares::helmert( std::vector mapCoords, that this is correct but I derived it myself late at night. Look at helmert.jpg if you suspect bugs. */ - double MData[] = { A, -B, n, 0, - B, A, 0, n, - G + H, 0, A, B, - 0, G + H, -B, A + double MData[] = { A, -B, ( double ) n, 0., + B, A, 0., ( double ) n, + G + H, 0., A, B, + 0., G + H, -B, A }; double bData[] = { C, D, E + F, J - I }; @@ -151,8 +151,8 @@ void QgsLeastSquares::affine( std::vector mapCoords, I *think* that this is correct but I derived it myself late at night. Look at affine.jpg if you suspect bugs. */ - double MData[] = { A, B, 0, 0, n, 0, - 0, 0, A, B, 0, n, + double MData[] = { A, B, 0, 0, ( double ) n, 0, + 0, 0, A, B, 0, ( double ) n, E, G, 0, 0, A, 0, G, F, 0, 0, B, 0, 0, 0, E, G, 0, A, diff --git a/src/plugins/globe/globe_plugin.h b/src/plugins/globe/globe_plugin.h index cc8b1dbf85e7..583ea1158cc0 100644 --- a/src/plugins/globe/globe_plugin.h +++ b/src/plugins/globe/globe_plugin.h @@ -196,6 +196,7 @@ namespace osgEarth public: virtual void onMouseDown( class Control* control, int mouseButtonMask ) { Q_UNUSED( control ); Q_UNUSED( mouseButtonMask ); } virtual void onClick( class Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa ) { Q_UNUSED( control ); Q_UNUSED( mouseButtonMask ); Q_UNUSED( ea ); Q_UNUSED( aa ); } + virtual void onClick( class Control* control, int mouseButtonMask ) { Q_UNUSED( control ); Q_UNUSED( mouseButtonMask ); } }; class NavigationControl : public ImageControl diff --git a/src/plugins/globe/qgsosgearthtilesource.cpp b/src/plugins/globe/qgsosgearthtilesource.cpp index 1a2683df0ef2..939fc02bda50 100644 --- a/src/plugins/globe/qgsosgearthtilesource.cpp +++ b/src/plugins/globe/qgsosgearthtilesource.cpp @@ -83,7 +83,7 @@ osg::Image* QgsOsgEarthTileSource::createImage( const TileKey& key, ProgressCall return 0; } - QImage* qImage = createImage( target_width, target_height ); + QImage* qImage = createQImage( target_width, target_height ); if ( !qImage ) { return 0; @@ -121,7 +121,7 @@ osg::Image* QgsOsgEarthTileSource::createImage( const TileKey& key, ProgressCall return image.release(); } -QImage* QgsOsgEarthTileSource::createImage( int width, int height ) const +QImage* QgsOsgEarthTileSource::createQImage( int width, int height ) const { if ( width < 0 || height < 0 ) { diff --git a/src/plugins/globe/qgsosgearthtilesource.h b/src/plugins/globe/qgsosgearthtilesource.h index ab9519715920..5dfa2167f106 100644 --- a/src/plugins/globe/qgsosgearthtilesource.h +++ b/src/plugins/globe/qgsosgearthtilesource.h @@ -25,8 +25,7 @@ namespace osgEarth osg::Image* createImage( const TileKey& key, ProgressCallback* progress ); - osg::HeightField* createHeightField( const TileKey* key, - ProgressCallback* progress ) + virtual osg::HeightField* createHeightField( const TileKey &key, ProgressCallback* progress ) { Q_UNUSED( key ); Q_UNUSED( progress ); @@ -48,7 +47,7 @@ namespace osgEarth private: - QImage* createImage( int width, int height ) const; + QImage* createQImage( int width, int height ) const; bool intersects( const TileKey* key ); //! Pointer to the QGIS interface object diff --git a/src/plugins/grass/qgsgrassedit.cpp b/src/plugins/grass/qgsgrassedit.cpp index 56acff8d0650..9a6adc40032f 100644 --- a/src/plugins/grass/qgsgrassedit.cpp +++ b/src/plugins/grass/qgsgrassedit.cpp @@ -1437,7 +1437,7 @@ void QgsGrassEdit::checkOrphan( int field, int cat ) return; // Delete record - error = mProvider->deleteAttributes( field, cat ); + error = mProvider->deleteAttribute( field, cat ); if ( !error->isEmpty() ) { QMessageBox::warning( 0, tr( "Warning" ), tr( "Cannot delete orphan record: " ) diff --git a/src/plugins/grass/qgsgrassmapcalc.cpp b/src/plugins/grass/qgsgrassmapcalc.cpp index 017cad9f84a1..3e9e10269ea3 100644 --- a/src/plugins/grass/qgsgrassmapcalc.cpp +++ b/src/plugins/grass/qgsgrassmapcalc.cpp @@ -1542,7 +1542,7 @@ QgsGrassMapcalcObject::~QgsGrassMapcalcObject() QgsDebugMsg( "exited." ); } -int QgsGrassMapcalcObject::type() +int QgsGrassMapcalcObject::type() const { return mType; } diff --git a/src/plugins/grass/qgsgrassmapcalc.h b/src/plugins/grass/qgsgrassmapcalc.h index 4961e12975b6..a721a30e6a43 100644 --- a/src/plugins/grass/qgsgrassmapcalc.h +++ b/src/plugins/grass/qgsgrassmapcalc.h @@ -363,7 +363,7 @@ class QgsGrassMapcalcObject: public QGraphicsRectItem, public QgsGrassMapcalcIte QgsGrassMapcalcConnector *connector = 0, int end = 0 ); // Object type - int type(); + virtual int type() const; // Value QString value() { return mValue; } diff --git a/src/plugins/grass/qtermwidget/Screen.cpp b/src/plugins/grass/qtermwidget/Screen.cpp index 1e45b489c505..8402db39d96d 100644 --- a/src/plugins/grass/qtermwidget/Screen.cpp +++ b/src/plugins/grass/qtermwidget/Screen.cpp @@ -566,6 +566,7 @@ void Screen::copyFromScreen( Character* dest , int startLine , int count ) const void Screen::getImage( Character* dest, int size, int startLine, int endLine ) const { + Q_UNUSED( size ); Q_ASSERT( startLine >= 0 ); Q_ASSERT( endLine >= startLine && endLine < hist->getLines() + lines ); diff --git a/src/plugins/grass/qtermwidget/ShellCommand.cpp b/src/plugins/grass/qtermwidget/ShellCommand.cpp index 9404f6489ea7..bd2e8d443f9d 100644 --- a/src/plugins/grass/qtermwidget/ShellCommand.cpp +++ b/src/plugins/grass/qtermwidget/ShellCommand.cpp @@ -65,7 +65,7 @@ ShellCommand::ShellCommand( const QString& command , const QStringList& argument _arguments = arguments; if ( !_arguments.isEmpty() ) - _arguments[0] == command; + _arguments[0] = command; } QString ShellCommand::fullCommand() const { diff --git a/src/plugins/heatmap/heatmapgui.cpp b/src/plugins/heatmap/heatmapgui.cpp index 02486d169c3f..ec481cabad10 100644 --- a/src/plugins/heatmap/heatmapgui.cpp +++ b/src/plugins/heatmap/heatmapgui.cpp @@ -190,6 +190,7 @@ void HeatmapGui::on_cellYLineEdit_editingFinished() void HeatmapGui::on_radiusFieldUnitCombo_currentIndexChanged( int index ) { + Q_UNUSED( index ); updateBBox(); // DebugMsg to avoid index not used warning QgsDebugMsg( QString( "Unit index set to %1" ).arg( index ) ); @@ -197,12 +198,14 @@ void HeatmapGui::on_radiusFieldUnitCombo_currentIndexChanged( int index ) void HeatmapGui::on_mRadiusUnitCombo_currentIndexChanged( int index ) { + Q_UNUSED( index ); QgsDebugMsg( QString( "Unit index set to %1" ).arg( index ) ); updateBBox(); } void HeatmapGui::on_mInputVectorCombo_currentIndexChanged( int index ) { + Q_UNUSED( index ); if ( advancedGroupBox->isChecked() ) { populateFields(); @@ -213,6 +216,7 @@ void HeatmapGui::on_mInputVectorCombo_currentIndexChanged( int index ) void HeatmapGui::on_radiusFieldCombo_currentIndexChanged( int index ) { + Q_UNUSED( index ); updateBBox(); QgsDebugMsg( QString( "Radius Field index changed to %1" ).arg( index ) ); } diff --git a/src/providers/grass/qgsgrassprovider.cpp b/src/providers/grass/qgsgrassprovider.cpp index 32d9530bbd6d..7d41386364b6 100644 --- a/src/providers/grass/qgsgrassprovider.cpp +++ b/src/providers/grass/qgsgrassprovider.cpp @@ -2279,7 +2279,7 @@ QString *QgsGrassProvider::insertAttributes( int field, int cat ) return executeSql( field, query ); } -QString *QgsGrassProvider::deleteAttributes( int field, int cat ) +QString *QgsGrassProvider::deleteAttribute( int field, int cat ) { QgsDebugMsg( QString( "field = %1 cat = %2" ).arg( field ).arg( cat ) ); diff --git a/src/providers/grass/qgsgrassprovider.h b/src/providers/grass/qgsgrassprovider.h index 6331c2e35903..d077d7c30fb1 100644 --- a/src/providers/grass/qgsgrassprovider.h +++ b/src/providers/grass/qgsgrassprovider.h @@ -429,7 +429,7 @@ class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider * @param cat * @return empty string or error message */ - QString *deleteAttributes( int field, int cat ); + QString *deleteAttribute( int field, int cat ); /** Check if a database row exists and it is orphan (no more lines with * that category) diff --git a/src/providers/mssql/qgsmssqlprovider.cpp b/src/providers/mssql/qgsmssqlprovider.cpp index 3cb257fea19b..131d3324bd1f 100644 --- a/src/providers/mssql/qgsmssqlprovider.cpp +++ b/src/providers/mssql/qgsmssqlprovider.cpp @@ -512,7 +512,9 @@ void QgsMssqlProvider::select( QgsAttributeList fetchAttributes, } } else + { QgsDebugMsg( "QgsMssqlProvider::select no fields have been requested" ); + } } // update the extent, feature count, wkb type and srid for this layer diff --git a/src/providers/mssql/qgsmssqltablemodel.cpp b/src/providers/mssql/qgsmssqltablemodel.cpp index c606b47ab815..fd3c14db5172 100644 --- a/src/providers/mssql/qgsmssqltablemodel.cpp +++ b/src/providers/mssql/qgsmssqltablemodel.cpp @@ -310,8 +310,10 @@ QIcon QgsMssqlTableModel::iconForWkbType( QGis::WkbType type ) case QGis::WKBNoGeometry: return QIcon( QgsDataItem::getThemePixmap( "/mIconTableLayer.png" ) ); case QGis::WKBUnknown: - return QIcon( QgsDataItem::getThemePixmap( "/mIconLayer.png" ) ); + break; } + + return QIcon( QgsDataItem::getThemePixmap( "/mIconLayer.png" ) ); } bool QgsMssqlTableModel::setData( const QModelIndex &idx, const QVariant &value, int role ) diff --git a/src/providers/osm/osmhandler.cpp b/src/providers/osm/osmhandler.cpp index e0eb6877d1fd..cb8f30b9c805 100644 --- a/src/providers/osm/osmhandler.cpp +++ b/src/providers/osm/osmhandler.cpp @@ -98,20 +98,17 @@ OsmHandler::~OsmHandler() sqlite3_finalize( mStmtInsertVersion ); } - bool OsmHandler::startDocument() { sqlite3_exec( mDatabase, "BEGIN;", 0, 0, 0 ); return true; } - -QString OsmHandler::errorString() +QString OsmHandler::errorString() const { return mError; } - bool OsmHandler::startElement( const QString & pUri, const QString & pLocalName, const QString & pName, const QXmlAttributes & pAttrs ) { Q_UNUSED( pUri ); diff --git a/src/providers/osm/osmhandler.h b/src/providers/osm/osmhandler.h index 17395d770909..b358f26750a0 100644 --- a/src/providers/osm/osmhandler.h +++ b/src/providers/osm/osmhandler.h @@ -84,7 +84,7 @@ class OsmHandler: public QXmlDefaultHandler * Returns information on error that occures while parsing. * @return info on error that occures while parsing */ - QString errorString(); + QString errorString() const; public: int mPointCnt; diff --git a/src/providers/postgres/qgspgtablemodel.cpp b/src/providers/postgres/qgspgtablemodel.cpp index 04bfa271905f..74ef6333ccf6 100755 --- a/src/providers/postgres/qgspgtablemodel.cpp +++ b/src/providers/postgres/qgspgtablemodel.cpp @@ -311,8 +311,10 @@ QIcon QgsPgTableModel::iconForWkbType( QGis::WkbType type ) case QGis::WKBNoGeometry: return QIcon( QgsDataItem::getThemePixmap( "/mIconTableLayer.png" ) ); case QGis::WKBUnknown: - return QIcon( QgsDataItem::getThemePixmap( "/mIconLayer.png" ) ); + break; } + + return QIcon( QgsDataItem::getThemePixmap( "/mIconLayer.png" ) ); } bool QgsPgTableModel::setData( const QModelIndex &idx, const QVariant &value, int role ) diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp index e8b17b704a8e..004e04b0caa7 100644 --- a/src/providers/postgres/qgspostgresprovider.cpp +++ b/src/providers/postgres/qgspostgresprovider.cpp @@ -750,15 +750,13 @@ void QgsPostgresProvider::appendPkParams( QgsFeatureId featureId, QStringList &p for ( int i = 0; i < mPrimaryKeyAttrs.size(); i++ ) { - int idx = mPrimaryKeyAttrs[i]; - if ( i < pkVals.size() ) { params << pkVals[i].toString(); } else { - QgsDebugMsg( QString( "FAILURE: Key value %1 for feature %2 not found." ).arg( idx ).arg( featureId ) ); + QgsDebugMsg( QString( "FAILURE: Key value %1 for feature %2 not found." ).arg( mPrimaryKeyAttrs[i] ).arg( featureId ) ); params << "NULL"; } } diff --git a/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp b/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp index 77e0c38dfbc7..45e618e1235a 100644 --- a/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp +++ b/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp @@ -465,7 +465,7 @@ QgsSqlAnywhereProvider::subsetString() } // QgsSqlAnywhereProvider::subsetString() bool -QgsSqlAnywhereProvider::setSubsetString( QString theSQL ) +QgsSqlAnywhereProvider::setSubsetString( QString theSQL, bool ) { QString prevSubsetString = mSubsetString; QString prevKeyColumn = mKeyColumn; diff --git a/src/providers/sqlanywhere/qgssqlanywhereprovider.h b/src/providers/sqlanywhere/qgssqlanywhereprovider.h index 727bc4d4bc63..f5d74769ee50 100644 --- a/src/providers/sqlanywhere/qgssqlanywhereprovider.h +++ b/src/providers/sqlanywhere/qgssqlanywhereprovider.h @@ -76,7 +76,7 @@ class QgsSqlAnywhereProvider: public QgsVectorDataProvider virtual QString subsetString(); /** mutator for sql where clause used to limit dataset size */ - virtual bool setSubsetString( QString theSQL ); + virtual bool setSubsetString( QString theSQL, bool updateFeatureCount = true ); virtual bool supportsSubsetString() { return true; } /** Select features based on a bounding rectangle. Features can be retrieved with calls to nextFeature. diff --git a/src/providers/wfs/qgswfsprovider.cpp b/src/providers/wfs/qgswfsprovider.cpp index 5f0745ec761d..655beffe5f2a 100644 --- a/src/providers/wfs/qgswfsprovider.cpp +++ b/src/providers/wfs/qgswfsprovider.cpp @@ -49,7 +49,7 @@ static const QString GML_NAMESPACE = "http://www.opengis.net/gml"; QgsWFSProvider::QgsWFSProvider( const QString& uri ) : QgsVectorDataProvider( uri ), mNetworkRequestFinished( true ), - mEncoding( QgsWFSProvider::GET ), + mRequestEncoding( QgsWFSProvider::GET ), mUseIntersect( false ), mWKBType( QGis::WKBUnknown ), mSourceCRS( 0 ), @@ -69,11 +69,11 @@ QgsWFSProvider::QgsWFSProvider( const QString& uri ) //Local url or HTTP? [WBC 111221] refactored from getFeature() if ( uri.startsWith( "http" ) ) { - mEncoding = QgsWFSProvider::GET; + mRequestEncoding = QgsWFSProvider::GET; } else { - mEncoding = QgsWFSProvider::FILE; + mRequestEncoding = QgsWFSProvider::FILE; } //create mSourceCRS from url if possible [WBC 111221] refactored from GetFeatureGET() @@ -346,7 +346,7 @@ void QgsWFSProvider::select( QgsAttributeList fetchAttributes, int QgsWFSProvider::getFeature( const QString& uri ) { - if ( mEncoding == QgsWFSProvider::GET ) + if ( mRequestEncoding == QgsWFSProvider::GET ) { return getFeatureGET( uri, mGeometryAttribute ); } @@ -721,7 +721,7 @@ int QgsWFSProvider::describeFeatureType( const QString& uri, QString& geometryAt { fields.clear(); //Local url or HTTP? WBC111221 refactored here from getFeature() - switch ( mEncoding ) + switch ( mRequestEncoding ) { case QgsWFSProvider::GET: { @@ -2382,6 +2382,7 @@ bool QgsWFSProvider::initGetRenderedOnly( const QgsRectangle rect ) QGis::WkbType QgsWFSProvider::geomTypeFromPropertyType( QString attName, QString propType ) { + Q_UNUSED( attName ); const QStringList geomTypes = ( QStringList() //all GML v.2.1.3 _geometryProperty group members, except MultiGeometryPropertyType //sequence must exactly match enum Qgis::WkbType diff --git a/src/providers/wfs/qgswfsprovider.h b/src/providers/wfs/qgswfsprovider.h index ac2d9e7950cd..59fb4b217c71 100644 --- a/src/providers/wfs/qgswfsprovider.h +++ b/src/providers/wfs/qgswfsprovider.h @@ -101,8 +101,8 @@ class QgsWFSProvider: public QgsVectorDataProvider /* new functions */ /**Sets the encoding type in which the provider makes requests and interprets - results. Posibilities are GET, POST, SOAP*/ - void setEncoding( QgsWFSProvider::REQUEST_ENCODING e ) {mEncoding = e;} + results. Possibilities are GET, POST, SOAP*/ + void setRequestEncoding( QgsWFSProvider::REQUEST_ENCODING e ) {mRequestEncoding = e;} /**Makes a GetFeatures, receives the features from the wfs server (as GML), converts them to QgsFeature and stores them in a vector*/ @@ -166,7 +166,7 @@ class QgsWFSProvider: public QgsVectorDataProvider /**Name of geometry attribute*/ QString mGeometryAttribute; /**The encoding used for request/response. Can be GET, POST or SOAP*/ - REQUEST_ENCODING mEncoding; + REQUEST_ENCODING mRequestEncoding; /**Bounding box for the layer*/ QgsRectangle mExtent; /**Spatial filter for the layer*/ diff --git a/src/providers/wms/qgswmsprovider.h b/src/providers/wms/qgswmsprovider.h index 1d73d04ec626..5ececdaab286 100644 --- a/src/providers/wms/qgswmsprovider.h +++ b/src/providers/wms/qgswmsprovider.h @@ -422,12 +422,12 @@ class QgsWmsProvider : public QgsRasterDataProvider * (in order from bottom to top) * \note layers must have been previously added. */ - void setLayerOrder( QStringList const & layers ); + virtual void setLayerOrder( QStringList const & layers ); /** * Set the visibility of the given sublayer name */ - void setSubLayerVisibility( QString const & name, bool vis ); + virtual void setSubLayerVisibility( const QString &name, bool vis ); /** * Get the image encoding (as a MIME type) used in the transfer from the WMS server