diff --git a/CMakeLists.txt b/CMakeLists.txt index 93d9db6d996..d9547fe78e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -213,7 +213,7 @@ IF (PEDANTIC) ADD_DEFINITIONS( /wd4610 ) # user defined constructor required (sqlite3_index_info) ADD_DEFINITIONS( /wd4706 ) # assignment within conditional expression (pal) ELSE (MSVC) - ADD_DEFINITIONS( -Wall -Wno-long-long -Wformat-security -Wno-strict-aliasing ) + ADD_DEFINITIONS( -Wall -Wextra -Wredundant-decls -Wno-long-long -Wformat-security -Wno-strict-aliasing ) # Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3) # ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 ) ENDIF (MSVC) diff --git a/python/core/conversions.sip b/python/core/conversions.sip index 3a8cd9e32ce..48db55cfb7b 100644 --- a/python/core/conversions.sip +++ b/python/core/conversions.sip @@ -4,14 +4,17 @@ which are not wrapped by PyQt: - QVector< QVector > - QVector< QVector< QVector > > - QList< QList > +- QList - QSet +- QSet - QSet -- QMap > +- QMap > - QMap - QMap - QMap - QMultiMap -- QMap* +- QMap +- QMap* */ %Feature QSETINT_CONVERSION @@ -48,9 +51,9 @@ template if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; - + const sipMappedType* qvector_qgspoint = sipFindMappedType("QVector"); - + // Set the list elements. for (int i = 0; i < sipCpp->size(); ++i) { @@ -65,13 +68,13 @@ template } PyList_SET_ITEM(l, i, tobj); } - + return l; %End %ConvertToTypeCode const sipMappedType* qvector_qgspoint = sipFindMappedType("QVector"); - + // Check the type if that is all that is required. if (sipIsErr == NULL) { @@ -85,7 +88,7 @@ template return 1; } - + QVector< QVector > *ql = new QVector< QVector >; for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) @@ -130,9 +133,9 @@ template if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; - + const sipMappedType* qvector_qgspoint = sipFindMappedType("QVector >"); - + // Set the list elements. for (int i = 0; i < sipCpp->size(); ++i) { @@ -151,9 +154,9 @@ template %End %ConvertToTypeCode - + const sipMappedType* qvector_qgspoint = sipFindMappedType("QVector >"); - + // Check the type if that is all that is required. if (sipIsErr == NULL) { @@ -167,7 +170,7 @@ template return 1; } - + QVector< QVector< QVector > > *ql = new QVector< QVector< QVector > >; for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) @@ -290,7 +293,7 @@ template if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; - + // Set the list elements. QSet::iterator it = sipCpp->begin(); for (int i = 0; it != sipCpp->end(); ++it, ++i) @@ -327,6 +330,102 @@ template }; %End +%MappedType QList +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Create the list. + PyObject *l; + + if ((l = PyList_New(sipCpp->size())) == NULL) + return NULL; + + // Set the list elements. + QList::iterator it = sipCpp->begin(); + for (int i = 0; it != sipCpp->end(); ++it, ++i) + { + PyObject *tobj; + + if ((tobj = PyLong_FromLongLong(*it)) == NULL) + { + Py_DECREF(l); + return NULL; + } + PyList_SET_ITEM(l, i, tobj); + } + + return l; +%End + +%ConvertToTypeCode + // Check the type if that is all that is required. + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + QList *qlist = new QList; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + *qlist << PyLong_AsLongLong(PyList_GET_ITEM(sipPy, i)); + } + + *sipCppPtr = qlist; + return sipGetState(sipTransferObj); +%End + +}; + +%MappedType QSet +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Create the list. + PyObject *l; + + if ((l = PyList_New(sipCpp->size())) == NULL) + return NULL; + + // Set the list elements. + QSet::iterator it = sipCpp->begin(); + for (int i = 0; it != sipCpp->end(); ++it, ++i) + { + PyObject *tobj; + + if ((tobj = PyLong_FromLongLong(*it)) == NULL) + { + Py_DECREF(l); + return NULL; + } + PyList_SET_ITEM(l, i, tobj); + } + + return l; +%End + +%ConvertToTypeCode + // Check the type if that is all that is required. + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + QSet *qset = new QSet; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + qset->insert(PyLong_AsLongLong(PyList_GET_ITEM(sipPy, i))); + } + + *sipCppPtr = qset; + return sipGetState(sipTransferObj); +%End + +}; + %If (QSETTYPE_CONVERSION) template %MappedType QSet @@ -347,7 +446,7 @@ template if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; - + // Set the list elements. int i=0; for (QSet::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it, ++i) @@ -363,7 +462,7 @@ template } PyList_SET_ITEM(l, i, tobj); } - + return l; %End @@ -401,14 +500,14 @@ template *sipCppPtr = qset; return sipGetState(sipTransferObj); %End - }; %End template -%MappedType QMap > +%MappedType QMap > { %TypeHeaderCode +#include #include #if (SIP_VERSION >= 0x040900) #define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString)) @@ -424,21 +523,21 @@ template if ((d = PyDict_New()) == NULL) return NULL; - + const sipMappedType* qmap2 = sipFindMappedType("QMap"); - + // Set the list elements. - for (QMap >::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it) + for (QMap >::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it) { QMap* t = new QMap(*it); - - PyObject *kobj = PyInt_FromLong(it.key()); + + PyObject *kobj = PyLong_FromLongLong(it.key()); PyObject *tobj = sipConvertFromMappedType(t, qmap2, sipTransferObj); if (kobj == NULL || tobj == NULL || PyDict_SetItem(d, kobj, tobj) < 0) { Py_DECREF(d); - + if (kobj) { Py_DECREF(kobj); @@ -455,11 +554,11 @@ template return NULL; } - + Py_DECREF(kobj); Py_DECREF(tobj); } - + return d; %End @@ -477,46 +576,46 @@ template { if (!PyDict_Check(tobj)) return 0; - + Py_ssize_t j = 0; while (PyDict_Next(tobj, &j, &kobj2, &tobj2)) { if (!sipCanConvertToInstance(tobj2, sipClass_TYPE, SIP_NOT_NONE)) return 0; } - + } return 1; } - - QMap > *qm = new QMap >; - + + QMap > *qm = new QMap >; + Py_ssize_t i = 0; while (PyDict_Next(sipPy, &i, &kobj, &tobj)) { - int k = PyInt_AsLong(kobj); - + qint64 k = PyLong_AsLongLong(kobj); + // using sipConvertToMappedType to convert directly to QMap doesn't work // and ends with a segfault - + QMap qm2; - + Py_ssize_t j = 0; while (PyDict_Next(tobj, &j, &kobj2, &tobj2)) { int k2 = PyInt_AsLong(kobj2); int state; - + TYPE* fa = reinterpret_cast(sipConvertToInstance(tobj2, sipClass_TYPE, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr)); - + if (*sipIsErr) { sipReleaseInstance(tobj2, sipClass_TYPE, state); delete qm; return 0; } - + qm2.insert(k2, *fa); sipReleaseInstance(tobj2, sipClass_TYPE, state); } @@ -526,7 +625,93 @@ template *sipCppPtr = qm; return sipGetState(sipTransferObj); %End +}; +%MappedType QMap +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Create the list. + PyObject *d; + + if ((d = PyDict_New()) == NULL) + return NULL; + + // Set the list elements. + for (QMap::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it) + { + PyObject *kobj = PyLong_FromLongLong(it.key()); + PyObject *tobj = sipConvertFromInstance( &it.value(), sipClass_QgsGeometry, sipTransferObj); + + if (kobj == NULL || tobj == NULL || PyDict_SetItem(d, kobj, tobj) < 0) + { + Py_DECREF(d); + + if (kobj) + { + Py_DECREF(kobj); + } + + if (tobj) + { + Py_DECREF(tobj); + } + + return NULL; + } + + Py_DECREF(tobj); + } + + return d; +%End + +%ConvertToTypeCode + PyObject *kobj, *tobj; + + // Check the type if that is all that is required. + if (sipIsErr == NULL) + { + if (!PyDict_Check(sipPy)) + return 0; + + Py_ssize_t i = 0; + while (PyDict_Next(sipPy, &i, &kobj, &tobj)) + { + if (!PyDict_Check(tobj)) + return 0; + + if (!sipCanConvertToInstance(tobj, sipClass_QgsGeometry, SIP_NOT_NONE)) + return 0; + } + return 1; + } + + QMap *qm = new QMap; + + Py_ssize_t i = 0; + while (PyDict_Next(sipPy, &i, &kobj, &tobj)) + { + int state; + qint64 k = PyLong_AsLongLong(kobj); + QgsGeometry * fa = reinterpret_cast(sipConvertToInstance(tobj, sipClass_QgsGeometry, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr)); + + if (*sipIsErr) + { + sipReleaseInstance(tobj, sipClass_QgsGeometry, state); + delete qm; + return 0; + } + + qm->insert(k, *fa); + } + + *sipCppPtr = qm; + return sipGetState(sipTransferObj); +%End }; %MappedType QMap @@ -603,13 +788,13 @@ template { if (!sipCanConvertToInstance(t1obj, sipClass_QString, SIP_NOT_NONE)) return 0; - } + } return 1; } QMap *qm = new QMap; - + while (PyDict_Next(sipPy, &i, &t1obj, &t2obj)) { int state; @@ -628,9 +813,9 @@ template sipReleaseInstance(t1, sipClass_QString, state); } - + *sipCppPtr = qm; - + return sipGetState(sipTransferObj); %End }; @@ -713,20 +898,20 @@ template if (!sipCanConvertToInstance(t2obj, sipClass_TYPE2, SIP_NOT_NONE)) return 0; - } + } return 1; } QMap *qm = new QMap; - + while (PyDict_Next(sipPy, &i, &t1obj, &t2obj)) { int state1, state2; TYPE1 *t1 = reinterpret_cast(sipConvertToInstance(t1obj, sipClass_TYPE1, sipTransferObj, SIP_NOT_NONE, &state1, sipIsErr)); TYPE2 *t2 = reinterpret_cast(sipConvertToInstance(t2obj, sipClass_TYPE2, sipTransferObj, SIP_NOT_NONE, &state2, sipIsErr)); - + if (*sipIsErr) { sipReleaseInstance(t1, sipClass_TYPE1, state1); @@ -741,9 +926,9 @@ template sipReleaseInstance(t1, sipClass_TYPE1, state1); sipReleaseInstance(t2, sipClass_TYPE2, state2); } - + *sipCppPtr = qm; - + return sipGetState(sipTransferObj); %End }; @@ -974,7 +1159,7 @@ template %End }; -%MappedType QMap +%MappedType QMap { %TypeHeaderCode #include @@ -994,7 +1179,7 @@ template if ((d = PyDict_New()) == NULL) return NULL; - for (QMap::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it) + for (QMap::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it) { QgsOverlayObject* oobj = new QgsOverlayObject(*it.value()); @@ -1031,7 +1216,7 @@ template int i = 0; #endif - QMap *qm = new QMap; + QMap *qm = new QMap; while (PyDict_Next(sipPy, &i, &t1obj, &t2obj)) { diff --git a/python/core/qgsfeature.sip b/python/core/qgsfeature.sip index fff9e52102c..37c66017625 100644 --- a/python/core/qgsfeature.sip +++ b/python/core/qgsfeature.sip @@ -4,10 +4,10 @@ typedef QMap QgsAttributeMap; // key = feature id, value = changed attributes -typedef QMap > QgsChangedAttributesMap; +typedef QMap > QgsChangedAttributesMap; // key = feature id, value = changed geometry -typedef QMap QgsGeometryMap; +typedef QMap QgsGeometryMap; // key = field index, value = field name typedef QMap QgsFieldNameMap; @@ -50,7 +50,7 @@ class QgsFeature %End //! Constructor - QgsFeature(int id = 0, QString typeName = "" ); + QgsFeature(qint64 id = 0, QString typeName = "" ); /** copy ctor needed due to internal pointer */ QgsFeature(const QgsFeature & rhs ); @@ -63,13 +63,13 @@ class QgsFeature * Get the feature id for this feature * @return Feature id */ - int id() const; + qint64 id() const; /** * Set the feature id for this feature * @param id Feature id */ - void setFeatureId(int id); + void setFeatureId(qint64 id); /** returns the feature's type name diff --git a/python/core/qgsspatialindex.sip b/python/core/qgsspatialindex.sip index a0ddc085b80..4d435cc39ed 100644 --- a/python/core/qgsspatialindex.sip +++ b/python/core/qgsspatialindex.sip @@ -34,10 +34,10 @@ public: /* queries */ /** returns features that intersect the specified rectangle */ - QList intersects(QgsRectangle rect); + QList intersects(QgsRectangle rect); /** returns nearest neighbors (their count is specified by second parameter) */ - QList nearestNeighbor(QgsPoint point, int neighbors); + QList nearestNeighbor(QgsPoint point, int neighbors); }; diff --git a/python/core/qgsvectordataprovider.sip b/python/core/qgsvectordataprovider.sip index 60531ff7b1f..276ae68ea4b 100644 --- a/python/core/qgsvectordataprovider.sip +++ b/python/core/qgsvectordataprovider.sip @@ -90,10 +90,10 @@ class QgsVectorDataProvider : QgsDataProvider * @param fetchAttributes a list containing the indexes of the attribute fields to copy * @return True when feature was found, otherwise false */ - virtual bool featureAtId(int featureId, - QgsFeature& feature, - bool fetchGeometry = true, - QList fetchAttributes = QList()); + virtual bool featureAtId(qint64 featureId, + QgsFeature& feature, + bool fetchGeometry = true, + QList fetchAttributes = QList()); /** * Get the next feature resulting from a select operation. @@ -182,7 +182,7 @@ class QgsVectorDataProvider : QgsDataProvider * @param id list containing feature ids to delete * @return true in case of success and false in case of failure */ - virtual bool deleteFeatures(const QSet & id); + virtual bool deleteFeatures(const QSet & id); /** * Adds new attributes @@ -212,7 +212,7 @@ class QgsVectorDataProvider : QgsDataProvider * @param attr_map a map containing changed attributes * @return true in case of success and false in case of failure */ - virtual bool changeAttributeValues(const QMap > & attr_map); + virtual bool changeAttributeValues(const QMap > &attr_map ); /** * Returns the default value for field specified by @c fieldId @@ -225,7 +225,7 @@ class QgsVectorDataProvider : QgsDataProvider * the second map parameter being the new geometries themselves * @return true in case of success and false in case of failure */ - virtual bool changeGeometryValues(QMap & geometry_map); + virtual bool changeGeometryValues(QMap & geometry_map); /** * Creates a spatial index on the datasource (if supported by the provider type). diff --git a/python/core/qgsvectorlayer.sip b/python/core/qgsvectorlayer.sip index a8d54a545f1..52f9ecd0f33 100644 --- a/python/core/qgsvectorlayer.sip +++ b/python/core/qgsvectorlayer.sip @@ -1,6 +1,6 @@ typedef QList QgsAttributeList; -typedef QSet QgsFeatureIds; +typedef QSet QgsFeatureIds; typedef QSet QgsAttributeIds; @@ -142,10 +142,10 @@ public: QList selectedFeatures(); /** Return reference to identifiers of selected features */ - const QSet& selectedFeaturesIds() const; + const QSet &selectedFeaturesIds() const; /** Change selection to the new set of features */ - void setSelectedFeatures(const QSet& ids); + void setSelectedFeatures(const QSet &ids); /** Returns the bounding box of the selected features. If there is no selection, QgsRectangle(0,0,0,0) is returned */ QgsRectangle boundingBoxOfSelected(); @@ -267,7 +267,7 @@ public: * in the given ring, item (first number is index 0), and feature * Not meaningful for Point geometries */ - bool insertVertex(double x, double y, int atFeatureId, int beforeVertex); + bool insertVertex(double x, double y, qint64 atFeatureId, int beforeVertex); /** Moves the vertex at the given position number, * ring and item (first number is index 0), and feature @@ -278,7 +278,7 @@ public: /** Deletes the vertex at the given position number, * ring and item (first number is index 0), and feature */ - bool deleteVertex(int atFeatureId, int atVertex); + bool deleteVertex(qint64 atFeatureId, int atVertex); /** Deletes the selected features * @return true in case of success and false otherwise @@ -313,7 +313,7 @@ public: @param dx translation of x-coordinate @param dy translation of y-coordinate @return 0 in case of success*/ - int translateFeature(int featureId, double dx, double dy); + int translateFeature(qint64 featureId, double dx, double dy); /**Splits features cut by the given line @param splitLine line that splits the layer features @@ -417,10 +417,10 @@ public: /** change feature's geometry @note added in version 1.2 */ - bool changeGeometry(int fid, QgsGeometry* geom); + bool changeGeometry(qint64 fid, QgsGeometry* geom); /** changed an attribute value (but does not commit it */ - bool changeAttributeValue(int fid, int field, QVariant value, bool emitSignal = true); + bool changeAttributeValue(qint64 fid, int field, QVariant value, bool emitSignal = true); /** add an attribute field (but does not commit it) returns true in case of success @@ -453,7 +453,7 @@ public: bool addFeatures(QList features, bool makeSelected = TRUE); /** delete a feature from the layer (but does not commit it) */ - bool deleteFeature(int fid); + bool deleteFeature(qint64 fid); /** Attempts to commit any changes to disk. Returns the result of the attempt. @@ -528,93 +528,93 @@ public: /**access range */ RangeData &range(int idx); - /**Adds a new overlay to this class. QgsVectorLayer takes ownership of the object - @note this method was added in version 1.1 - */ - void addOverlay( QgsVectorOverlay* overlay /Transfer/); + /**Adds a new overlay to this class. QgsVectorLayer takes ownership of the object + @note this method was added in version 1.1 + */ + void addOverlay( QgsVectorOverlay* overlay /Transfer/); - /**Removes all overlays of a given type - @note this method was added in version 1.1 - */ - void removeOverlay( const QString& typeName ); + /**Removes all overlays of a given type + @note this method was added in version 1.1 + */ + void removeOverlay( const QString& typeName ); - /**Returns pointers to the overlays of this layer - @note this method was added in version 1.1 - */ - void vectorOverlays( QList& overlayList /Out/); + /**Returns pointers to the overlays of this layer + @note this method was added in version 1.1 + */ + void vectorOverlays( QList& overlayList /Out/); - /**Returns the (first) overlay of a type, e.g. diagram or label - @note this method was added in version 1.1 - */ - QgsVectorOverlay* findOverlayByType( const QString& typeName ); + /**Returns the (first) overlay of a type, e.g. diagram or label + @note this method was added in version 1.1 + */ + QgsVectorOverlay* findOverlayByType( const QString& typeName ); - /** - * Create edit command for undo/redo operations - * @param text text which is to be displayed in undo window - */ - void beginEditCommand(QString text); + /** + * Create edit command for undo/redo operations + * @param text text which is to be displayed in undo window + */ + void beginEditCommand(QString text); - /** Finish edit command and add it to undo/redo stack */ - void endEditCommand(); + /** Finish edit command and add it to undo/redo stack */ + void endEditCommand(); - /** Destroy active command and reverts all changes in it */ - void destroyEditCommand(); + /** Destroy active command and reverts all changes in it */ + void destroyEditCommand(); - /** Execute undo operation. To be called only from QgsVectorLayerUndoCommand. */ - // (not necessary) void undoEditCommand(QgsUndoCommand* cmd); + /** Execute undo operation. To be called only from QgsVectorLayerUndoCommand. */ + // (not necessary) void undoEditCommand(QgsUndoCommand* cmd); - /** Execute redo operation. To be called only from QgsVectorLayerUndoCommand. */ - // (not necessary) void redoEditCommand(QgsUndoCommand* cmd); + /** Execute redo operation. To be called only from QgsVectorLayerUndoCommand. */ + // (not necessary) void redoEditCommand(QgsUndoCommand* cmd); - /** Returns the index of a field name or -1 if the field does not exist - @note this method was added in version 1.4 - */ - int fieldNameIndex( const QString& fieldName ) const; + /** Returns the index of a field name or -1 if the field does not exist + @note this method was added in version 1.4 + */ + int fieldNameIndex( const QString& fieldName ) const; - /** Editing vertex markers - @note public from version 1.4 */ - enum VertexMarkerType - { - SemiTransparentCircle, - Cross, - NoMarker /* added in version 1.1 */ - }; + /** Editing vertex markers + @note public from version 1.4 */ + enum VertexMarkerType + { + SemiTransparentCircle, + Cross, + NoMarker /* added in version 1.1 */ + }; - /** Draws a vertex symbol at (screen) coordinates x, y. (Useful to assist vertex editing.) - @note public and static from version 1.4 */ - static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize ); + /** Draws a vertex symbol at (screen) coordinates x, y. (Useful to assist vertex editing.) + @note public and static from version 1.4 */ + static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize ); - /** Assembles mUpdatedFields considering provider fields, joined fields and added fields - @note added in 1.7 */ - void updateFieldMap(); + /** Assembles mUpdatedFields considering provider fields, joined fields and added fields + @note added in 1.7 */ + void updateFieldMap(); - /** Caches joined attributes if required (and not already done) - @note added in 1.7 */ - void createJoinCaches(); + /** Caches joined attributes if required (and not already done) + @note added in 1.7 */ + void createJoinCaches(); - /**Returns unique values for column - @param index column index for attribute - @param uniqueValues out: result list - @limit maximum number of values to return (-1 if unlimited) - @note: this method was added in version 1.7*/ - void uniqueValues( int index, QList& uniqueValues /Out/, int limit = -1 ); + /**Returns unique values for column + @param index column index for attribute + @param uniqueValues out: result list + @limit maximum number of values to return (-1 if unlimited) + @note: this method was added in version 1.7*/ + void uniqueValues( int index, QList& uniqueValues /Out/, int limit = -1 ); - /**Returns minimum value for an attribute column or invalid variant in case of error - @note added in 1.7*/ - QVariant minimumValue( int index ); + /**Returns minimum value for an attribute column or invalid variant in case of error + @note added in 1.7*/ + QVariant minimumValue( int index ); - /**Returns maximum value for an attribute column or invalid variant in case of error - @note added in 1.7*/ - QVariant maximumValue( int index ); + /**Returns maximum value for an attribute column or invalid variant in case of error + @note added in 1.7*/ + QVariant maximumValue( int index ); public slots: /** Select feature by its ID, optionally emit signal selectionChanged() */ - void select(int featureId, bool emitSignal = TRUE); + void select(qint64 featureId, bool emitSignal = TRUE); /** Deselect feature by its ID, optionally emit signal selectionChanged() */ - void deselect( int featureId, bool emitSignal = TRUE ); + void deselect( qint64 featureId, bool emitSignal = TRUE ); /** Clear selection */ void removeSelection(bool emitSignal = TRUE); @@ -642,10 +642,10 @@ signals: void editingStopped(); void attributeAdded(int idx); void attributeDeleted(int idx); - void featureDeleted(int fid); + void featureDeleted(qint64 fid); void layerDeleted(); - void attributeValueChanged(int fid, int idx, const QVariant &); + void attributeValueChanged(qint64 fid, int idx, const QVariant &); /** Signals emitted after committing changes \note added in v1.6 */ diff --git a/python/core/qgsvectoroverlay.sip b/python/core/qgsvectoroverlay.sip index 409c15671a8..e0c94121ca0 100644 --- a/python/core/qgsvectoroverlay.sip +++ b/python/core/qgsvectoroverlay.sip @@ -18,7 +18,7 @@ class QgsVectorOverlay virtual void drawOverlayObjects( QgsRenderContext& context ) const = 0; /**Gives direct access to oberlay objects*/ - QMap* overlayObjects(); + QMap* overlayObjects(); /**Describes the overlay type (e.g. "diagram" or "label")*/ virtual QString typeName() const = 0; diff --git a/src/analysis/interpolation/Bezier3D.h b/src/analysis/interpolation/Bezier3D.h index c7531d22760..685d10ca013 100644 --- a/src/analysis/interpolation/Bezier3D.h +++ b/src/analysis/interpolation/Bezier3D.h @@ -35,7 +35,7 @@ class ANALYSIS_EXPORT Bezier3D: public ParametricLine /**Destructor*/ virtual ~Bezier3D(); /**Do not use this method, since a Bezier curve does not consist of other curves*/ - virtual void add( ParametricLine* pl ); + virtual void add( ParametricLine *pl ); /**Calculates the first derivative and assigns it to v*/ virtual void calcFirstDer( float t, Vector3D* v ); /**Calculates the second derivative and assigns it to v*/ @@ -83,13 +83,15 @@ inline Bezier3D::~Bezier3D() //----------------------------------------------invalid methods add and remove (because of inheritance from ParametricLine) -inline void Bezier3D::add( ParametricLine* pl ) +inline void Bezier3D::add( ParametricLine *pl ) { + Q_UNUSED( pl ); QgsDebugMsg( "Error!!!!! A Bezier-curve can not be parent of a ParametricLine." ); } inline void Bezier3D::remove( int i ) { + Q_UNUSED( i ); QgsDebugMsg( "Error!!!!! A Bezier-curve has no children to remove." ); } diff --git a/src/analysis/interpolation/MathUtils.cc b/src/analysis/interpolation/MathUtils.cc index 233cacb69db..27876e59396 100644 --- a/src/analysis/interpolation/MathUtils.cc +++ b/src/analysis/interpolation/MathUtils.cc @@ -48,6 +48,8 @@ bool MathUtils::calcBarycentricCoordinates( double x, double y, Point3D* p1, Poi bool MathUtils::BarycentricToXY( double u, double v, double w, Point3D* p1, Point3D* p2, Point3D* p3, Point3D* result )//this is wrong at the moment. Furthermore, the case, where the denominators are 0 have to be treated (two ways of calculating px and py) { + Q_UNUSED( w ); + double px, py; if ( p1 && p2 && p3 && result ) { diff --git a/src/analysis/interpolation/ParametricLine.cc b/src/analysis/interpolation/ParametricLine.cc index 889147795ac..66c255fb883 100644 --- a/src/analysis/interpolation/ParametricLine.cc +++ b/src/analysis/interpolation/ParametricLine.cc @@ -20,21 +20,28 @@ void ParametricLine::add( ParametricLine* pl ) { + Q_UNUSED( pl ); std::cout << "warning, derive a class from ParametricLine" << std::endl; } void ParametricLine::calcFirstDer( float t, Vector3D* v ) { + Q_UNUSED( t ); + Q_UNUSED( v ); std::cout << "warning, derive a class from ParametricLine" << std::endl; } void ParametricLine::calcSecDer( float t, Vector3D* v ) { + Q_UNUSED( t ); + Q_UNUSED( v ); std::cout << "warning, derive a class from ParametricLine" << std::endl; } -void ParametricLine::calcPoint( float t, Point3D* ) +void ParametricLine::calcPoint( float t, Point3D *p ) { + Q_UNUSED( t ); + Q_UNUSED( p ); std::cout << "warning, derive a class from ParametricLine" << std::endl; } @@ -46,16 +53,19 @@ ParametricLine* ParametricLine::getParent() const void ParametricLine::remove( int i ) { + Q_UNUSED( i ); std::cout << "warning, derive a class from ParametricLine" << std::endl; } void ParametricLine::setControlPoly( QVector* cp ) { + Q_UNUSED( cp ); std::cout << "warning, derive a class from ParametricLine" << std::endl; } void ParametricLine::setParent( ParametricLine* paral ) { + Q_UNUSED( paral ); std::cout << "warning, derive a class from ParametricLine" << std::endl; } @@ -67,6 +77,7 @@ int ParametricLine::getDegree() const const Point3D* ParametricLine::getControlPoint( int number ) const { + Q_UNUSED( number ); std::cout << "warning, derive a class from ParametricLine" << std::endl; return 0; } diff --git a/src/analysis/vector/qgsgeometryanalyzer.cpp b/src/analysis/vector/qgsgeometryanalyzer.cpp index dc4daf55fe0..98fd740738d 100644 --- a/src/analysis/vector/qgsgeometryanalyzer.cpp +++ b/src/analysis/vector/qgsgeometryanalyzer.cpp @@ -27,8 +27,11 @@ #include "qgsdistancearea.h" #include -bool QgsGeometryAnalyzer::simplify( QgsVectorLayer* layer, const QString& shapefileName, - double tolerance, bool onlySelectedFeatures, QProgressDialog* p ) +bool QgsGeometryAnalyzer::simplify( QgsVectorLayer* layer, + const QString& shapefileName, + double tolerance, + bool onlySelectedFeatures, + QProgressDialog *p ) { if ( !layer ) { @@ -255,8 +258,10 @@ void QgsGeometryAnalyzer::centroidFeature( QgsFeature& f, QgsVectorFileWriter* v } } -bool QgsGeometryAnalyzer::extent( QgsVectorLayer* layer, const QString& shapefileName, - bool onlySelectedFeatures, QProgressDialog* p ) +bool QgsGeometryAnalyzer::extent( QgsVectorLayer* layer, + const QString& shapefileName, + bool onlySelectedFeatures, + QProgressDialog * ) { if ( !layer ) { @@ -408,7 +413,7 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap QgsVectorFileWriter vWriter( shapefileName, dp->encoding(), fields, outputType, &crs ); QgsFeature currentFeature; QgsGeometry* dissolveGeometry = 0; //dissolve geometry - QMultiMap map; + QMultiMap map; if ( onlySelectedFeatures ) { @@ -455,7 +460,7 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap } } - QMultiMap::const_iterator jt = map.constBegin(); + QMultiMap::const_iterator jt = map.constBegin(); while ( jt != map.constEnd() ) { QString currentKey = jt.key(); @@ -613,7 +618,7 @@ bool QgsGeometryAnalyzer::dissolve( QgsVectorLayer* layer, const QString& shapef QgsVectorFileWriter vWriter( shapefileName, dp->encoding(), dp->fields(), outputType, &crs ); QgsFeature currentFeature; - QMultiMap map; + QMultiMap map; if ( onlySelectedFeatures ) { @@ -639,7 +644,7 @@ bool QgsGeometryAnalyzer::dissolve( QgsVectorLayer* layer, const QString& shapef } QgsGeometry *dissolveGeometry = 0; //dissolve geometry - QMultiMap::const_iterator jt = map.constBegin(); + QMultiMap::const_iterator jt = map.constBegin(); QgsFeature outputFeature; while ( jt != map.constEnd() ) { diff --git a/src/analysis/vector/qgsoverlayanalyzer.cpp b/src/analysis/vector/qgsoverlayanalyzer.cpp index 1e562eec36e..e8e816b4609 100644 --- a/src/analysis/vector/qgsoverlayanalyzer.cpp +++ b/src/analysis/vector/qgsoverlayanalyzer.cpp @@ -150,9 +150,9 @@ void QgsOverlayAnalyzer::intersectFeature( QgsFeature& f, QgsVectorFileWriter* v return; } - QList intersects; + QList intersects; intersects = index->intersects( featureGeometry->boundingBox() ); - QList::const_iterator it = intersects.constBegin(); + QList::const_iterator it = intersects.constBegin(); QgsFeature outFeature; for ( ; it != intersects.constEnd(); ++it ) { diff --git a/src/app/attributetable/qgsattributetabledialog.cpp b/src/app/attributetable/qgsattributetabledialog.cpp index c7d3a062c2a..1a093fd4ad8 100644 --- a/src/app/attributetable/qgsattributetabledialog.cpp +++ b/src/app/attributetable/qgsattributetabledialog.cpp @@ -48,6 +48,7 @@ class QgsAttributeTableDock : public QDockWidget virtual void closeEvent( QCloseEvent * ev ) { + Q_UNUSED( ev ); deleteLater(); } }; @@ -196,23 +197,24 @@ void QgsAttributeTableDialog::on_mSelectedToTopButton_clicked() mModel->swapRows( mModel->rowToId( sourceIndex.row() ), *it ); } - /* - while (it != fids.end()) - { //map!!!! - //mModel->swapRows(mModel->rowToId(freeIndex), *it); - //QModelIndex index = mFilterModel->mapFromSource(mModel->index(mModel->idToRow(*it), 0)); - QModelIndex sourceIndex = mFilterModel->mapToSource(mFilterModel->index(freeIndex, 0)); - mModel->swapRows(mModel->rowToId(sourceIndex.row()), *it); - //mModel->swapRows(freeIndex, *it); +#if 0 + while ( it != fids.end() ) + { //map!!!! + //mModel->swapRows(mModel->rowToId(freeIndex), *it); + //QModelIndex index = mFilterModel->mapFromSource(mModel->index(mModel->idToRow(*it), 0)); + QModelIndex sourceIndex = mFilterModel->mapToSource( mFilterModel->index( freeIndex, 0 ) ); + mModel->swapRows( mModel->rowToId( sourceIndex.row() ), *it ); + //mModel->swapRows(freeIndex, *it); - if (fids.empty()) - break; - else - ++it; + if ( fids.empty() ) + break; + else + ++it; + + ++freeIndex; + } +#endif - ++freeIndex; - } - */ // just select proper rows //mModel->reload(mModel->index(0,0), mModel->index(mModel->rowCount(), mModel->columnCount())); //mModel->changeLayout(); @@ -405,7 +407,7 @@ void QgsAttributeTableDialog::updateRowSelection( int first, int last, int click // Id must be mapped to table/view row QModelIndex index = mFilterModel->mapToSource( mFilterModel->index( first, 0 ) ); - int fid = mModel->rowToId( index.row() ); + QgsFeatureId fid = mModel->rowToId( index.row() ); bool wasSelected = mSelectedFeatures.contains( fid ); // new selection should be created diff --git a/src/app/composer/qgscomposer.cpp b/src/app/composer/qgscomposer.cpp index 34c68a85fb5..b3f84b34ce3 100644 --- a/src/app/composer/qgscomposer.cpp +++ b/src/app/composer/qgscomposer.cpp @@ -1106,10 +1106,16 @@ void QgsComposer::on_mActionRedo_triggered() } } -void QgsComposer::moveEvent( QMoveEvent *e ) { saveWindowState(); } +void QgsComposer::moveEvent( QMoveEvent *e ) +{ + Q_UNUSED( e ); + saveWindowState(); +} void QgsComposer::resizeEvent( QResizeEvent *e ) { + Q_UNUSED( e ); + // Move size grip when window is resized mSizeGrip->move( rect().bottomRight() - mSizeGrip->rect().bottomRight() ); diff --git a/src/app/composer/qgscomposermapwidget.cpp b/src/app/composer/qgscomposermapwidget.cpp index cd47c59a3ec..f906070d6d7 100644 --- a/src/app/composer/qgscomposermapwidget.cpp +++ b/src/app/composer/qgscomposermapwidget.cpp @@ -110,6 +110,8 @@ void QgsComposerMapWidget::on_mHeightLineEdit_editingFinished() void QgsComposerMapWidget::on_mPreviewModeComboBox_activated( int i ) { + Q_UNUSED( i ); + if ( !mComposerMap ) { return; diff --git a/src/app/composer/qgscomposerpicturewidget.cpp b/src/app/composer/qgscomposerpicturewidget.cpp index 33d689e0c32..ba94c658a90 100644 --- a/src/app/composer/qgscomposerpicturewidget.cpp +++ b/src/app/composer/qgscomposerpicturewidget.cpp @@ -166,6 +166,7 @@ void QgsComposerPictureWidget::on_mRotationSpinBox_valueChanged( double d ) void QgsComposerPictureWidget::on_mPreviewListWidget_currentItemChanged( QListWidgetItem* current, QListWidgetItem* previous ) { + Q_UNUSED( previous ); if ( !mPicture || !current ) { return; diff --git a/src/app/composer/qgscompositionwidget.cpp b/src/app/composer/qgscompositionwidget.cpp index 20e39ae4b5c..cf3daf09ffe 100644 --- a/src/app/composer/qgscompositionwidget.cpp +++ b/src/app/composer/qgscompositionwidget.cpp @@ -149,6 +149,8 @@ void QgsCompositionWidget::createPaperEntries() void QgsCompositionWidget::on_mPaperSizeComboBox_currentIndexChanged( const QString& text ) { + Q_UNUSED( text ); + if ( mPaperSizeComboBox->currentText() == tr( "Custom" ) ) { mPaperWidthDoubleSpinBox->setEnabled( true ); @@ -166,6 +168,8 @@ void QgsCompositionWidget::on_mPaperSizeComboBox_currentIndexChanged( const QStr void QgsCompositionWidget::on_mPaperOrientationComboBox_currentIndexChanged( const QString& text ) { + Q_UNUSED( text ); + if ( mPaperSizeComboBox->currentText() == tr( "Custom" ) ) { adjustOrientation(); @@ -180,6 +184,8 @@ void QgsCompositionWidget::on_mPaperOrientationComboBox_currentIndexChanged( con void QgsCompositionWidget::on_mPaperUnitsComboBox_currentIndexChanged( const QString& text ) { + Q_UNUSED( text ); + double width = size( mPaperWidthDoubleSpinBox ); double height = size( mPaperHeightDoubleSpinBox ); @@ -468,6 +474,8 @@ void QgsCompositionWidget::on_mGridColorButton_clicked() void QgsCompositionWidget::on_mGridStyleComboBox_currentIndexChanged( const QString& text ) { + Q_UNUSED( text ); + if ( mComposition ) { if ( mGridStyleComboBox->currentText() == tr( "Solid" ) ) diff --git a/src/app/legend/qgslegend.cpp b/src/app/legend/qgslegend.cpp index 761e1190498..54572d0e067 100644 --- a/src/app/legend/qgslegend.cpp +++ b/src/app/legend/qgslegend.cpp @@ -138,6 +138,8 @@ void QgsLegend::showItem( QString msg, QTreeWidgetItem *item ) void QgsLegend::handleCurrentItemChanged( QTreeWidgetItem* current, QTreeWidgetItem* previous ) { + Q_UNUSED( current ); + Q_UNUSED( previous ); QgsMapLayer *layer = currentLayer(); if ( mMapCanvas ) @@ -556,8 +558,10 @@ void QgsLegend::mouseReleaseEvent( QMouseEvent * e ) checkLayerOrderUpdate(); } -void QgsLegend::mouseDoubleClickEvent( QMouseEvent* e ) +void QgsLegend::mouseDoubleClickEvent( QMouseEvent *e ) { + Q_UNUSED( e ); + QSettings settings; switch ( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() ) @@ -1588,9 +1592,13 @@ void QgsLegend::moveItem( QTreeWidgetItem* move, QTreeWidgetItem* after ) { QgsDebugMsg( QString( "Moving layer : %1 (%2)" ).arg( move->text( 0 ) ).arg( move->type() ) ); if ( after ) + { QgsDebugMsg( QString( "after layer : %1 (%2)" ).arg( after->text( 0 ) ).arg( after->type() ) ); + } else + { QgsDebugMsg( "as toplevel item" ); + } static_cast( move )->storeAppearanceSettings();//store settings in the moved item and its childern @@ -1760,6 +1768,8 @@ void QgsLegend::removePixmapHeightValue( int height ) void QgsLegend::handleItemChange( QTreeWidgetItem* item, int column ) { + Q_UNUSED( column ); + if ( !item ) { return; diff --git a/src/app/legend/qgslegenditem.cpp b/src/app/legend/qgslegenditem.cpp index 0d9981ec3a8..eb531797739 100644 --- a/src/app/legend/qgslegenditem.cpp +++ b/src/app/legend/qgslegenditem.cpp @@ -58,6 +58,8 @@ void QgsLegendItem::print( QgsLegendItem * theItem ) } ++myIterator; } +#else + Q_UNUSED( theItem ); #endif } diff --git a/src/app/legend/qgslegenditem.h b/src/app/legend/qgslegenditem.h index 1786d0fb93c..dd04e3ea00d 100644 --- a/src/app/legend/qgslegenditem.h +++ b/src/app/legend/qgslegenditem.h @@ -62,7 +62,7 @@ class QgsLegendItem : public QTreeWidgetItem, public QObject NO_ACTION //do nothing }; - virtual LEGEND_ITEM_TYPE type() const {return mType;} + virtual LEGEND_ITEM_TYPE type() const { return mType; } /**Subclasses which allow insertion of other items may implement this method. @param theItem legend item to insert into this item @@ -70,7 +70,7 @@ class QgsLegendItem : public QTreeWidgetItem, public QObject If false, such settings don't change (e.g. during mouse drags). If true, the layers and/or map canvas settings are allowed to change (e.g. if the mouse button is released). @return true in case of success and false if theItem cannot be inserted*/ - virtual bool insert( QgsLegendItem* theItem ) {return false;} + virtual bool insert( QgsLegendItem *theItem ) { Q_UNUSED( theItem ); return false; } void print( QgsLegendItem * theItem ); /**Returns a pointer to the first child or 0 if there is none*/ QgsLegendItem* firstChild(); @@ -101,9 +101,9 @@ class QgsLegendItem : public QTreeWidgetItem, public QObject QTreeWidgetItem's and QObject's insertChild() function */ void insertChild( int index, QTreeWidgetItem *child ); /**Do preparations after a new child was inserted (default empty)*/ - virtual void receive( QgsLegendItem* newChild ) {} + virtual void receive( QgsLegendItem *newChild ) { Q_UNUSED( newChild ); } /**Do cleanups after a child item leaves (default empty)*/ - virtual void release( QgsLegendItem* formerChild ) {} + virtual void release( QgsLegendItem *formerChild ) { Q_UNUSED( formerChild ); } protected: LEGEND_ITEM_TYPE mType; diff --git a/src/app/legend/qgslegendpropertygroup.h b/src/app/legend/qgslegendpropertygroup.h index 996c01143a9..1333d550b31 100644 --- a/src/app/legend/qgslegendpropertygroup.h +++ b/src/app/legend/qgslegendpropertygroup.h @@ -37,7 +37,8 @@ class QgsLegendPropertyGroup : public QgsLegendItem /** Overloads cmpare function of QListViewItem * @note The property group must always be the first in the list */ - int compare( QTreeWidgetItem* i, int col, bool ascending ) {return -1;} + int compare( QTreeWidgetItem* i, int col, bool ascending ) + { Q_UNUSED( i ); Q_UNUSED( col ); Q_UNUSED( ascending ); return -1; } }; #endif diff --git a/src/app/legend/qgslegendsymbologygroup.cpp b/src/app/legend/qgslegendsymbologygroup.cpp index 4f0cd412893..7708ea69066 100644 --- a/src/app/legend/qgslegendsymbologygroup.cpp +++ b/src/app/legend/qgslegendsymbologygroup.cpp @@ -42,6 +42,8 @@ QgsLegendSymbologyGroup::~QgsLegendSymbologyGroup() */ int QgsLegendSymbologyGroup::compare( QTreeWidgetItem * i, int col, bool ascending ) { + Q_UNUSED( col ); + Q_UNUSED( ascending ); QgsLegendItem * myItem = dynamic_cast( i ) ; if ( myItem->type() == QgsLegendItem::LEGEND_PROPERTY_GROUP ) { diff --git a/src/app/ogr/qgsopenvectorlayerdialog.cpp b/src/app/ogr/qgsopenvectorlayerdialog.cpp index db1b4366c0c..d3a3eb53601 100644 --- a/src/app/ogr/qgsopenvectorlayerdialog.cpp +++ b/src/app/ogr/qgsopenvectorlayerdialog.cpp @@ -451,12 +451,14 @@ void QgsOpenVectorLayerDialog::on_btnEdit_clicked() void QgsOpenVectorLayerDialog::on_cmbDatabaseTypes_currentIndexChanged( const QString & text ) { + Q_UNUSED( text ); populateConnectionList(); setSelectedConnectionType(); } void QgsOpenVectorLayerDialog::on_cmbConnections_currentIndexChanged( const QString & text ) { + Q_UNUSED( text ); setSelectedConnection(); } //********************end auto connected slots *****************/ diff --git a/src/app/ogr/qgsvectorlayersaveasdialog.cpp b/src/app/ogr/qgsvectorlayersaveasdialog.cpp index 5b6bb6515cc..833f336104a 100644 --- a/src/app/ogr/qgsvectorlayersaveasdialog.cpp +++ b/src/app/ogr/qgsvectorlayersaveasdialog.cpp @@ -73,6 +73,8 @@ void QgsVectorLayerSaveAsDialog::accept() void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx ) { + Q_UNUSED( idx ); + browseFilename->setEnabled( true ); leFilename->setEnabled( true ); diff --git a/src/app/postgres/qgspgsourceselect.cpp b/src/app/postgres/qgspgsourceselect.cpp index e503213a9b8..e8328c80b11 100644 --- a/src/app/postgres/qgspgsourceselect.cpp +++ b/src/app/postgres/qgspgsourceselect.cpp @@ -272,6 +272,7 @@ void QgsPgSourceSelect::on_mSearchColumnComboBox_currentIndexChanged( const QStr void QgsPgSourceSelect::on_mSearchModeComboBox_currentIndexChanged( const QString & text ) { + Q_UNUSED( text ); on_mSearchTableEdit_textChanged( mSearchTableEdit->text() ); } @@ -929,6 +930,7 @@ void QgsPgSourceSelect::setConnectionListPosition() void QgsPgSourceSelect::setSearchExpression( const QString& regexp ) { + Q_UNUSED( regexp ); } void QgsGeomColumnTypeThread::setConnInfo( QString conninfo, bool useEstimatedMetadata ) diff --git a/src/app/postgres/qgspgsourceselect.h b/src/app/postgres/qgspgsourceselect.h index 39769f5e561..819adebfdae 100644 --- a/src/app/postgres/qgspgsourceselect.h +++ b/src/app/postgres/qgspgsourceselect.h @@ -54,6 +54,7 @@ class QgsPgSourceSelectDelegate : public QItemDelegate const QStyleOptionViewItem &option, const QModelIndex &index ) const { + Q_UNUSED( option ); if ( index.column() == QgsDbTableModel::dbtmSql ) { QLineEdit *le = new QLineEdit( parent ); diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 2a4a9207db8..39d777e4fdb 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -3135,6 +3135,8 @@ void QgisApp::addWindow( QAction *action ) mWindowMenu->addAction( action ); action->setCheckable( true ); action->setChecked( true ); +#else + Q_UNUSED( action ); #endif } @@ -3143,6 +3145,8 @@ void QgisApp::removeWindow( QAction *action ) #ifdef Q_WS_MAC mWindowActions->removeAction( action ); mWindowMenu->removeAction( action ); +#else + Q_UNUSED( action ); #endif } @@ -3736,7 +3740,7 @@ void QgisApp::mergeAttributesOfSelectedFeatures() const QgsAttributeMap &merged = d.mergedAttributesMap(); - foreach( int fid, vl->selectedFeaturesIds() ) + foreach( QgsFeatureId fid, vl->selectedFeaturesIds() ) { for ( QgsAttributeMap::const_iterator it = merged.begin(); it != merged.end(); it++ ) { @@ -6500,6 +6504,7 @@ void QgisApp::updateUndoActions() // add project directory to python path void QgisApp::projectChanged( const QDomDocument &doc ) { + Q_UNUSED( doc ); QgsProject *project = qobject_cast( sender() ); if ( !project ) return; diff --git a/src/app/qgisappinterface.cpp b/src/app/qgisappinterface.cpp index 5acea87a92e..940770dbfc1 100644 --- a/src/app/qgisappinterface.cpp +++ b/src/app/qgisappinterface.cpp @@ -405,6 +405,7 @@ QAction *QgisAppInterface::actionAbout() { return qgis->actionAbout(); } bool QgisAppInterface::openFeatureForm( QgsVectorLayer *vlayer, QgsFeature &f, bool updateFeatureOnly ) { + Q_UNUSED( updateFeatureOnly ); if ( !vlayer ) return false; diff --git a/src/app/qgsattributetypedialog.cpp b/src/app/qgsattributetypedialog.cpp index 2d6ab6d6d89..6f840c1f0ea 100644 --- a/src/app/qgsattributetypedialog.cpp +++ b/src/app/qgsattributetypedialog.cpp @@ -93,6 +93,7 @@ void QgsAttributeTypeDialog::setCheckedState( QString checked, QString unchecked void QgsAttributeTypeDialog::vCellChanged( int row, int column ) { + Q_UNUSED( column ); if ( row == tableWidget->rowCount() - 1 ) { tableWidget->insertRow( row + 1 ); @@ -104,8 +105,8 @@ void QgsAttributeTypeDialog::removeSelectedButtonPushed() QList list = tableWidget->selectedItems(); QSet rowsToRemove; int removed = 0; - int i = 0; - for ( ; i < list.size(); i++ ) + int i; + for ( i = 0; i < list.size(); i++ ) { if ( list[i]->column() == 0 ) { diff --git a/src/app/qgsbookmarks.cpp b/src/app/qgsbookmarks.cpp index 214fcbfc3c8..6658a4bcfff 100644 --- a/src/app/qgsbookmarks.cpp +++ b/src/app/qgsbookmarks.cpp @@ -255,6 +255,7 @@ void QgsBookmarks::on_btnZoomTo_clicked() void QgsBookmarks::on_lstBookmarks_itemDoubleClicked( QTreeWidgetItem *lvi ) { + Q_UNUSED( lvi ); zoomToBookmark(); } diff --git a/src/app/qgsconfigureshortcutsdialog.cpp b/src/app/qgsconfigureshortcutsdialog.cpp index f168719705e..d27d1b37ba7 100644 --- a/src/app/qgsconfigureshortcutsdialog.cpp +++ b/src/app/qgsconfigureshortcutsdialog.cpp @@ -234,8 +234,10 @@ QAction* QgsConfigureShortcutsDialog::currentAction() return qobject_cast( action ); } -void QgsConfigureShortcutsDialog::actionChanged( QTreeWidgetItem* current, QTreeWidgetItem* previous ) +void QgsConfigureShortcutsDialog::actionChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous ) { + Q_UNUSED( current ); + Q_UNUSED( previous ); // cancel previous shortcut setting (if any) setGettingShortcut( false ); diff --git a/src/app/qgscustomization.cpp b/src/app/qgscustomization.cpp index 0114a0a7c1d..6f07211fdcd 100644 --- a/src/app/qgscustomization.cpp +++ b/src/app/qgscustomization.cpp @@ -204,6 +204,7 @@ void QgsCustomizationDialog::cancel() void QgsCustomizationDialog::on_actionSave_triggered( bool checked ) { + Q_UNUSED( checked ); QSettings mySettings; QString lastDir = mySettings.value( mLastDirSettingsName, "." ).toString(); @@ -222,6 +223,7 @@ void QgsCustomizationDialog::on_actionSave_triggered( bool checked ) void QgsCustomizationDialog::on_actionLoad_triggered( bool checked ) { + Q_UNUSED( checked ); QSettings mySettings; QString lastDir = mySettings.value( mLastDirSettingsName, "." ).toString(); @@ -240,16 +242,19 @@ void QgsCustomizationDialog::on_actionLoad_triggered( bool checked ) void QgsCustomizationDialog::on_actionExpandAll_triggered( bool checked ) { + Q_UNUSED( checked ); treeWidget->expandAll(); } void QgsCustomizationDialog::on_actionCollapseAll_triggered( bool checked ) { + Q_UNUSED( checked ); treeWidget->collapseAll(); } void QgsCustomizationDialog::on_actionSelectAll_triggered( bool checked ) { + Q_UNUSED( checked ); QList items = treeWidget->findItems( "*", Qt::MatchWildcard | Qt::MatchRecursive, 0 ); QList::iterator i; @@ -348,8 +353,9 @@ QTreeWidgetItem * QgsCustomizationDialog::readWidgetsXmlNode( QDomNode theNode ) return myItem; } -bool QgsCustomizationDialog::switchWidget( QWidget * widget, QMouseEvent *event ) +bool QgsCustomizationDialog::switchWidget( QWidget *widget, QMouseEvent *e ) { + Q_UNUSED( e ); QgsDebugMsg( "Entered" ); if ( !actionCatch->isChecked() ) return false; @@ -752,6 +758,7 @@ void QgsCustomization::openDialog() void QgsCustomization::customizeWidget( QWidget * widget, QEvent * event ) { + Q_UNUSED( event ); // Test if the widget is child of QDialog if ( !widget->inherits( "QDialog" ) ) return; diff --git a/src/app/qgsfieldcalculator.cpp b/src/app/qgsfieldcalculator.cpp index 9213fc554c0..cc2ab4e0475 100644 --- a/src/app/qgsfieldcalculator.cpp +++ b/src/app/qgsfieldcalculator.cpp @@ -426,8 +426,9 @@ void QgsFieldCalculator::on_mAllPushButton_clicked() getFieldValues( 0 ); } -void QgsFieldCalculator::on_mOutputFieldNameLineEdit_textChanged( const QString& text ) +void QgsFieldCalculator::on_mOutputFieldNameLineEdit_textChanged( const QString &text ) { + Q_UNUSED( text ); setOkButtonState(); } @@ -523,7 +524,9 @@ void QgsFieldCalculator::setOkButtonState() } -void QgsFieldCalculator::on_mFieldsListWidget_currentItemChanged( QListWidgetItem * current, QListWidgetItem * previous ) +void QgsFieldCalculator::on_mFieldsListWidget_currentItemChanged( QListWidgetItem *current, QListWidgetItem *previous ) { + Q_UNUSED( current ); + Q_UNUSED( previous ); getFieldValues( 25 ); } diff --git a/src/app/qgsgraduatedsymboldialog.cpp b/src/app/qgsgraduatedsymboldialog.cpp index 583ca892346..bf475642243 100644 --- a/src/app/qgsgraduatedsymboldialog.cpp +++ b/src/app/qgsgraduatedsymboldialog.cpp @@ -544,6 +544,7 @@ int QgsGraduatedSymbolDialog::calculateQuantiles( std::list& result, con QColor QgsGraduatedSymbolDialog::getColorFromRamp( QString ramp, int step, int totalSteps ) { + Q_UNUSED( ramp ); QColor color; /* To do: Grab the ramp by name from a file or ramp registry diff --git a/src/app/qgshandlebadlayers.cpp b/src/app/qgshandlebadlayers.cpp index 2668ebc2eb2..2b660e0c6a4 100644 --- a/src/app/qgshandlebadlayers.cpp +++ b/src/app/qgshandlebadlayers.cpp @@ -47,6 +47,7 @@ QgsHandleBadLayers::QgsHandleBadLayers( const QList &layers, const QDo : QDialog( QgisApp::instance() ) , mLayers( layers ) { + Q_UNUSED( projectDom ); setupUi( this ); mVectorFileFilter = QgsProviderRegistry::instance()->fileVectorFilters(); @@ -166,6 +167,7 @@ void QgsHandleBadLayers::itemChanged( QTableWidgetItem *item ) void QgsHandleBadLayers::cellDoubleClicked( int row, int column ) { + Q_UNUSED( row ); if ( column != 3 || !mBrowseButton->isEnabled() ) return; diff --git a/src/app/qgsidentifyresults.cpp b/src/app/qgsidentifyresults.cpp index c0e2f86dcc4..77c51eab3db 100644 --- a/src/app/qgsidentifyresults.cpp +++ b/src/app/qgsidentifyresults.cpp @@ -53,8 +53,9 @@ class QgsIdentifyResultsDock : public QDockWidget setObjectName( "IdentifyResultsTableDock" ); // set object name so the position can be saved } - virtual void closeEvent( QCloseEvent * ev ) + virtual void closeEvent( QCloseEvent *e ) { + Q_UNUSED( e ); deleteLater(); } }; @@ -145,14 +146,15 @@ void QgsIdentifyResults::addFeature( QgsVectorLayer *vlayer, connect( vlayer, SIGNAL( layerDeleted() ), this, SLOT( layerDestroyed() ) ); connect( vlayer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) ); - connect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) ); - connect( vlayer, SIGNAL( attributeValueChanged( int, int, const QVariant & ) ), this, SLOT( attributeValueChanged( int, int, const QVariant & ) ) ); + connect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) ); + connect( vlayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ), + this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ) ); connect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) ); connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) ); } QTreeWidgetItem *featItem = new QTreeWidgetItem; - featItem->setData( 0, Qt::UserRole, f.id() ); + featItem->setData( 0, Qt::UserRole, FID_TO_STRING( f.id() ) ); featItem->setData( 0, Qt::UserRole + 1, mFeatures.size() ); mFeatures << f; layItem->addChild( featItem ); @@ -395,6 +397,7 @@ void QgsIdentifyResults::closeEvent( QCloseEvent *e ) void QgsIdentifyResults::itemClicked( QTreeWidgetItem *item, int column ) { + Q_UNUSED( column ); if ( item->data( 0, Qt::UserRole ).toString() == "edit" ) { lstResults->setCurrentItem( item ); @@ -648,14 +651,16 @@ QTreeWidgetItem *QgsIdentifyResults::retrieveAttributes( QTreeWidgetItem *item, return featItem; } -void QgsIdentifyResults::itemExpanded( QTreeWidgetItem* item ) +void QgsIdentifyResults::itemExpanded( QTreeWidgetItem *item ) { + Q_UNUSED( item ); expandColumnsToFit(); } void QgsIdentifyResults::handleCurrentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous ) { - if ( current == NULL ) + Q_UNUSED( previous ); + if ( !current ) { emit selectedFeatureChanged( 0, 0 ); return; @@ -709,8 +714,9 @@ void QgsIdentifyResults::disconnectLayer( QObject *layer ) if ( vlayer ) { disconnect( vlayer, SIGNAL( layerDeleted() ), this, SLOT( layerDestroyed() ) ); - disconnect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) ); - disconnect( vlayer, SIGNAL( attributeValueChanged( int, int, const QVariant & ) ), this, SLOT( attributeValueChanged( int, int, const QVariant & ) ) ); + disconnect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) ); + disconnect( vlayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ), + this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ) ); disconnect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) ); disconnect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) ); } @@ -720,7 +726,7 @@ void QgsIdentifyResults::disconnectLayer( QObject *layer ) } } -void QgsIdentifyResults::featureDeleted( int fid ) +void QgsIdentifyResults::featureDeleted( QgsFeatureId fid ) { QTreeWidgetItem *layItem = layerItem( sender() ); @@ -731,7 +737,7 @@ void QgsIdentifyResults::featureDeleted( int fid ) { QTreeWidgetItem *featItem = layItem->child( i ); - if ( featItem && featItem->data( 0, Qt::UserRole ).toInt() == fid ) + if ( featItem && featItem->data( 0, Qt::UserRole ).toString() == FID_TO_STRING( fid ) ) { delete mHighlights.take( featItem ); delete featItem; @@ -750,7 +756,7 @@ void QgsIdentifyResults::featureDeleted( int fid ) } } -void QgsIdentifyResults::attributeValueChanged( int fid, int idx, const QVariant &val ) +void QgsIdentifyResults::attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &val ) { QgsVectorLayer *vlayer = qobject_cast( sender() ); QTreeWidgetItem *layItem = layerItem( sender() ); @@ -762,7 +768,7 @@ void QgsIdentifyResults::attributeValueChanged( int fid, int idx, const QVariant { QTreeWidgetItem *featItem = layItem->child( i ); - if ( featItem && featItem->data( 0, Qt::UserRole ).toInt() == fid ) + if ( featItem && featItem->data( 0, Qt::UserRole ).toString() == FID_TO_STRING( fid ) ) { if ( featItem->data( 0, Qt::DisplayRole ).toString() == vlayer->displayField() ) featItem->setData( 1, Qt::DisplayRole, val ); diff --git a/src/app/qgsidentifyresults.h b/src/app/qgsidentifyresults.h index a741aae5ee2..4a4d59c28ca 100644 --- a/src/app/qgsidentifyresults.h +++ b/src/app/qgsidentifyresults.h @@ -72,7 +72,7 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase void closeEvent( QCloseEvent *e ); signals: - void selectedFeatureChanged( QgsVectorLayer *, int featureId ); + void selectedFeatureChanged( QgsVectorLayer *, QgsFeatureId featureId ); public slots: /** Remove results */ @@ -85,8 +85,8 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase void layerDestroyed(); void editingToggled(); - void featureDeleted( int fid ); - void attributeValueChanged( int fid, int idx, const QVariant & ); + void featureDeleted( QgsFeatureId fid ); + void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & ); void featureForm(); void zoomToFeature(); diff --git a/src/app/qgslabelinggui.cpp b/src/app/qgslabelinggui.cpp index 7b910b4835f..bb90b6caad7 100644 --- a/src/app/qgslabelinggui.cpp +++ b/src/app/qgslabelinggui.cpp @@ -500,6 +500,7 @@ void QgsLabelingGui::on_mFontSizeSpinBox_valueChanged( double d ) void QgsLabelingGui::on_mFontSizeUnitComboBox_currentIndexChanged( int index ) { + Q_UNUSED( index ); updateFont( lblFontPreview->font() ); } diff --git a/src/app/qgslabelpreview.cpp b/src/app/qgslabelpreview.cpp index 21a2125a220..5f9ee2ef365 100644 --- a/src/app/qgslabelpreview.cpp +++ b/src/app/qgslabelpreview.cpp @@ -22,8 +22,9 @@ void QgsLabelPreview::setBuffer( double size, QColor color ) update(); } -void QgsLabelPreview::paintEvent( QPaintEvent* e ) +void QgsLabelPreview::paintEvent( QPaintEvent *e ) { + Q_UNUSED( e ); QPainter p( this ); p.setRenderHint( QPainter::Antialiasing ); diff --git a/src/app/qgsmaptooladdpart.cpp b/src/app/qgsmaptooladdpart.cpp index b348a5533e8..cd57063dc71 100644 --- a/src/app/qgsmaptooladdpart.cpp +++ b/src/app/qgsmaptooladdpart.cpp @@ -135,6 +135,7 @@ void QgsMapToolAddPart::canvasReleaseEvent( QMouseEvent * e ) break; default: Q_ASSERT( !"invalid capture mode" ); + errorCode = 6; break; } diff --git a/src/app/qgsmaptoolannotation.cpp b/src/app/qgsmaptoolannotation.cpp index 4fbf35bdae7..829a9e8c6cf 100644 --- a/src/app/qgsmaptoolannotation.cpp +++ b/src/app/qgsmaptoolannotation.cpp @@ -33,15 +33,15 @@ QgsMapToolAnnotation::QgsMapToolAnnotation( QgsMapCanvas* canvas ): QgsMapTool( QgsMapToolAnnotation::~QgsMapToolAnnotation() { - } -QgsAnnotationItem* QgsMapToolAnnotation::createItem( QMouseEvent* e ) +QgsAnnotationItem* QgsMapToolAnnotation::createItem( QMouseEvent *e ) { + Q_UNUSED( e ); return 0; } -QDialog* QgsMapToolAnnotation::createItemEditor( QgsAnnotationItem* item ) +QDialog* QgsMapToolAnnotation::createItemEditor( QgsAnnotationItem *item ) { if ( !item ) { @@ -63,8 +63,10 @@ QDialog* QgsMapToolAnnotation::createItemEditor( QgsAnnotationItem* item ) return 0; } -void QgsMapToolAnnotation::canvasReleaseEvent( QMouseEvent * e ) +void QgsMapToolAnnotation::canvasReleaseEvent( QMouseEvent *e ) { + Q_UNUSED( e ); + mCurrentMoveAction = QgsAnnotationItem::NoAction; mCanvas->setCursor( mCursor ); } diff --git a/src/app/qgsmaptoolcapture.cpp b/src/app/qgsmaptoolcapture.cpp index 03223204d76..7ab27eb84e7 100644 --- a/src/app/qgsmaptoolcapture.cpp +++ b/src/app/qgsmaptoolcapture.cpp @@ -124,8 +124,9 @@ void QgsMapToolCapture::canvasMoveEvent( QMouseEvent * e ) } // mouseMoveEvent -void QgsMapToolCapture::canvasPressEvent( QMouseEvent * e ) +void QgsMapToolCapture::canvasPressEvent( QMouseEvent *e ) { + Q_UNUSED( e ); // nothing to be done } diff --git a/src/app/qgsmaptoolchangelabelproperties.cpp b/src/app/qgsmaptoolchangelabelproperties.cpp index e9bee074ecc..2113d3ee508 100644 --- a/src/app/qgsmaptoolchangelabelproperties.cpp +++ b/src/app/qgsmaptoolchangelabelproperties.cpp @@ -29,7 +29,7 @@ QgsMapToolChangeLabelProperties::~QgsMapToolChangeLabelProperties() { } -void QgsMapToolChangeLabelProperties::canvasPressEvent( QMouseEvent * e ) +void QgsMapToolChangeLabelProperties::canvasPressEvent( QMouseEvent *e ) { deleteRubberBands(); @@ -47,8 +47,9 @@ void QgsMapToolChangeLabelProperties::canvasPressEvent( QMouseEvent * e ) createRubberBands(); } -void QgsMapToolChangeLabelProperties::canvasReleaseEvent( QMouseEvent * e ) +void QgsMapToolChangeLabelProperties::canvasReleaseEvent( QMouseEvent *e ) { + Q_UNUSED( e ); QgsVectorLayer* vlayer = currentLayer(); if ( mLabelRubberBand && mCanvas && vlayer ) { diff --git a/src/app/qgsmaptooldeletepart.cpp b/src/app/qgsmaptooldeletepart.cpp index 53cbf51d1a5..f1b5df03ad8 100644 --- a/src/app/qgsmaptooldeletepart.cpp +++ b/src/app/qgsmaptooldeletepart.cpp @@ -32,12 +32,13 @@ QgsMapToolDeletePart::~QgsMapToolDeletePart() delete mCross; } -void QgsMapToolDeletePart::canvasMoveEvent( QMouseEvent * e ) +void QgsMapToolDeletePart::canvasMoveEvent( QMouseEvent *e ) { + Q_UNUSED( e ); //nothing to do } -void QgsMapToolDeletePart::canvasPressEvent( QMouseEvent * e ) +void QgsMapToolDeletePart::canvasPressEvent( QMouseEvent *e ) { delete mCross; mCross = 0; @@ -64,8 +65,9 @@ void QgsMapToolDeletePart::canvasPressEvent( QMouseEvent * e ) } } -void QgsMapToolDeletePart::canvasReleaseEvent( QMouseEvent * e ) +void QgsMapToolDeletePart::canvasReleaseEvent( QMouseEvent *e ) { + Q_UNUSED( e ); delete mCross; mCross = 0; @@ -89,7 +91,7 @@ void QgsMapToolDeletePart::canvasReleaseEvent( QMouseEvent * e ) } -void QgsMapToolDeletePart::deletePart( int fId, int beforeVertexNr, QgsVectorLayer* vlayer ) +void QgsMapToolDeletePart::deletePart( QgsFeatureId fId, int beforeVertexNr, QgsVectorLayer* vlayer ) { QgsFeature f; vlayer->featureAtId( fId, f ); diff --git a/src/app/qgsmaptooldeletepart.h b/src/app/qgsmaptooldeletepart.h index d2d6cc86661..d648e93148e 100644 --- a/src/app/qgsmaptooldeletepart.h +++ b/src/app/qgsmaptooldeletepart.h @@ -42,7 +42,7 @@ class QgsMapToolDeletePart: public QgsMapToolVertexEdit QgsVertexMarker* mCross; //! delete part of a geometry - void deletePart( int fId, int beforeVertexNr, QgsVectorLayer* vlayer ); + void deletePart( QgsFeatureId fId, int beforeVertexNr, QgsVectorLayer* vlayer ); //! find out part number of geometry given the snapped vertex number int partNumberOfVertex( QgsGeometry* g, int beforeVertexNr ); diff --git a/src/app/qgsmaptooldeletering.cpp b/src/app/qgsmaptooldeletering.cpp index 1845dfaa1f4..fc8ecf735cf 100644 --- a/src/app/qgsmaptooldeletering.cpp +++ b/src/app/qgsmaptooldeletering.cpp @@ -32,12 +32,13 @@ QgsMapToolDeleteRing::~QgsMapToolDeleteRing() delete mCross; } -void QgsMapToolDeleteRing::canvasMoveEvent( QMouseEvent * e ) +void QgsMapToolDeleteRing::canvasMoveEvent( QMouseEvent *e ) { + Q_UNUSED( e ); //nothing to do } -void QgsMapToolDeleteRing::canvasPressEvent( QMouseEvent * e ) +void QgsMapToolDeleteRing::canvasPressEvent( QMouseEvent *e ) { delete mCross; mCross = 0; @@ -64,8 +65,9 @@ void QgsMapToolDeleteRing::canvasPressEvent( QMouseEvent * e ) } } -void QgsMapToolDeleteRing::canvasReleaseEvent( QMouseEvent * e ) +void QgsMapToolDeleteRing::canvasReleaseEvent( QMouseEvent *e ) { + Q_UNUSED( e ); delete mCross; mCross = 0; @@ -89,7 +91,7 @@ void QgsMapToolDeleteRing::canvasReleaseEvent( QMouseEvent * e ) } -void QgsMapToolDeleteRing::deleteRing( int fId, int beforeVertexNr, QgsVectorLayer* vlayer ) +void QgsMapToolDeleteRing::deleteRing( QgsFeatureId fId, int beforeVertexNr, QgsVectorLayer* vlayer ) { QgsFeature f; vlayer->featureAtId( fId, f ); diff --git a/src/app/qgsmaptooldeletering.h b/src/app/qgsmaptooldeletering.h index 14d9108ab16..a7d69e556b3 100644 --- a/src/app/qgsmaptooldeletering.h +++ b/src/app/qgsmaptooldeletering.h @@ -42,7 +42,7 @@ class QgsMapToolDeleteRing : public QgsMapToolVertexEdit QgsVertexMarker* mCross; //! delete inner ring from the geometry - void deleteRing( int fId, int beforeVertexNr, QgsVectorLayer* vlayer ); + void deleteRing( QgsFeatureId fId, int beforeVertexNr, QgsVectorLayer* vlayer ); //! return ring number in polygon int ringNumInPolygon( QgsGeometry* g, int vertexNr ); diff --git a/src/app/qgsmaptooldeletevertex.cpp b/src/app/qgsmaptooldeletevertex.cpp index cc3c3eb67d6..ef200d3dc0e 100644 --- a/src/app/qgsmaptooldeletevertex.cpp +++ b/src/app/qgsmaptooldeletevertex.cpp @@ -31,13 +31,15 @@ QgsMapToolDeleteVertex::~QgsMapToolDeleteVertex() delete mCross; } -void QgsMapToolDeleteVertex::canvasMoveEvent( QMouseEvent * e ) +void QgsMapToolDeleteVertex::canvasMoveEvent( QMouseEvent *e ) { + Q_UNUSED( e ); //nothing to do } -void QgsMapToolDeleteVertex::canvasPressEvent( QMouseEvent * e ) +void QgsMapToolDeleteVertex::canvasPressEvent( QMouseEvent *e ) { + Q_UNUSED( e ); delete mCross; mCross = 0; @@ -63,8 +65,9 @@ void QgsMapToolDeleteVertex::canvasPressEvent( QMouseEvent * e ) } } -void QgsMapToolDeleteVertex::canvasReleaseEvent( QMouseEvent * e ) +void QgsMapToolDeleteVertex::canvasReleaseEvent( QMouseEvent *e ) { + Q_UNUSED( e ); delete mCross; mCross = 0; diff --git a/src/app/qgsmaptoolidentify.cpp b/src/app/qgsmaptoolidentify.cpp index 844e817430f..c710099f3c0 100644 --- a/src/app/qgsmaptoolidentify.cpp +++ b/src/app/qgsmaptoolidentify.cpp @@ -63,15 +63,17 @@ QgsIdentifyResults *QgsMapToolIdentify::results() return mResults; } -void QgsMapToolIdentify::canvasMoveEvent( QMouseEvent * e ) +void QgsMapToolIdentify::canvasMoveEvent( QMouseEvent *e ) { + Q_UNUSED( e ); } -void QgsMapToolIdentify::canvasPressEvent( QMouseEvent * e ) +void QgsMapToolIdentify::canvasPressEvent( QMouseEvent *e ) { + Q_UNUSED( e ); } -void QgsMapToolIdentify::canvasReleaseEvent( QMouseEvent * e ) +void QgsMapToolIdentify::canvasReleaseEvent( QMouseEvent *e ) { if ( !mCanvas || mCanvas->isDrawing() ) { @@ -251,7 +253,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int { featureCount++; - int fid = f_it->id(); + QgsFeatureId fid = f_it->id(); QMap derivedAttributes; // Calculate derived attributes and insert: @@ -297,7 +299,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int derivedAttributes.insert( "Y", str ); } - derivedAttributes.insert( tr( "feature id" ), fid < 0 ? tr( "new feature" ) : QString::number( fid ) ); + derivedAttributes.insert( tr( "feature id" ), fid < 0 ? tr( "new feature" ) : FID_TO_STRING( fid ) ); results()->addFeature( layer, *f_it, derivedAttributes ); } diff --git a/src/app/qgsmaptoolmovefeature.cpp b/src/app/qgsmaptoolmovefeature.cpp index daf8cedb6f7..507b3c8e6d6 100644 --- a/src/app/qgsmaptoolmovefeature.cpp +++ b/src/app/qgsmaptoolmovefeature.cpp @@ -154,7 +154,7 @@ void QgsMapToolMoveFeature::canvasReleaseEvent( QMouseEvent * e ) double dx = stopPointLayerCoords.x() - startPointLayerCoords.x(); double dy = stopPointLayerCoords.y() - startPointLayerCoords.y(); vlayer->beginEditCommand( tr( "Feature moved" ) ); - foreach( int id, mMovedFeatures ) + foreach( QgsFeatureId id, mMovedFeatures ) { vlayer->translateFeature( id, dx, dy ); } diff --git a/src/app/qgsmaptoolnodetool.cpp b/src/app/qgsmaptoolnodetool.cpp index 3215fd842ce..cec49ca72bb 100644 --- a/src/app/qgsmaptoolnodetool.cpp +++ b/src/app/qgsmaptoolnodetool.cpp @@ -103,7 +103,7 @@ void QgsMapToolNodeTool::currentLayerChanged( QgsMapLayer* layer ) } -void QgsMapToolNodeTool::featureDeleted( int featureId ) +void QgsMapToolNodeTool::featureDeleted( QgsFeatureId featureId ) { //check if deleted feature is the one selected if ( mSelectionFeature != NULL && featureId == mSelectionFeature->featureId() ) @@ -111,17 +111,18 @@ void QgsMapToolNodeTool::featureDeleted( int featureId ) //if it's delete selection and disconnect signals since tool is not used anymore delete mSelectionFeature; mSelectionFeature = NULL; - disconnect( mCanvas->currentLayer(), SIGNAL( featureDeleted( int ) ) ); + disconnect( mCanvas->currentLayer(), SIGNAL( featureDeleted( QgsFeatureId ) ) ); disconnect( mCanvas->currentLayer(), SIGNAL( layerModified( bool ) ) ); } } void QgsMapToolNodeTool::layerModified( bool onlyGeometry ) { + Q_UNUSED( onlyGeometry ); //handling modification of QgsFeature feat; QgsVectorLayer* vlayer = qobject_cast( mCanvas->currentLayer() ); - if ( mSelectionFeature != NULL && !mChangingGeometry && ( vlayer->featureAtId( mSelectionFeature->featureId(), feat, true, false ) ) ) + if ( mSelectionFeature && !mChangingGeometry && vlayer->featureAtId( mSelectionFeature->featureId(), feat, true, false ) ) { if ( !feat.geometry()->isGeosEqual( *mSelectionFeature->feature()->geometry() ) ) { @@ -312,7 +313,7 @@ void QgsMapToolNodeTool::coordinatesChanged() //need to update vertex markers since coordinate systems have changed if ( mSelectionFeature != NULL ) { - mSelectionFeature->updateVertexMarkersPosition( mCanvas ); + mSelectionFeature->updateVertexMarkersPosition(); } } @@ -445,7 +446,7 @@ void QgsMapToolNodeTool::canvasMoveEvent( QMouseEvent * e ) void QgsMapToolNodeTool::connectSignals( QgsVectorLayer* vlayer ) { - connect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) ); + connect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) ); connect( vlayer, SIGNAL( layerModified( bool ) ), this, SLOT( layerModified( bool ) ) ); } @@ -506,7 +507,8 @@ void QgsMapToolNodeTool::canvasPressEvent( QMouseEvent * e ) } mSelectionFeature = new SelectionFeature(); mSelectionFeature->setSelectedFeature( snapResults[0].snappedAtGeometry, vlayer, NULL, mCanvas ); - mIsPoint = (( vlayer->dataProvider()->geometryType() == QGis::WKBPoint ) || ( vlayer->dataProvider()->geometryType() == QGis::WKBMultiPoint ) ); + mIsPoint = vlayer->dataProvider()->geometryType() == QGis::WKBPoint + || vlayer->dataProvider()->geometryType() == QGis::WKBMultiPoint; connectSignals( vlayer ); } else @@ -563,7 +565,8 @@ void QgsMapToolNodeTool::canvasPressEvent( QMouseEvent * e ) mMoving = true; QgsPoint point = mCanvas->getCoordinateTransform()->toMapPoint( e->pos().x(), e->pos().y() ); mClosestVertex = getClosestVertex( toLayerCoordinates( vlayer, point ) ); - if ( !mSelectionFeature->isSelected( snapResult.beforeVertexNr ) || !mSelectionFeature->isSelected( snapResult.afterVertexNr ) ) + if ( !mSelectionFeature->isSelected( snapResult.beforeVertexNr ) || + !mSelectionFeature->isSelected( snapResult.afterVertexNr ) ) { mSelectionFeature->deselectAllVertexes(); mSelectionFeature->selectVertex( snapResult.afterVertexNr ); @@ -644,7 +647,8 @@ void QgsMapToolNodeTool::canvasReleaseEvent( QMouseEvent * e ) { //select another feature (this should deselect current one ;-) ) mSelectionFeature->setSelectedFeature( mAnother, vlayer, NULL, mCanvas ); - mIsPoint = (( vlayer->dataProvider()->geometryType() == QGis::WKBPoint ) || ( vlayer->dataProvider()->geometryType() == QGis::WKBMultiPoint ) ); + mIsPoint = vlayer->dataProvider()->geometryType() == QGis::WKBPoint || + vlayer->dataProvider()->geometryType() == QGis::WKBMultiPoint; mSelectAnother = false; } } @@ -739,7 +743,7 @@ void QgsMapToolNodeTool::deactivate() removeRubberBands(); delete mSelectionFeature; mSelectionFeature = NULL; - disconnect( mCanvas->currentLayer(), SIGNAL( featureDeleted( int ) ) ); + disconnect( mCanvas->currentLayer(), SIGNAL( featureDeleted( QgsFeatureId ) ) ); disconnect( mCanvas->currentLayer(), SIGNAL( layerModified( bool ) ) ); mQRubberBand = NULL; @@ -918,7 +922,11 @@ void SelectionFeature::cleanRubberBandsData() } } -void SelectionFeature::setSelectedFeature( int featureId, QgsVectorLayer* vlayer, QgsRubberBand* rubberBand, QgsMapCanvas* canvas, QgsFeature* feature ) +void SelectionFeature::setSelectedFeature( QgsFeatureId featureId, + QgsVectorLayer* vlayer, + QgsRubberBand* rubberBand, + QgsMapCanvas* canvas, + QgsFeature* feature ) { if ( mFeatureSelected ) { @@ -1397,7 +1405,7 @@ void SelectionFeature::invertVertexSelection( int vertexNr, bool invert ) } -void SelectionFeature::updateVertexMarkersPosition( QgsMapCanvas* canvas ) +void SelectionFeature::updateVertexMarkersPosition() { //function for on-line updating vertex markers without refresh of canvas for ( int i = 0; i < mVertexMap.size(); i++ ) @@ -1408,7 +1416,7 @@ void SelectionFeature::updateVertexMarkersPosition( QgsMapCanvas* canvas ) } -int SelectionFeature::featureId() +QgsFeatureId SelectionFeature::featureId() { return mFeatureId; } diff --git a/src/app/qgsmaptoolnodetool.h b/src/app/qgsmaptoolnodetool.h index 6bf2c2b632d..330fa30962d 100644 --- a/src/app/qgsmaptoolnodetool.h +++ b/src/app/qgsmaptoolnodetool.h @@ -68,7 +68,7 @@ class SelectionFeature: public QObject * @param canvas mapCanvas on which we are working * @param feature feature with which we work this parameter is not mandatory if it's not filled feature will be loaded */ - void setSelectedFeature( int featureId, QgsVectorLayer* vlayer, QgsRubberBand* rubberBand, QgsMapCanvas* canvas, QgsFeature* feature = NULL ); + void setSelectedFeature( QgsFeatureId featureId, QgsVectorLayer* vlayer, QgsRubberBand* rubberBand, QgsMapCanvas* canvas, QgsFeature* feature = NULL ); /** * Function to select vertex with number @@ -110,7 +110,7 @@ class SelectionFeature: public QObject * Updates vertex markers position accoording to changed feature geometry * @param canvas map canvas we are working with */ - void updateVertexMarkersPosition( QgsMapCanvas* canvas ); + void updateVertexMarkersPosition(); /** * Tells if vertex is selected @@ -123,7 +123,7 @@ class SelectionFeature: public QObject * Getting feature Id of feature selected * @return feature id of selected feature */ - int featureId(); + QgsFeatureId featureId(); /** * Getting vertex map of vertexes @@ -207,7 +207,7 @@ class SelectionFeature: public QObject void validateGeometry( QgsGeometry *g = NULL ); QgsFeature* mFeature; - int mFeatureId; + QgsFeatureId mFeatureId; bool mFeatureSelected; QgsVectorLayer* mVlayer; QgsRubberBand* mRubberBand; @@ -258,7 +258,7 @@ class QgsMapToolNodeTool: public QgsMapToolVertexEdit * Processing incoming signal of deleted feature (for deletion of selected feature) * @param featureId id of deleted feature */ - void featureDeleted( int featureId ); + void featureDeleted( QgsFeatureId featureId ); /** * Processing incoming signal of deleted feature (for deletion of selected feature) @@ -328,10 +328,10 @@ class QgsMapToolNodeTool: public QgsMapToolVertexEdit QList mTopologyRubberBand; /** vertexes of rubberbands which are to be moved */ - QMap mTopologyMovingVertexes; + QMap mTopologyMovingVertexes; /** vertexes of features with int id which were already added tu rubber bands */ - QMap mTopologyRubberBandVertexes; + QMap mTopologyRubberBandVertexes; /** object containing selected feature and it's vertexes */ SelectionFeature* mSelectionFeature; @@ -352,7 +352,7 @@ class QgsMapToolNodeTool: public QgsMapToolVertexEdit bool mSelectAnother; /** feature id of another feature where user clicked */ - int mAnother; + QgsFeatureId mAnother; /** stored position of last press down action to count how much vertexes should be moved */ QgsPoint* mLastCoordinates; diff --git a/src/app/qgsmaptoolrotatelabel.cpp b/src/app/qgsmaptoolrotatelabel.cpp index 89696bff8f8..8035b0d3905 100644 --- a/src/app/qgsmaptoolrotatelabel.cpp +++ b/src/app/qgsmaptoolrotatelabel.cpp @@ -36,7 +36,7 @@ QgsMapToolRotateLabel::~QgsMapToolRotateLabel() delete mRotationPreviewBox; } -void QgsMapToolRotateLabel::canvasPressEvent( QMouseEvent * e ) +void QgsMapToolRotateLabel::canvasPressEvent( QMouseEvent *e ) { deleteRubberBands(); @@ -83,7 +83,7 @@ void QgsMapToolRotateLabel::canvasPressEvent( QMouseEvent * e ) } } -void QgsMapToolRotateLabel::canvasMoveEvent( QMouseEvent * e ) +void QgsMapToolRotateLabel::canvasMoveEvent( QMouseEvent *e ) { if ( mLabelRubberBand ) { @@ -120,8 +120,10 @@ void QgsMapToolRotateLabel::canvasMoveEvent( QMouseEvent * e ) } } -void QgsMapToolRotateLabel::canvasReleaseEvent( QMouseEvent * e ) +void QgsMapToolRotateLabel::canvasReleaseEvent( QMouseEvent *e ) { + Q_UNUSED( e ); + if ( !mLabelRubberBand ) //no rubber band created (most likely because the current label cannot be rotated ) { return; diff --git a/src/app/qgsmaptoolrotatepointsymbols.cpp b/src/app/qgsmaptoolrotatepointsymbols.cpp index d33c23ddc64..3c4e2602d4a 100644 --- a/src/app/qgsmaptoolrotatepointsymbols.cpp +++ b/src/app/qgsmaptoolrotatepointsymbols.cpp @@ -66,7 +66,7 @@ bool QgsMapToolRotatePointSymbols::layerIsRotatable( QgsMapLayer* ml ) return true; } -void QgsMapToolRotatePointSymbols::canvasPressEvent( QMouseEvent * e ) +void QgsMapToolRotatePointSymbols::canvasPressEvent( QMouseEvent *e ) { if ( !mCanvas ) { @@ -133,7 +133,7 @@ void QgsMapToolRotatePointSymbols::canvasPressEvent( QMouseEvent * e ) mRotating = true; } -void QgsMapToolRotatePointSymbols::canvasMoveEvent( QMouseEvent * e ) +void QgsMapToolRotatePointSymbols::canvasMoveEvent( QMouseEvent *e ) { if ( !mRotating ) { @@ -178,8 +178,10 @@ void QgsMapToolRotatePointSymbols::canvasMoveEvent( QMouseEvent * e ) setPixmapItemRotation( displayValue ); } -void QgsMapToolRotatePointSymbols::canvasReleaseEvent( QMouseEvent * e ) +void QgsMapToolRotatePointSymbols::canvasReleaseEvent( QMouseEvent *e ) { + Q_UNUSED( e ); + if ( mRotating && mActiveLayer ) { mActiveLayer->beginEditCommand( tr( "Rotate symbol" ) ); diff --git a/src/app/qgsmaptoolrotatepointsymbols.h b/src/app/qgsmaptoolrotatepointsymbols.h index 6bfd593ce01..b35963473e1 100644 --- a/src/app/qgsmaptoolrotatepointsymbols.h +++ b/src/app/qgsmaptoolrotatepointsymbols.h @@ -42,7 +42,7 @@ class QgsMapToolRotatePointSymbols: public QgsMapToolEdit private: QgsVectorLayer* mActiveLayer; - int mFeatureNumber; + QgsFeatureId mFeatureNumber; /**Last azimut between mouse and edited point*/ double mCurrentMouseAzimut; /**Last feature rotation*/ diff --git a/src/app/qgsmaptoolselectrectangle.cpp b/src/app/qgsmaptoolselectrectangle.cpp index 19c7f8462e1..503ec3fe6b9 100644 --- a/src/app/qgsmaptoolselectrectangle.cpp +++ b/src/app/qgsmaptoolselectrectangle.cpp @@ -38,14 +38,15 @@ QgsMapToolSelectRectangle::QgsMapToolSelectRectangle( QgsMapCanvas* canvas ) } -void QgsMapToolSelectRectangle::canvasPressEvent( QMouseEvent * e ) +void QgsMapToolSelectRectangle::canvasPressEvent( QMouseEvent *e ) { + Q_UNUSED( e ); mSelectRect.setRect( 0, 0, 0, 0 ); mRubberBand = new QgsRubberBand( mCanvas, true ); } -void QgsMapToolSelectRectangle::canvasMoveEvent( QMouseEvent * e ) +void QgsMapToolSelectRectangle::canvasMoveEvent( QMouseEvent *e ) { if ( e->buttons() != Qt::LeftButton ) return; @@ -60,7 +61,7 @@ void QgsMapToolSelectRectangle::canvasMoveEvent( QMouseEvent * e ) } -void QgsMapToolSelectRectangle::canvasReleaseEvent( QMouseEvent * e ) +void QgsMapToolSelectRectangle::canvasReleaseEvent( QMouseEvent *e ) { QgsVectorLayer* vlayer = QgsMapToolSelectUtils::getCurrentVectorLayer( mCanvas ); if ( vlayer == NULL ) diff --git a/src/app/qgsmaptoolselectutils.cpp b/src/app/qgsmaptoolselectutils.cpp index eac61fd1ddb..a982eaf6320 100644 --- a/src/app/qgsmaptoolselectutils.cpp +++ b/src/app/qgsmaptoolselectutils.cpp @@ -132,7 +132,7 @@ void QgsMapToolSelectUtils::setSelectFeatures( QgsMapCanvas* canvas, QgsFeatureIds newSelectedFeatures; QgsFeature f; - int closestFeatureId = 0; + QgsFeatureId closestFeatureId = 0; bool foundSingleFeature = false; double closestFeatureDist = std::numeric_limits::max(); while ( vlayer->nextFeature( f ) ) diff --git a/src/app/qgsmeasuredialog.cpp b/src/app/qgsmeasuredialog.cpp index 939494413ec..d2787c48f2f 100644 --- a/src/app/qgsmeasuredialog.cpp +++ b/src/app/qgsmeasuredialog.cpp @@ -121,8 +121,10 @@ void QgsMeasureDialog::mouseMove( QgsPoint &point ) } } -void QgsMeasureDialog::addPoint( QgsPoint &point ) +void QgsMeasureDialog::addPoint( QgsPoint &p ) { + Q_UNUSED( p ); + QSettings settings; int decimalPlaces = settings.value( "/qgis/measure/decimalplaces", "3" ).toInt(); diff --git a/src/app/qgsmergeattributesdialog.cpp b/src/app/qgsmergeattributesdialog.cpp index 8f22029c0ff..2627cb98c0c 100644 --- a/src/app/qgsmergeattributesdialog.cpp +++ b/src/app/qgsmergeattributesdialog.cpp @@ -96,7 +96,7 @@ void QgsMergeAttributesDialog::createTableWidgetContents() for ( int i = 0; i < mFeatureList.size(); ++i ) { - verticalHeaderLabels << QString::number( mFeatureList[i].id() ); + verticalHeaderLabels << FID_TO_STRING( mFeatureList[i].id() ); const QgsAttributeMap &attrs = mFeatureList[i].attributeMap(); @@ -147,7 +147,8 @@ QComboBox* QgsMergeAttributesDialog::createMergeComboBox( QVariant::Type columnT newComboBox->addItem( tr( "Mean" ) ); } - QObject::connect( newComboBox, SIGNAL( currentIndexChanged( const QString& ) ), this, SLOT( comboValueChanged( const QString& ) ) ); + QObject::connect( newComboBox, SIGNAL( currentIndexChanged( const QString& ) ), + this, SLOT( comboValueChanged( const QString& ) ) ); return newComboBox; } @@ -163,8 +164,9 @@ int QgsMergeAttributesDialog::findComboColumn( QComboBox* c ) const return -1; } -void QgsMergeAttributesDialog::comboValueChanged( const QString & text ) +void QgsMergeAttributesDialog::comboValueChanged( const QString &text ) { + Q_UNUSED( text ); QComboBox* senderComboBox = qobject_cast( sender() ); if ( !senderComboBox ) { diff --git a/src/app/qgspastetransformations.cpp b/src/app/qgspastetransformations.cpp index 7f032288a84..79b003e4f6e 100644 --- a/src/app/qgspastetransformations.cpp +++ b/src/app/qgspastetransformations.cpp @@ -166,10 +166,12 @@ void QgsPasteTransformations::addTransfer( const QString& sourceSelectedFieldNam void QgsPasteTransformations::layerChanged( const QString& layerName, std::vector* fields ) { + Q_UNUSED( fields ); + Q_UNUSED( layerName ); // Fetch the fields that will be populated into the Transfer rows. QgsDebugMsg( QString( "Layer changed to %1." ).arg( layerName ) ); - restoreTransfers( sourceLayerComboBox ->currentText(), + restoreTransfers( sourceLayerComboBox->currentText(), destinationLayerComboBox->currentText() ); } diff --git a/src/app/qgspluginregistry.cpp b/src/app/qgspluginregistry.cpp index 8fabe223e17..17960175f73 100644 --- a/src/app/qgspluginregistry.cpp +++ b/src/app/qgspluginregistry.cpp @@ -163,9 +163,13 @@ void QgsPluginRegistry::unloadAll() it++ ) { if ( it->plugin() ) + { it->plugin()->unload(); + } else + { QgsDebugMsg( "warning: plugin is NULL:" + it.key() ); + } } if ( mPythonUtils && mPythonUtils->isEnabled() ) diff --git a/src/app/qgsrastercalcdialog.cpp b/src/app/qgsrastercalcdialog.cpp index 580cd9de418..875ca3454b7 100644 --- a/src/app/qgsrastercalcdialog.cpp +++ b/src/app/qgsrastercalcdialog.cpp @@ -273,8 +273,9 @@ void QgsRasterCalcDialog::on_mExpressionTextEdit_textChanged() mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false ); } -void QgsRasterCalcDialog::on_mOutputLayerLineEdit_textChanged( const QString& text ) +void QgsRasterCalcDialog::on_mOutputLayerLineEdit_textChanged( const QString &text ) { + Q_UNUSED( text ); setAcceptButtonState(); } diff --git a/src/app/qgsrasterlayerproperties.cpp b/src/app/qgsrasterlayerproperties.cpp index d3bf86f9389..8192202c67e 100644 --- a/src/app/qgsrasterlayerproperties.cpp +++ b/src/app/qgsrasterlayerproperties.cpp @@ -2288,6 +2288,8 @@ void QgsRasterLayerProperties::pixelSelected( const QgsPoint& canvasPoint ) void QgsRasterLayerProperties::sboxSingleBandStdDev_valueChanged( double theValue ) { + Q_UNUSED( theValue ); + if ( !ignoreSpinBoxEvent ) { leGrayMin->setText( "" ); @@ -2299,6 +2301,7 @@ void QgsRasterLayerProperties::sboxSingleBandStdDev_valueChanged( double theValu void QgsRasterLayerProperties::sboxThreeBandStdDev_valueChanged( double theValue ) { + Q_UNUSED( theValue ); if ( !ignoreSpinBoxEvent ) { leRedMin->setText( "" ); @@ -2321,6 +2324,7 @@ void QgsRasterLayerProperties::sliderTransparency_valueChanged( int theValue ) void QgsRasterLayerProperties::userDefinedMinMax_textEdited( QString theString ) { + Q_UNUSED( theString ); /* * If all min max values are set and valid, then reset stdDev to 0.0 */ diff --git a/src/app/qgssinglesymboldialog.cpp b/src/app/qgssinglesymboldialog.cpp index ab88a6bff66..3a60e7fc75b 100644 --- a/src/app/qgssinglesymboldialog.cpp +++ b/src/app/qgssinglesymboldialog.cpp @@ -44,8 +44,9 @@ class QgsMarkerListModel : public QAbstractListModel mMarkers = QgsMarkerCatalogue::instance()->list(); } - int rowCount( const QModelIndex & parent = QModelIndex() ) const + int rowCount( const QModelIndex &parent = QModelIndex() ) const { + Q_UNUSED( parent ); return mMarkers.size(); } @@ -655,6 +656,8 @@ void QgsSingleSymbolDialog::setLabel( QString label ) void QgsSingleSymbolDialog::symbolChanged( const QModelIndex ¤t, const QModelIndex &previous ) { + Q_UNUSED( current ); + Q_UNUSED( previous ); emit settingsChanged(); } diff --git a/src/app/qgssnappingdialog.cpp b/src/app/qgssnappingdialog.cpp index 9bc87e3af59..ab1b9fc958a 100644 --- a/src/app/qgssnappingdialog.cpp +++ b/src/app/qgssnappingdialog.cpp @@ -41,9 +41,10 @@ class QgsSnappingDock : public QDockWidget setObjectName( "Snapping and Digitizing Options" ); // set object name so the position can be saved } - virtual void closeEvent( QCloseEvent * ev ) + virtual void closeEvent( QCloseEvent *e ) { - //deleteLater(); + Q_UNUSED( e ); + // deleteLater(); } }; diff --git a/src/app/qgstilescalewidget.cpp b/src/app/qgstilescalewidget.cpp index 67ca1846b09..dfcf8aefcc6 100644 --- a/src/app/qgstilescalewidget.cpp +++ b/src/app/qgstilescalewidget.cpp @@ -83,6 +83,8 @@ void QgsTileScaleWidget::layerChanged( QgsMapLayer *layer ) void QgsTileScaleWidget::scaleChanged( double scale ) { + Q_UNUSED( scale ); + if ( mResolutions.size() == 0 ) return; @@ -106,6 +108,7 @@ void QgsTileScaleWidget::scaleChanged( double scale ) void QgsTileScaleWidget::on_mSlider_valueChanged( int value ) { + Q_UNUSED( value ); QgsDebugMsg( QString( "slider released at %1: %2" ).arg( mSlider->value() ).arg( mResolutions[mSlider->value()] ) ); mMapCanvas->zoomByFactor( mResolutions[mSlider->value()] / mMapCanvas->mapUnitsPerPixel() ); } diff --git a/src/app/qgstipfactory.cpp b/src/app/qgstipfactory.cpp index 59db6decacf..fd187f28730 100644 --- a/src/app/qgstipfactory.cpp +++ b/src/app/qgstipfactory.cpp @@ -244,8 +244,10 @@ QgsTip QgsTipFactory::getGuiTip() QgsTip myTip = mGuiTips.at( myValue ); return myTip; } + int QgsTipFactory::randomNumber( int theMax ) { + Q_UNUSED( theMax ); return 0; } diff --git a/src/app/qgsundowidget.cpp b/src/app/qgsundowidget.cpp index b0e1dc77fb6..8bac0dfabcf 100644 --- a/src/app/qgsundowidget.cpp +++ b/src/app/qgsundowidget.cpp @@ -68,6 +68,7 @@ void QgsUndoWidget::redoChanged( bool value ) void QgsUndoWidget::indexChanged( int value ) { + Q_UNUSED( value ); //redoButton->setDisabled( !value ); //canvas refresh mMapCanvas->refresh(); diff --git a/src/app/spatialite/qgsnewspatialitelayerdialog.cpp b/src/app/spatialite/qgsnewspatialitelayerdialog.cpp index 25e7bb8e543..7b6f6a895b5 100644 --- a/src/app/spatialite/qgsnewspatialitelayerdialog.cpp +++ b/src/app/spatialite/qgsnewspatialitelayerdialog.cpp @@ -138,6 +138,7 @@ QString QgsNewSpatialiteLayerDialog::selectedType() const void QgsNewSpatialiteLayerDialog::on_leLayerName_textChanged( QString text ) { + Q_UNUSED( text ); bool created = leLayerName->text().length() > 0 && mAttributeView->topLevelItemCount() > 0 && createDb(); buttonBox->button( QDialogButtonBox::Ok )->setEnabled( created ); buttonBox->button( QDialogButtonBox::Apply )->setEnabled( created ); diff --git a/src/app/spatialite/qgsspatialitesourceselect.cpp b/src/app/spatialite/qgsspatialitesourceselect.cpp index 4dded7f27dd..8fa449b473c 100644 --- a/src/app/spatialite/qgsspatialitesourceselect.cpp +++ b/src/app/spatialite/qgsspatialitesourceselect.cpp @@ -161,6 +161,7 @@ void QgsSpatiaLiteSourceSelect::on_mSearchColumnComboBox_currentIndexChanged( co void QgsSpatiaLiteSourceSelect::on_mSearchModeComboBox_currentIndexChanged( const QString & text ) { + Q_UNUSED( text ); on_mSearchTableEdit_textChanged( mSearchTableEdit->text() ); } @@ -903,4 +904,5 @@ void QgsSpatiaLiteSourceSelect::setConnectionListPosition() void QgsSpatiaLiteSourceSelect::setSearchExpression( const QString & regexp ) { + Q_UNUSED( regexp ); } diff --git a/src/browser/qgsbrowser.cpp b/src/browser/qgsbrowser.cpp index 549312530ec..fd5293e7da9 100644 --- a/src/browser/qgsbrowser.cpp +++ b/src/browser/qgsbrowser.cpp @@ -525,9 +525,13 @@ void QgsBrowser::refresh( const QModelIndex& index ) { QgsDataItem *item = mModel->dataItem( index ); if ( item ) + { QgsDebugMsg( "path = " + item->path() ); + } else + { QgsDebugMsg( "invalid item" ); + } } mModel->refresh( index ); diff --git a/src/browser/qgsbrowsermodel.cpp b/src/browser/qgsbrowsermodel.cpp index 3d529189cc7..3664cae5f18 100644 --- a/src/browser/qgsbrowsermodel.cpp +++ b/src/browser/qgsbrowsermodel.cpp @@ -117,6 +117,7 @@ QVariant QgsBrowserModel::data( const QModelIndex &index, int role ) const QVariant QgsBrowserModel::headerData( int section, Qt::Orientation orientation, int role ) const { + Q_UNUSED( section ); if ( orientation == Qt::Horizontal && role == Qt::DisplayRole ) { return QVariant( "header" ); @@ -142,7 +143,7 @@ int QgsBrowserModel::rowCount( const QModelIndex &parent ) const } } -bool QgsBrowserModel::hasChildren( const QModelIndex & parent ) const +bool QgsBrowserModel::hasChildren( const QModelIndex &parent ) const { if ( !parent.isValid() ) return true; // root item: its children are top level items @@ -151,8 +152,9 @@ bool QgsBrowserModel::hasChildren( const QModelIndex & parent ) const return item && item->hasChildren(); } -int QgsBrowserModel::columnCount( const QModelIndex & parent ) const +int QgsBrowserModel::columnCount( const QModelIndex &parent ) const { + Q_UNUSED( parent ); return 1; } diff --git a/src/core/composer/qgscomposerarrow.cpp b/src/core/composer/qgscomposerarrow.cpp index ad97fd8bb6d..04f7ca2fe1e 100644 --- a/src/core/composer/qgscomposerarrow.cpp +++ b/src/core/composer/qgscomposerarrow.cpp @@ -58,8 +58,10 @@ void QgsComposerArrow::initGraphicsSettings() setBrush( QBrush( QColor( 255, 255, 255, 0 ) ) ); } -void QgsComposerArrow::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) +void QgsComposerArrow::paint( QPainter* painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget ) { + Q_UNUSED( itemStyle ); + Q_UNUSED( pWidget ); if ( !painter ) { return; @@ -108,16 +110,18 @@ void QgsComposerArrow::setSceneRect( const QRectF& rectangle ) adaptItemSceneRect(); } -void QgsComposerArrow::drawHardcodedMarker( QPainter* p, MarkerType type ) +void QgsComposerArrow::drawHardcodedMarker( QPainter *p, MarkerType type ) { + Q_UNUSED( type ); QBrush arrowBrush = p->brush(); arrowBrush.setColor( mArrowColor ); p->setBrush( arrowBrush ); drawArrowHead( p, mStopPoint.x() - transform().dx(), mStopPoint.y() - transform().dy(), angle( mStartPoint, mStopPoint ), mArrowHeadWidth ); } -void QgsComposerArrow::drawSVGMarker( QPainter* p, MarkerType type, const QString& markerPath ) +void QgsComposerArrow::drawSVGMarker( QPainter* p, MarkerType type, const QString &markerPath ) { + Q_UNUSED( markerPath ); double ang = angle( mStartPoint, mStopPoint ); double arrowHeadHeight; diff --git a/src/core/composer/qgscomposeritem.cpp b/src/core/composer/qgscomposeritem.cpp index 5107388d1d1..c0d7cd182cc 100644 --- a/src/core/composer/qgscomposeritem.cpp +++ b/src/core/composer/qgscomposeritem.cpp @@ -180,6 +180,7 @@ bool QgsComposerItem::_writeXML( QDomElement& itemElem, QDomDocument& doc ) cons bool QgsComposerItem::_readXML( const QDomElement& itemElem, const QDomDocument& doc ) { + Q_UNUSED( doc ); if ( itemElem.isNull() ) { return false; @@ -479,8 +480,14 @@ QgsComposerItem::MouseMoveAction QgsComposerItem::mouseMoveActionForPosition( co return QgsComposerItem::MoveItem; //default } -void QgsComposerItem::changeItemRectangle( const QPointF& currentPosition, const QPointF& mouseMoveStartPos, const QGraphicsRectItem* originalItem, double dx, double dy, QGraphicsRectItem* changeItem ) +void QgsComposerItem::changeItemRectangle( const QPointF& currentPosition, + const QPointF& mouseMoveStartPos, + const QGraphicsRectItem* originalItem, + double dx, double dy, + QGraphicsRectItem* changeItem ) { + Q_UNUSED( dx ); + Q_UNUSED( dy ); if ( !changeItem || !originalItem || !mComposition ) { return; diff --git a/src/core/composer/qgscomposeritemgroup.cpp b/src/core/composer/qgscomposeritemgroup.cpp index 652979804eb..17d8050a195 100644 --- a/src/core/composer/qgscomposeritemgroup.cpp +++ b/src/core/composer/qgscomposeritemgroup.cpp @@ -105,6 +105,8 @@ void QgsComposerItemGroup::removeItems() void QgsComposerItemGroup::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget ) { + Q_UNUSED( option ); + Q_UNUSED( widget ); drawFrame( painter ); if ( isSelected() ) { diff --git a/src/core/composer/qgscomposeritemgroup.h b/src/core/composer/qgscomposeritemgroup.h index ba5ce0ae5d4..d1cd3ebf0ff 100644 --- a/src/core/composer/qgscomposeritemgroup.h +++ b/src/core/composer/qgscomposeritemgroup.h @@ -48,13 +48,15 @@ class CORE_EXPORT QgsComposerItemGroup: public QgsComposerItem * @param elem is Dom element corresponding to 'Composer' tag * @param doc is the Dom document */ - bool writeXML( QDomElement& elem, QDomDocument & doc ) const { return true; } + bool writeXML( QDomElement& elem, QDomDocument & doc ) const + { Q_UNUSED( elem ); Q_UNUSED( doc ); return true; } /** sets state from Dom document * @param itemElem is Dom node corresponding to item tag * @param doc is the Dom document */ - bool readXML( const QDomElement& itemElem, const QDomDocument& doc ) { return true; } + bool readXML( const QDomElement& itemElem, const QDomDocument& doc ) + { Q_UNUSED( itemElem ); Q_UNUSED( doc ); return true; } QSet items() { return mItems; } diff --git a/src/core/composer/qgscomposerlabel.cpp b/src/core/composer/qgscomposerlabel.cpp index 4d5aa29fd12..0d09476e8a3 100644 --- a/src/core/composer/qgscomposerlabel.cpp +++ b/src/core/composer/qgscomposerlabel.cpp @@ -33,6 +33,8 @@ QgsComposerLabel::~QgsComposerLabel() void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { + Q_UNUSED( itemStyle ); + Q_UNUSED( pWidget ); if ( !painter ) { return; diff --git a/src/core/composer/qgscomposerlegend.cpp b/src/core/composer/qgscomposerlegend.cpp index 26af677d034..c3633572c92 100644 --- a/src/core/composer/qgscomposerlegend.cpp +++ b/src/core/composer/qgscomposerlegend.cpp @@ -62,6 +62,8 @@ QgsComposerLegend::~QgsComposerLegend() void QgsComposerLegend::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { + Q_UNUSED( itemStyle ); + Q_UNUSED( pWidget ); paintAndDetermineSize( painter ); } @@ -346,6 +348,7 @@ void QgsComposerLegend::drawSymbol( QPainter* p, QgsSymbol* s, double currentYCo void QgsComposerLegend::drawSymbolV2( QPainter* p, QgsSymbolV2* s, double currentYCoord, double& currentXPosition, double& symbolHeight, int layerOpacity ) const { + Q_UNUSED( layerOpacity ); if ( !p || !s ) { return; diff --git a/src/core/composer/qgscomposermap.cpp b/src/core/composer/qgscomposermap.cpp index 8bc269bb6a0..f6a4e5ca847 100644 --- a/src/core/composer/qgscomposermap.cpp +++ b/src/core/composer/qgscomposermap.cpp @@ -235,6 +235,8 @@ void QgsComposerMap::cache( void ) void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { + Q_UNUSED( pWidget ); + if ( !mComposition || !painter ) { return; diff --git a/src/core/composer/qgscomposerpicture.cpp b/src/core/composer/qgscomposerpicture.cpp index cd36067542e..41ad49f3cf3 100644 --- a/src/core/composer/qgscomposerpicture.cpp +++ b/src/core/composer/qgscomposerpicture.cpp @@ -45,6 +45,8 @@ QgsComposerPicture::~QgsComposerPicture() void QgsComposerPicture::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { + Q_UNUSED( itemStyle ); + Q_UNUSED( pWidget ); if ( !painter ) { return; diff --git a/src/core/composer/qgscomposerscalebar.cpp b/src/core/composer/qgscomposerscalebar.cpp index 101712d4165..e7da3c77b44 100644 --- a/src/core/composer/qgscomposerscalebar.cpp +++ b/src/core/composer/qgscomposerscalebar.cpp @@ -41,6 +41,8 @@ QgsComposerScaleBar::~QgsComposerScaleBar() void QgsComposerScaleBar::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { + Q_UNUSED( itemStyle ); + Q_UNUSED( pWidget ); if ( !mStyle || !painter ) { return; diff --git a/src/core/composer/qgscomposershape.cpp b/src/core/composer/qgscomposershape.cpp index 6a47fa2f9b1..d0cb178e80b 100644 --- a/src/core/composer/qgscomposershape.cpp +++ b/src/core/composer/qgscomposershape.cpp @@ -38,6 +38,8 @@ QgsComposerShape::~QgsComposerShape() void QgsComposerShape::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { + Q_UNUSED( itemStyle ); + Q_UNUSED( pWidget ); if ( !painter ) { return; diff --git a/src/core/composer/qgscomposertable.cpp b/src/core/composer/qgscomposertable.cpp index 0802f083d9c..8776cdfa713 100644 --- a/src/core/composer/qgscomposertable.cpp +++ b/src/core/composer/qgscomposertable.cpp @@ -19,9 +19,13 @@ #include "qgslogger.h" #include -QgsComposerTable::QgsComposerTable( QgsComposition* composition ): QgsComposerItem( composition ), mLineTextDistance( 1.0 ), mShowGrid( true ), mGridStrokeWidth( 0.5 ), mGridColor( QColor( 0, 0, 0 ) ) +QgsComposerTable::QgsComposerTable( QgsComposition* composition ) + : QgsComposerItem( composition ) + , mLineTextDistance( 1.0 ) + , mShowGrid( true ) + , mGridStrokeWidth( 0.5 ) + , mGridColor( QColor( 0, 0, 0 ) ) { - } QgsComposerTable::~QgsComposerTable() @@ -31,6 +35,8 @@ QgsComposerTable::~QgsComposerTable() void QgsComposerTable::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { + Q_UNUSED( itemStyle ); + Q_UNUSED( pWidget ); if ( !painter ) { return; diff --git a/src/core/composer/qgscomposertable.h b/src/core/composer/qgscomposertable.h index daa526d2786..cd54e572c57 100644 --- a/src/core/composer/qgscomposertable.h +++ b/src/core/composer/qgscomposertable.h @@ -74,7 +74,8 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem QColor mGridColor; /**Retrieves feature attributes*/ - virtual bool getFeatureAttributes( QList& attributes ) {return false;} //= 0; + virtual bool getFeatureAttributes( QList& attributes ) + { Q_UNUSED( attributes ); return false; } //= 0; virtual QMap getHeaderLabels() const { return QMap(); } //= 0; /**Calculate the maximum width values of the vector attributes*/ virtual bool calculateMaxColumnWidths( QMap& maxWidthMap, const QList& attributeList ) const; diff --git a/src/core/composer/qgscomposition.cpp b/src/core/composer/qgscomposition.cpp index 4f74997a085..0678182266d 100644 --- a/src/core/composer/qgscomposition.cpp +++ b/src/core/composer/qgscomposition.cpp @@ -199,6 +199,7 @@ bool QgsComposition::writeXML( QDomElement& composerElem, QDomDocument& doc ) bool QgsComposition::readXML( const QDomElement& compositionElem, const QDomDocument& doc ) { + Q_UNUSED( doc ); if ( compositionElem.isNull() ) { return false; diff --git a/src/core/composer/qgslegendmodel.cpp b/src/core/composer/qgslegendmodel.cpp index b0af17a2b6a..f11a5f0cf6f 100644 --- a/src/core/composer/qgslegendmodel.cpp +++ b/src/core/composer/qgslegendmodel.cpp @@ -485,6 +485,8 @@ bool QgsLegendModel::writeXML( QDomElement& composerLegendElem, QDomDocument& do bool QgsLegendModel::readXML( const QDomElement& legendModelElem, const QDomDocument& doc ) { + Q_UNUSED( doc ); + if ( legendModelElem.isNull() ) { return false; @@ -617,6 +619,9 @@ QStringList QgsLegendModel::mimeTypes() const bool QgsLegendModel::dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ) { + Q_UNUSED( action ); + Q_UNUSED( column ); + if ( !data->hasFormat( "text/xml" ) ) { return false; diff --git a/src/core/composer/qgslegendmodel.h b/src/core/composer/qgslegendmodel.h index ffa2d48b1ea..4fe8b40a29b 100644 --- a/src/core/composer/qgslegendmodel.h +++ b/src/core/composer/qgslegendmodel.h @@ -64,9 +64,12 @@ class CORE_EXPORT QgsLegendModel: public QStandardItemModel /**Updates the whole symbology of a layer*/ void updateLayer( QStandardItem* layerItem ); /**Tries to update a single classification item*/ - void updateVectorClassificationItem( QStandardItem* classificationItem, QgsSymbol* symbol, QString itemText ) {} - void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbolV2* symbol, QString itemText ) {} - void updateRasterClassificationItem( QStandardItem* classificationItem ) {} + void updateVectorClassificationItem( QStandardItem* classificationItem, QgsSymbol* symbol, QString itemText ) + { Q_UNUSED( classificationItem ); Q_UNUSED( symbol ); Q_UNUSED( itemText ); } + void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbolV2* symbol, QString itemText ) + { Q_UNUSED( classificationItem ); Q_UNUSED( symbol ); Q_UNUSED( itemText ); } + void updateRasterClassificationItem( QStandardItem* classificationItem ) + { Q_UNUSED( classificationItem ); } bool writeXML( QDomElement& composerLegendElem, QDomDocument& doc ) const; bool readXML( const QDomElement& legendModelElem, const QDomDocument& doc ); diff --git a/src/core/composer/qgsnumericscalebarstyle.cpp b/src/core/composer/qgsnumericscalebarstyle.cpp index ad3a3403ece..71b1119974e 100644 --- a/src/core/composer/qgsnumericscalebarstyle.cpp +++ b/src/core/composer/qgsnumericscalebarstyle.cpp @@ -42,6 +42,7 @@ QString QgsNumericScaleBarStyle::name() const void QgsNumericScaleBarStyle::draw( QPainter* p, double xOffset ) const { + Q_UNUSED( xOffset ); if ( !p || !mScaleBar ) { return; diff --git a/src/core/composer/qgspaperitem.cpp b/src/core/composer/qgspaperitem.cpp index f42ecb5db81..fc33ff0c176 100644 --- a/src/core/composer/qgspaperitem.cpp +++ b/src/core/composer/qgspaperitem.cpp @@ -40,6 +40,8 @@ QgsPaperItem::~QgsPaperItem() void QgsPaperItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { + Q_UNUSED( itemStyle ); + Q_UNUSED( pWidget ); if ( !painter ) { return; @@ -110,11 +112,15 @@ void QgsPaperItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* ite bool QgsPaperItem::writeXML( QDomElement& elem, QDomDocument & doc ) const { + Q_UNUSED( elem ); + Q_UNUSED( doc ); return true; } bool QgsPaperItem::readXML( const QDomElement& itemElem, const QDomDocument& doc ) { + Q_UNUSED( itemElem ); + Q_UNUSED( doc ); return true; } diff --git a/src/core/gps/qextserialport/posix_qextserialport.cpp b/src/core/gps/qextserialport/posix_qextserialport.cpp index cced8433060..a39da0b9b63 100644 --- a/src/core/gps/qextserialport/posix_qextserialport.cpp +++ b/src/core/gps/qextserialport/posix_qextserialport.cpp @@ -959,4 +959,5 @@ qint64 QextSerialPort::writeData(const char * data, qint64 maxSize) void QextSerialPort::onWinEvent( HANDLE h ) { + Q_UNUSED(h); } diff --git a/src/core/gps/qextserialport/qextserialport.cpp b/src/core/gps/qextserialport/qextserialport.cpp index 2a754cd8b11..f3342d60151 100644 --- a/src/core/gps/qextserialport/qextserialport.cpp +++ b/src/core/gps/qextserialport/qextserialport.cpp @@ -158,8 +158,8 @@ QString QextSerialPort::portName() const */ QByteArray QextSerialPort::readAll() { - int avail = this->bytesAvailable(); - return (avail > 0) ? this->read(avail) : QByteArray(); + qint64 avail = bytesAvailable(); + return avail > 0 ? read(avail) : QByteArray(); } /*! diff --git a/src/core/gps/qgsgpsdconnection.cpp b/src/core/gps/qgsgpsdconnection.cpp index 174f1c75db9..cb1e64ff6e2 100644 --- a/src/core/gps/qgsgpsdconnection.cpp +++ b/src/core/gps/qgsgpsdconnection.cpp @@ -49,5 +49,7 @@ void QgsGpsdConnection::error( QAbstractSocket::SocketError socketError ) #if QGISDEBUG QTcpSocket *socket = qobject_cast< QTcpSocket * >( mSource ); QgsDebugMsg( QString( "error: %1 %2" ).arg( socketError ).arg( socket->errorString() ) ); +#else + Q_UNUSED( socketError ); #endif } diff --git a/src/core/gps/qgsgpsdetector.cpp b/src/core/gps/qgsgpsdetector.cpp index 91a0a881304..4ce739e1411 100644 --- a/src/core/gps/qgsgpsdetector.cpp +++ b/src/core/gps/qgsgpsdetector.cpp @@ -145,7 +145,7 @@ void QgsGPSDetector::advance() Q_ASSERT( gpsParams.size() >= 3 ); - mConn = new QgsGpsdConnection( gpsParams[0], gpsParams[1].toInt(), gpsParams[2] ); + mConn = new QgsGpsdConnection( gpsParams[0], gpsParams[1].toShort(), gpsParams[2] ); } else { @@ -177,6 +177,8 @@ void QgsGPSDetector::advance() void QgsGPSDetector::detected( const QgsGPSInformation& info ) { + Q_UNUSED( info ); + if ( !mConn ) { // advance if connection was destroyed diff --git a/src/core/gps/qgsnmeaconnection.cpp b/src/core/gps/qgsnmeaconnection.cpp index acfc96d31fb..aee451b8643 100644 --- a/src/core/gps/qgsnmeaconnection.cpp +++ b/src/core/gps/qgsnmeaconnection.cpp @@ -47,7 +47,7 @@ void QgsNMEAConnection::parseData() } //print out the data as a test - int numBytes = 0; + qint64 numBytes = 0; if ( mSource->isSequential() ) //necessary because of a bug in QExtSerialPort { numBytes = mSource->size(); diff --git a/src/core/gps/tok.c b/src/core/gps/tok.c index 0796e1b82f7..25f25cdf8fe 100644 --- a/src/core/gps/tok.c +++ b/src/core/gps/tok.c @@ -41,7 +41,7 @@ int nmea_calc_crc( const char *buff, int buff_sz ) /** * \brief Convert string to number */ -int nmea_atoi( const char *str, int str_sz, int radix ) +int nmea_atoi( const char *str, size_t str_sz, int radix ) { char *tmp_ptr; char buff[NMEA_CONVSTR_BUF]; diff --git a/src/core/gps/tok.h b/src/core/gps/tok.h index d5f0d52540e..1dfd128cd20 100644 --- a/src/core/gps/tok.h +++ b/src/core/gps/tok.h @@ -12,6 +12,7 @@ #define __NMEA_TOK_H__ #include "config.h" +#include "stdlib.h" #ifdef __cplusplus extern "C" @@ -19,7 +20,7 @@ extern "C" #endif int nmea_calc_crc( const char *buff, int buff_sz ); - int nmea_atoi( const char *str, int str_sz, int radix ); + int nmea_atoi( const char *str, size_t str_sz, int radix ); double nmea_atof( const char *str, int str_sz ); int nmea_printf( char *buff, int buff_sz, const char *format, ... ); int nmea_scanf( const char *buff, int buff_sz, const char *format, ... ); diff --git a/src/core/pal/feature.cpp b/src/core/pal/feature.cpp index 697b150f32d..64bd4e166c3 100644 --- a/src/core/pal/feature.cpp +++ b/src/core/pal/feature.cpp @@ -38,6 +38,8 @@ #include #endif +#include + #include #include @@ -255,6 +257,8 @@ namespace pal int FeaturePart::setPositionOverPoint( double x, double y, double scale, LabelPosition ***lPos, double delta_width ) { + Q_UNUSED( scale ); + Q_UNUSED( delta_width ); int nbp = 3; *lPos = new LabelPosition *[nbp]; diff --git a/src/core/pal/pal.cpp b/src/core/pal/pal.cpp index f98e3aa359b..d95e5f6593a 100644 --- a/src/core/pal/pal.cpp +++ b/src/core/pal/pal.cpp @@ -343,6 +343,7 @@ namespace pal */ Problem* Pal::extract( int nbLayers, char **layersName, double *layersFactor, double lambda_min, double phi_min, double lambda_max, double phi_max, double scale, std::ofstream *svgmap ) { + Q_UNUSED( svgmap ); // to store obstacles RTree *obstacles = new RTree(); diff --git a/src/core/pal/pointset.cpp b/src/core/pal/pointset.cpp index 8a2e7ac3a86..a1beefd976a 100644 --- a/src/core/pal/pointset.cpp +++ b/src/core/pal/pointset.cpp @@ -38,6 +38,8 @@ #include #endif +#include + #include "pointset.h" #include "util.h" @@ -197,6 +199,8 @@ namespace pal { #ifdef _DEBUG_ std::cout << "splitPolygons: " << uid << std::endl; +#else + Q_UNUSED( uid ); #endif int i, j; diff --git a/src/core/qgsattributeaction.cpp b/src/core/qgsattributeaction.cpp index 100c08118e5..0882c52d772 100644 --- a/src/core/qgsattributeaction.cpp +++ b/src/core/qgsattributeaction.cpp @@ -103,7 +103,7 @@ QString QgsAttributeAction::expandAction( QString action, const QgsAttributeMap // for the actual substitutions. QString expanded_action; - if ( clickedOnValue >= 0 && attributes.contains( clickedOnValue ) ) + if ( attributes.contains( clickedOnValue ) ) expanded_action = action.replace( "%%", attributes[clickedOnValue].toString() ); else expanded_action = action; diff --git a/src/core/qgscentralpointpositionmanager.cpp b/src/core/qgscentralpointpositionmanager.cpp index aa0412a731a..833b9bf5a38 100644 --- a/src/core/qgscentralpointpositionmanager.cpp +++ b/src/core/qgscentralpointpositionmanager.cpp @@ -33,6 +33,7 @@ QgsCentralPointPositionManager::~QgsCentralPointPositionManager() void QgsCentralPointPositionManager::addLayer( QgsVectorLayer* vl, QList& overlays ) { + Q_UNUSED( vl ); mOverlays << overlays; } @@ -43,6 +44,8 @@ void QgsCentralPointPositionManager::removeLayers() void QgsCentralPointPositionManager::findObjectPositions( const QgsRenderContext& context, QGis::UnitType unitType ) { + Q_UNUSED( context ); + Q_UNUSED( unitType ); QList::iterator overlay_it = mOverlays.begin(); QgsVectorOverlay* currentOverlay = 0; QgsPoint currentPosition; @@ -55,13 +58,13 @@ void QgsCentralPointPositionManager::findObjectPositions( const QgsRenderContext continue; } - QMap* objectMap = currentOverlay->overlayObjects(); + QMap* objectMap = currentOverlay->overlayObjects(); if ( !objectMap ) { continue; } - QMap::iterator object_it = objectMap->begin(); + QMap::iterator object_it = objectMap->begin(); for ( ; object_it != objectMap->end(); ++object_it ) { if ( findObjectPosition( object_it.value()->geometry()->asWkb(), currentPosition ) == 0 ) diff --git a/src/core/qgscoordinatetransform.cpp b/src/core/qgscoordinatetransform.cpp index 633cfbe91d3..7d3d5754725 100644 --- a/src/core/qgscoordinatetransform.cpp +++ b/src/core/qgscoordinatetransform.cpp @@ -563,6 +563,8 @@ const char *finder( const char *name ) #ifdef WIN32 proj = QApplication::applicationDirPath() + "/share/proj/" + QString( name ); +#else + Q_UNUSED( name ); #endif return proj.toUtf8(); } diff --git a/src/core/qgsdataitem.h b/src/core/qgsdataitem.h index 98e7a12a4de..0ddc5ad0e92 100644 --- a/src/core/qgsdataitem.h +++ b/src/core/qgsdataitem.h @@ -85,7 +85,8 @@ class CORE_EXPORT QgsDataItem : public QObject }; // This will _write_ selected crs in data source - virtual bool setCrs( QgsCoordinateReferenceSystem crs ) { return false; } + virtual bool setCrs( QgsCoordinateReferenceSystem crs ) + { Q_UNUSED( crs ); return false; } virtual Capability capabilities() { return NoCapabilities; } diff --git a/src/core/qgsdataprovider.h b/src/core/qgsdataprovider.h index d7d2cc99785..17abd56a869 100644 --- a/src/core/qgsdataprovider.h +++ b/src/core/qgsdataprovider.h @@ -129,6 +129,7 @@ class CORE_EXPORT QgsDataProvider : public QObject { // NOP by default Q_UNUSED( subset ); + Q_UNUSED( updateFeatureCount ); return false; } diff --git a/src/core/qgsdiagram.cpp b/src/core/qgsdiagram.cpp index a565a82c2fd..a22c74361ac 100644 --- a/src/core/qgsdiagram.cpp +++ b/src/core/qgsdiagram.cpp @@ -18,6 +18,7 @@ void QgsDiagram::setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsR QSizeF QgsDiagram::sizePainterUnits( const QSizeF& size, const QgsDiagramSettings& s, const QgsRenderContext& c ) { + Q_UNUSED( size ); if ( s.sizeType == QgsDiagramSettings::MM ) { return QSizeF( s.size.width() * c.scaleFactor(), s.size.height() * c.scaleFactor() ); diff --git a/src/core/qgsdiagramrendererv2.cpp b/src/core/qgsdiagramrendererv2.cpp index c2ae7c62a33..8cc7e38443e 100644 --- a/src/core/qgsdiagramrendererv2.cpp +++ b/src/core/qgsdiagramrendererv2.cpp @@ -214,6 +214,7 @@ void QgsDiagramRendererV2::_readXML( const QDomElement& elem ) void QgsDiagramRendererV2::_writeXML( QDomElement& rendererElem, QDomDocument& doc ) const { + Q_UNUSED( doc ); if ( mDiagram ) { rendererElem.setAttribute( "diagramType", mDiagram->diagramName() ); @@ -230,6 +231,7 @@ QgsSingleCategoryDiagramRenderer::~QgsSingleCategoryDiagramRenderer() bool QgsSingleCategoryDiagramRenderer::diagramSettings( const QgsAttributeMap&, const QgsRenderContext& c, QgsDiagramSettings& s ) { + Q_UNUSED( c ); s = mSettings; return true; } @@ -296,6 +298,7 @@ QList QgsLinearlyInterpolatedDiagramRenderer::diagramAttributes() const QSizeF QgsLinearlyInterpolatedDiagramRenderer::diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c ) { + Q_UNUSED( c ); QgsAttributeMap::const_iterator attIt = attributes.find( mClassificationAttribute ); if ( attIt == attributes.constEnd() ) { diff --git a/src/core/qgsdiagramrendererv2.h b/src/core/qgsdiagramrendererv2.h index 0399a20e9b3..2dc443eecbf 100644 --- a/src/core/qgsdiagramrendererv2.h +++ b/src/core/qgsdiagramrendererv2.h @@ -37,8 +37,18 @@ struct CORE_EXPORT QgsDiagramLayerSettings MapOrientation = 8 }; - QgsDiagramLayerSettings(): placement( AroundPoint ), placementFlags( OnLine ), priority( 5 ), obstacle( false ), dist( 0.0 ), renderer( 0 ), - palLayer( 0 ), ct( 0 ), xform( 0 ), xPosColumn( -1 ), yPosColumn( -1 ) + QgsDiagramLayerSettings() + : placement( AroundPoint ) + , placementFlags( OnLine ) + , priority( 5 ) + , obstacle( false ) + , dist( 0.0 ) + , renderer( 0 ) + , palLayer( 0 ) + , ct( 0 ) + , xform( 0 ) + , xPosColumn( -1 ) + , yPosColumn( -1 ) { } @@ -165,7 +175,8 @@ class CORE_EXPORT QgsSingleCategoryDiagramRenderer: public QgsDiagramRendererV2 protected: bool diagramSettings( const QgsAttributeMap&, const QgsRenderContext& c, QgsDiagramSettings& s ); - QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c ) { return mSettings.size; } + QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c ) + { Q_UNUSED( attributes ); Q_UNUSED( c ); return mSettings.size; } private: QgsDiagramSettings mSettings; diff --git a/src/core/qgsfeature.cpp b/src/core/qgsfeature.cpp index fa80037c8fc..0eda78bf862 100644 --- a/src/core/qgsfeature.cpp +++ b/src/core/qgsfeature.cpp @@ -21,7 +21,7 @@ email : sherman at mrcc.com * \brief Encapsulates a spatial feature with attributes */ -QgsFeature::QgsFeature( int id, QString typeName ) +QgsFeature::QgsFeature( QgsFeatureId id, QString typeName ) : mFid( id ) , mGeometry( 0 ) , mOwnsGeometry( 0 ) @@ -88,7 +88,7 @@ QgsFeature::~QgsFeature() * Get the feature id for this feature * @return Feature id */ -int QgsFeature::id() const +QgsFeatureId QgsFeature::id() const { return mFid; } @@ -150,7 +150,7 @@ QgsGeometry *QgsFeature::geometryAndOwnership() /** Set the feature id */ -void QgsFeature::setFeatureId( int id ) +void QgsFeature::setFeatureId( QgsFeatureId id ) { mFid = id; } diff --git a/src/core/qgsfeature.h b/src/core/qgsfeature.h index d78f82e56c0..1728657dc4e 100644 --- a/src/core/qgsfeature.h +++ b/src/core/qgsfeature.h @@ -20,24 +20,80 @@ email : sherman at mrcc.com #include #include #include +#include class QgsGeometry; class QgsRectangle; class QgsFeature; +// feature id class (currently 64 bit) +#if 0 +#include + +class QgsFeatureId +{ + public: + QgsFeatureId( qint64 id = 0 ) : mId( id ) {} + QgsFeatureId( QString str ) : mId( str.toLongLong() ) {} + QgsFeatureId &operator=( const QgsFeatureId &other ) { mId = other.mId; return *this; } + QgsFeatureId &operator++() { mId++; return *this; } + QgsFeatureId operator++( int ) { QgsFeatureId pId = mId; ++( *this ); return pId; } + + bool operator==( const QgsFeatureId &id ) const { return mId == id.mId; } + bool operator!=( const QgsFeatureId &id ) const { return mId != id.mId; } + bool operator<( const QgsFeatureId &id ) const { return mId < id.mId; } + bool operator>( const QgsFeatureId &id ) const { return mId > id.mId; } + operator QString() const { return QString::number( mId ); } + + bool isNew() const + { + return mId < 0; + } + + qint64 toLongLong() const + { + return mId; + } + + private: + qint64 mId; + + friend uint qHash( const QgsFeatureId &id ); +}; + +inline uint qHash( const QgsFeatureId &id ) +{ + return qHash( id.mId ); +} + +#define FID_IS_NEW(fid) (fid).isNew() +#define FID_TO_NUMBER(fid) (fid).toLongLong() +#define FID_TO_STRING(fid) static_cast(fid) +#define STRING_TO_FID(str) QgsFeatureId(str) +#endif + +// 64 bit feature ids +#if 1 +typedef qint64 QgsFeatureId; +#define FID_IS_NEW(fid) (fid<0) +#define FID_TO_NUMBER(fid) static_cast(fid) +#define FID_TO_STRING(fid) QString::number( fid ) +#define STRING_TO_FID(str) (str).toLongLong() +#endif + +// 32 bit feature ids +#if 0 +typedef int QgsFeatureId; +#define FID_IS_NEW(fid) (fid<0) +#define FID_TO_NUMBER(fid) static_cast(fid) +#define FID_TO_STRING(fid) QString::number( fid ) +#define STRING_TO_FID(str) (str).toLong() +#endif + + // key = field index, value = field value typedef QMap QgsAttributeMap; -// key = feature id, value = changed attributes -typedef QMap QgsChangedAttributesMap; - -// key = feature id, value = changed geometry -typedef QMap QgsGeometryMap; - -// key = field index, value = field name -typedef QMap QgsFieldNameMap; - -typedef QList QgsFeatureList; /** \ingroup core * The feature class encapsulates a single feature including its id, @@ -49,7 +105,7 @@ class CORE_EXPORT QgsFeature { public: //! Constructor - QgsFeature( int id = 0, QString typeName = "" ); + QgsFeature( QgsFeatureId id = QgsFeatureId(), QString typeName = "" ); /** copy ctor needed due to internal pointer */ QgsFeature( QgsFeature const & rhs ); @@ -60,18 +116,17 @@ class CORE_EXPORT QgsFeature //! Destructor ~QgsFeature(); - /** * Get the feature id for this feature * @return Feature id */ - int id() const; + QgsFeatureId id() const; /** * Set the feature id for this feature * @param id Feature id */ - void setFeatureId( int id ); + void setFeatureId( QgsFeatureId id ); /** returns the feature's type name @@ -163,7 +218,7 @@ class CORE_EXPORT QgsFeature private: //! feature id - int mFid; + QgsFeatureId mFid; /** map of attributes accessed by field index */ QgsAttributeMap mAttributes; @@ -193,5 +248,17 @@ class CORE_EXPORT QgsFeature }; // class QgsFeature +// key = feature id, value = changed attributes +typedef QMap QgsChangedAttributesMap; + +// key = feature id, value = changed geometry +typedef QMap QgsGeometryMap; + +typedef QSet QgsFeatureIds; + +// key = field index, value = field name +typedef QMap QgsFieldNameMap; + +typedef QList QgsFeatureList; #endif diff --git a/src/core/qgsgeometry.cpp b/src/core/qgsgeometry.cpp index e33e6e0dbd6..bdf9f8084d9 100644 --- a/src/core/qgsgeometry.cpp +++ b/src/core/qgsgeometry.cpp @@ -104,6 +104,8 @@ static void printGEOSNotice( const char *fmt, ... ) va_end( ap ); QgsDebugMsg( QString( "GEOS notice: %1" ).arg( QString::fromUtf8( buffer ) ) ); +#else + Q_UNUSED( fmt ); #endif } diff --git a/src/core/qgshttptransaction.cpp b/src/core/qgshttptransaction.cpp index c78a26988f5..01f7ecd6b18 100644 --- a/src/core/qgshttptransaction.cpp +++ b/src/core/qgshttptransaction.cpp @@ -48,6 +48,12 @@ QgsHttpTransaction::QgsHttpTransaction( QString uri, , httphost( proxyHost ) , mError( "" ) { + Q_UNUSED( proxyPort ); + Q_UNUSED( proxyUser ); + Q_UNUSED( proxyPass ); + Q_UNUSED( proxyType ); + Q_UNUSED( userName ); + Q_UNUSED( password ); QSettings s; mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt(); } @@ -245,6 +251,7 @@ QString QgsHttpTransaction::responseContentType() void QgsHttpTransaction::dataStarted( int id ) { + Q_UNUSED( id ); QgsDebugMsg( "ID=" + QString::number( id ) + "." ); } @@ -282,6 +289,7 @@ void QgsHttpTransaction::dataHeaderReceived( const QHttpResponseHeader& resp ) void QgsHttpTransaction::dataReceived( const QHttpResponseHeader& resp ) { + Q_UNUSED( resp ); // TODO: Match 'resp' with 'http' if we move to multiple http connections #if 0 @@ -325,7 +333,6 @@ void QgsHttpTransaction::dataProgress( int done, int total ) void QgsHttpTransaction::dataFinished( int id, bool error ) { - #ifdef QGISDEBUG QgsDebugMsg( "ID=" + QString::number( id ) + "." ); @@ -355,6 +362,9 @@ void QgsHttpTransaction::dataFinished( int id, bool error ) { QgsDebugMsg( "no error." ); } +#else + Q_UNUSED( id ); + Q_UNUSED( error ); #endif // Don't do this here as the request could have simply been @@ -372,7 +382,6 @@ void QgsHttpTransaction::dataFinished( int id, bool error ) void QgsHttpTransaction::transactionFinished( bool error ) { - #ifdef QGISDEBUG QgsDebugMsg( "entered." ); @@ -404,6 +413,8 @@ void QgsHttpTransaction::transactionFinished( bool error ) { QgsDebugMsg( "no error." ); } +#else + Q_UNUSED( error ); #endif // TODO diff --git a/src/core/qgslabel.cpp b/src/core/qgslabel.cpp index 85a4eb10422..0d2d1de62b0 100644 --- a/src/core/qgslabel.cpp +++ b/src/core/qgslabel.cpp @@ -84,9 +84,11 @@ QString QgsLabel::fieldValue( int attr, QgsFeature &feature ) } void QgsLabel::renderLabel( QgsRenderContext &renderContext, - QgsFeature &feature, bool selected, + QgsFeature &feature, + bool selected, QgsLabelAttributes *classAttributes ) { + Q_UNUSED( classAttributes ); if ( mLabelAttributes->selectedOnly() && !selected ) return; diff --git a/src/core/qgslogger.h b/src/core/qgslogger.h index effcc578371..1e1982f3416 100644 --- a/src/core/qgslogger.h +++ b/src/core/qgslogger.h @@ -73,6 +73,7 @@ class CORE_EXPORT QgsLogger template static void debug( const QString& var, T val, const char* file = 0, const char* function = 0, int line = -1, int debuglevel = 1 ) { + Q_UNUSED( debuglevel ); const char* dfile = debugFile(); if ( dfile ) //exit if QGIS_DEBUG_FILE is set and the message comes from the wrong file { diff --git a/src/core/qgsmaplayer.cpp b/src/core/qgsmaplayer.cpp index a21ee3bb104..11f9b51b4c6 100644 --- a/src/core/qgsmaplayer.cpp +++ b/src/core/qgsmaplayer.cpp @@ -133,11 +133,13 @@ QgsRectangle QgsMapLayer::extent() const bool QgsMapLayer::draw( QgsRenderContext& rendererContext ) { + Q_UNUSED( rendererContext ); return false; } void QgsMapLayer::drawLabels( QgsRenderContext& rendererContext ) { + Q_UNUSED( rendererContext ); // QgsDebugMsg("entered."); } @@ -271,6 +273,7 @@ bool QgsMapLayer::readXML( const QDomNode& layer_node ) bool QgsMapLayer::readXml( const QDomNode& layer_node ) { + Q_UNUSED( layer_node ); // NOP by default; children will over-ride with behavior specific to them return true; @@ -378,6 +381,8 @@ bool QgsMapLayer::writeXML( QDomNode & layer_node, QDomDocument & document ) bool QgsMapLayer::writeXml( QDomNode & layer_node, QDomDocument & document ) { + Q_UNUSED( layer_node ); + Q_UNUSED( document ); // NOP by default; children will over-ride with behavior specific to them return true; @@ -411,6 +416,7 @@ QString QgsMapLayer::lastError() void QgsMapLayer::connectNotify( const char * signal ) { + Q_UNUSED( signal ); QgsDebugMsgLevel( "QgsMapLayer connected to " + QString( signal ), 3 ); } // QgsMapLayer::connectNotify @@ -455,11 +461,14 @@ QStringList QgsMapLayer::subLayers() void QgsMapLayer::setLayerOrder( QStringList layers ) { + Q_UNUSED( layers ); // NOOP } void QgsMapLayer::setSubLayerVisibility( QString name, bool vis ) { + Q_UNUSED( name ); + Q_UNUSED( vis ); // NOOP } diff --git a/src/core/qgsmaplayerregistry.cpp b/src/core/qgsmaplayerregistry.cpp index 640b8de2668..20133bff064 100644 --- a/src/core/qgsmaplayerregistry.cpp +++ b/src/core/qgsmaplayerregistry.cpp @@ -149,5 +149,6 @@ QMap & QgsMapLayerRegistry::mapLayers() void QgsMapLayerRegistry::connectNotify( const char * signal ) { + Q_UNUSED( signal ); //QgsDebugMsg("QgsMapLayerRegistry connected to " + QString(signal)); } // QgsMapLayerRegistry::connectNotify diff --git a/src/core/qgsmaprenderer.cpp b/src/core/qgsmaprenderer.cpp index de9aa2c7283..5518b752a7f 100644 --- a/src/core/qgsmaprenderer.cpp +++ b/src/core/qgsmaprenderer.cpp @@ -191,8 +191,8 @@ void QgsMapRenderer::adjustExtentToSize() } QgsDebugMsg( QString( "Map units per pixel (x,y) : %1, %2\n" ).arg( mapUnitsPerPixelX, 0, 'f', 8 ).arg( mapUnitsPerPixelY, 0, 'f', 8 ) ); - QgsDebugMsg( QString( "Pixmap dimensions (x,y) : %1, %2\n" ).arg( myWidth, 0, 'f', 8 ).arg( myHeight, 0, 'f', 8) ); - QgsDebugMsg( QString( "Extent dimensions (x,y) : %1, %2\n" ).arg( mExtent.width(), 0, 'f',8 ).arg( mExtent.height(), 0, 'f', 8 ) ); + QgsDebugMsg( QString( "Pixmap dimensions (x,y) : %1, %2\n" ).arg( myWidth, 0, 'f', 8 ).arg( myHeight, 0, 'f', 8 ) ); + QgsDebugMsg( QString( "Extent dimensions (x,y) : %1, %2\n" ).arg( mExtent.width(), 0, 'f', 8 ).arg( mExtent.height(), 0, 'f', 8 ) ); QgsDebugMsg( mExtent.toString() ); // update extent @@ -634,13 +634,13 @@ QGis::UnitType QgsMapRenderer::mapUnits() const void QgsMapRenderer::onDrawingProgress( int current, int total ) { + Q_UNUSED( current ); + Q_UNUSED( total ); // TODO: emit signal with progress // QgsDebugMsg(QString("onDrawingProgress: %1 / %2").arg(current).arg(total)); emit updateMap(); } - - void QgsMapRenderer::setProjectionsEnabled( bool enabled ) { if ( mProjectionsEnabled != enabled ) diff --git a/src/core/qgsmaprenderer.h b/src/core/qgsmaprenderer.h index 2f286a70eec..72c0e840255 100644 --- a/src/core/qgsmaprenderer.h +++ b/src/core/qgsmaprenderer.h @@ -73,11 +73,13 @@ class QgsLabelingEngineInterface //! @note: this method was added in version 1.6 virtual int prepareLayer( QgsVectorLayer* layer, QSet& attrIndices, QgsRenderContext& ctx ) = 0; //! adds a diagram layer to the labeling engine - virtual int addDiagramLayer( QgsVectorLayer* layer, QgsDiagramLayerSettings* s ) { return 0; } + virtual int addDiagramLayer( QgsVectorLayer* layer, QgsDiagramLayerSettings* s ) + { Q_UNUSED( layer ); Q_UNUSED( s ); return 0; } //! called for every feature virtual void registerFeature( QgsVectorLayer* layer, QgsFeature& feat, const QgsRenderContext& context = QgsRenderContext() ) = 0; //! called for every diagram feature - virtual void registerDiagramFeature( QgsVectorLayer* layer, QgsFeature& feat, const QgsRenderContext& context = QgsRenderContext() ) {}; + virtual void registerDiagramFeature( QgsVectorLayer* layer, QgsFeature& feat, const QgsRenderContext& context = QgsRenderContext() ) + { Q_UNUSED( layer ); Q_UNUSED( feat ); Q_UNUSED( context ); } //! called when the map is drawn and labels should be placed virtual void drawLabeling( QgsRenderContext& context ) = 0; //! called when we're done with rendering diff --git a/src/core/qgspalgeometry.h b/src/core/qgspalgeometry.h index 98c5ec483a2..d2b267b6c68 100644 --- a/src/core/qgspalgeometry.h +++ b/src/core/qgspalgeometry.h @@ -18,6 +18,7 @@ #ifndef QGSPALGEOMETRY_H #define QGSPALGEOMETRY_H +#include #include "palgeometry.h" class QgsOverlayObject; @@ -34,10 +35,10 @@ class CORE_EXPORT QgsPALGeometry: public pal::PalGeometry //methods inherited from PalGeometry GEOSGeometry* getGeosGeometry(); - void releaseGeosGeometry( GEOSGeometry *the_geom ) {} + void releaseGeosGeometry( GEOSGeometry *the_geom ) { Q_UNUSED( the_geom ); } /**Returns pointer to the overlay object this geometry referrs to. Don't delete the returned object!*/ - QgsOverlayObject* overlayObjectPtr() const {return mOverlayObjectPtr;} + QgsOverlayObject* overlayObjectPtr() const { return mOverlayObjectPtr; } private: /**Default constructor forbidden*/ diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index 13f1cfb4df6..00c78af9e31 100644 --- a/src/core/qgspallabeling.cpp +++ b/src/core/qgspallabeling.cpp @@ -55,9 +55,14 @@ using namespace pal; class QgsPalGeometry : public PalGeometry { public: - QgsPalGeometry( int id, QString text, GEOSGeometry* g ): mG( g ), mText( text ), mId( id ), mInfo( NULL ), mIsDiagram( false ) + QgsPalGeometry( QgsFeatureId id, QString text, GEOSGeometry* g ) + : mG( g ) + , mText( text ) + , mId( id ) + , mInfo( NULL ) + , mIsDiagram( false ) { - mStrId = QByteArray::number( id ); + mStrId = FID_TO_STRING( id ).toAscii(); } ~QgsPalGeometry() @@ -113,7 +118,7 @@ class QgsPalGeometry : public PalGeometry GEOSGeometry* mG; QString mText; QByteArray mStrId; - int mId; + QgsFeatureId mId; LabelInfo* mInfo; bool mIsDiagram; /**Stores attribute values for data defined properties*/ diff --git a/src/core/qgspalobjectpositionmanager.cpp b/src/core/qgspalobjectpositionmanager.cpp index 12886e106bd..fedd8141880 100644 --- a/src/core/qgspalobjectpositionmanager.cpp +++ b/src/core/qgspalobjectpositionmanager.cpp @@ -79,13 +79,13 @@ void QgsPALObjectPositionManager::addLayer( QgsVectorLayer* vl, QList* positionObjects = ( *overlayIt )->overlayObjects(); + QMap* positionObjects = ( *overlayIt )->overlayObjects(); if ( !positionObjects ) { continue; } - QMap::const_iterator objectIt = positionObjects->begin(); + QMap::const_iterator objectIt = positionObjects->begin(); for ( ; objectIt != positionObjects->end(); ++objectIt ) { QgsPALGeometry* palGeom = new QgsPALGeometry( objectIt.value() ); diff --git a/src/core/qgspluginlayerregistry.cpp b/src/core/qgspluginlayerregistry.cpp index 56acc163100..50b64dbe758 100644 --- a/src/core/qgspluginlayerregistry.cpp +++ b/src/core/qgspluginlayerregistry.cpp @@ -40,8 +40,9 @@ QgsPluginLayer* QgsPluginLayerType::createLayer() return NULL; } -bool QgsPluginLayerType::showLayerProperties( QgsPluginLayer* layer ) +bool QgsPluginLayerType::showLayerProperties( QgsPluginLayer *layer ) { + Q_UNUSED( layer ); return false; } diff --git a/src/core/qgsprojectfiletransform.cpp b/src/core/qgsprojectfiletransform.cpp index 4bcf29c51f5..dcf799ddaf1 100644 --- a/src/core/qgsprojectfiletransform.cpp +++ b/src/core/qgsprojectfiletransform.cpp @@ -51,6 +51,7 @@ QgsProjectFileTransform::transform QgsProjectFileTransform::transformers[] = bool QgsProjectFileTransform::updateRevision( QgsProjectVersion newVersion ) { + Q_UNUSED( newVersion ); bool returnValue = false; if ( ! mDom.isNull() ) diff --git a/src/core/qgsprojectproperty.h b/src/core/qgsprojectproperty.h index 99cbcd50503..5de30fdae47 100644 --- a/src/core/qgsprojectproperty.h +++ b/src/core/qgsprojectproperty.h @@ -165,7 +165,7 @@ class CORE_EXPORT QgsPropertyValue : public QgsProperty Since QgsPropertyValue isn't a key, don't do anything. */ void entryList( QStringList & keyName, QStringList & entries ) const - { /* NOP */ } + { Q_UNUSED( keyName ); Q_UNUSED( entries ); /* NOP */ } private: diff --git a/src/core/qgsrasterdataprovider.cpp b/src/core/qgsrasterdataprovider.cpp index a6946acaf42..2a76a15ef5e 100644 --- a/src/core/qgsrasterdataprovider.cpp +++ b/src/core/qgsrasterdataprovider.cpp @@ -174,6 +174,7 @@ QString QgsRasterDataProvider::capabilitiesString() const bool QgsRasterDataProvider::identify( const QgsPoint& thePoint, QMap& theResults ) { + Q_UNUSED( thePoint ); theResults.clear(); return false; } diff --git a/src/core/qgsrasterdataprovider.h b/src/core/qgsrasterdataprovider.h index a2f68457ab8..29cc31014b8 100644 --- a/src/core/qgsrasterdataprovider.h +++ b/src/core/qgsrasterdataprovider.h @@ -183,6 +183,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider */ virtual int srcDataType( int bandNo ) const { + Q_UNUSED( bandNo ); return QgsRasterDataProvider::UnknownDataType; } @@ -233,6 +234,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider /** Returns data type for the band specified by number */ virtual int colorInterpretation( int theBandNo ) const { + Q_UNUSED( theBandNo ); return QgsRasterDataProvider::UndefinedColorInterpretation; } @@ -314,10 +316,12 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider /** read block of data */ // TODO clarify what happens on the last block (the part outside raster) - virtual void readBlock( int bandNo, int xBlock, int yBlock, void *data ) {} + virtual void readBlock( int bandNo, int xBlock, int yBlock, void *data ) + { Q_UNUSED( bandNo ); Q_UNUSED( xBlock ); Q_UNUSED( yBlock ); Q_UNUSED( data ); } /** read block of data using give extent and size */ - virtual void readBlock( int bandNo, QgsRectangle const & viewExtent, int width, int height, void *data ) {}; + virtual void readBlock( int bandNo, QgsRectangle const & viewExtent, int width, int height, void *data ) + { Q_UNUSED( bandNo ); Q_UNUSED( viewExtent ); Q_UNUSED( width ); Q_UNUSED( height ); Q_UNUSED( data ); } /** read block of data using give extent and size */ virtual void readBlock( int bandNo, QgsRectangle const & viewExtent, int width, int height, QgsCoordinateReferenceSystem theSrcCRS, QgsCoordinateReferenceSystem theDestCRS, void *data ); @@ -325,10 +329,11 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider /** value representing null data */ virtual double noDataValue() const { return 0; } - virtual double minimumValue( int bandNo )const { return 0; } - virtual double maximumValue( int bandNo )const { return 0; } + virtual double minimumValue( int bandNo ) const { Q_UNUSED( bandNo ); return 0; } + virtual double maximumValue( int bandNo ) const { Q_UNUSED( bandNo ); return 0; } - virtual QList colorTable( int bandNo )const { return QList(); } + virtual QList colorTable( int bandNo ) const + { Q_UNUSED( bandNo ); return QList(); } // Defined in parent /** \brief Returns the sublayers of this layer - Useful for providers that manage their own layers, such as WMS */ @@ -344,12 +349,14 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider int theBinCountInt = 256, bool theIgnoreOutOfRangeFlag = true, bool theThoroughBandScanFlag = false - ) {}; + ) + { Q_UNUSED( theBandNoInt ); Q_UNUSED( theBandStats ); Q_UNUSED( theBinCountInt ); Q_UNUSED( theIgnoreOutOfRangeFlag ); Q_UNUSED( theThoroughBandScanFlag ); } /** \brief Create pyramid overviews */ virtual QString buildPyramids( const QList & thePyramidList, const QString & theResamplingMethod = "NEAREST", - bool theTryInternalFlag = false ) { return "FAILED_NOT_SUPPORTED"; }; + bool theTryInternalFlag = false ) + { Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod ); Q_UNUSED( theTryInternalFlag ); return "FAILED_NOT_SUPPORTED"; }; /** \brief Accessor for ths raster layers pyramid list. A pyramid list defines the * POTENTIAL pyramids that can be in a raster. To know which of the pyramid layers diff --git a/src/core/qgsrasterprojector.cpp b/src/core/qgsrasterprojector.cpp index ce9a2d5e238..abef34c5c36 100644 --- a/src/core/qgsrasterprojector.cpp +++ b/src/core/qgsrasterprojector.cpp @@ -255,6 +255,8 @@ inline int QgsRasterProjector::matrixCol( int theDestCol ) QgsPoint QgsRasterProjector::srcPoint( int theDestRow, int theCol ) { + Q_UNUSED( theDestRow ); + Q_UNUSED( theCol ); return QgsPoint(); } diff --git a/src/core/qgssnapper.h b/src/core/qgssnapper.h index 8e4acd835ea..35efe6f64d2 100644 --- a/src/core/qgssnapper.h +++ b/src/core/qgssnapper.h @@ -20,6 +20,8 @@ #include "qgspoint.h" #include "qgstolerance.h" +#include "qgsfeature.h" + #include #include @@ -48,7 +50,7 @@ struct CORE_EXPORT QgsSnappingResult or -1 if no such vertex*/ int afterVertexNr; /**Index of the snapped geometry*/ - int snappedAtGeometry; + QgsFeatureId snappedAtGeometry; /**Layer where the snap occured*/ const QgsVectorLayer* layer; }; diff --git a/src/core/qgsvectordataprovider.cpp b/src/core/qgsvectordataprovider.cpp index b698901c2f6..116ccac1690 100644 --- a/src/core/qgsvectordataprovider.cpp +++ b/src/core/qgsvectordataprovider.cpp @@ -48,7 +48,7 @@ long QgsVectorDataProvider::updateFeatureCount() return -1; } -bool QgsVectorDataProvider::featureAtId( int featureId, +bool QgsVectorDataProvider::featureAtId( QgsFeatureId featureId, QgsFeature& feature, bool fetchGeometry, QgsAttributeList fetchAttributes ) @@ -71,16 +71,19 @@ QString QgsVectorDataProvider::dataComment() const bool QgsVectorDataProvider::addFeatures( QgsFeatureList &flist ) { + Q_UNUSED( flist ); return false; } -bool QgsVectorDataProvider::deleteFeatures( const QgsFeatureIds & id ) +bool QgsVectorDataProvider::deleteFeatures( const QgsFeatureIds &ids ) { + Q_UNUSED( ids ); return false; } -bool QgsVectorDataProvider::addAttributes( const QList & attributes ) +bool QgsVectorDataProvider::addAttributes( const QList &attributes ) { + Q_UNUSED( attributes ); return false; } @@ -104,23 +107,27 @@ bool QgsVectorDataProvider::addAttributes( const QMap &attribu return addAttributes( list ); } -bool QgsVectorDataProvider::deleteAttributes( const QgsAttributeIds& attributes ) +bool QgsVectorDataProvider::deleteAttributes( const QgsAttributeIds &attributes ) { + Q_UNUSED( attributes ); return false; } -bool QgsVectorDataProvider::changeAttributeValues( const QgsChangedAttributesMap & attr_map ) +bool QgsVectorDataProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_map ) { + Q_UNUSED( attr_map ); return false; } QVariant QgsVectorDataProvider::defaultValue( int fieldId ) { + Q_UNUSED( fieldId ); return QVariant(); } -bool QgsVectorDataProvider::changeGeometryValues( QgsGeometryMap & geometry_map ) +bool QgsVectorDataProvider::changeGeometryValues( QgsGeometryMap &geometry_map ) { + Q_UNUSED( geometry_map ); return false; } @@ -131,6 +138,7 @@ bool QgsVectorDataProvider::createSpatialIndex() bool QgsVectorDataProvider::createAttributeIndex( int field ) { + Q_UNUSED( field ); return true; } diff --git a/src/core/qgsvectordataprovider.h b/src/core/qgsvectordataprovider.h index 61c96c7b3e4..0dc68a374f7 100644 --- a/src/core/qgsvectordataprovider.h +++ b/src/core/qgsvectordataprovider.h @@ -29,7 +29,6 @@ class QTextCodec; #include "qgsrectangle.h" typedef QList QgsAttributeList; -typedef QSet QgsFeatureIds; typedef QSet QgsAttributeIds; /** \ingroup core @@ -130,7 +129,7 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider * Default implementation traverses all features until it finds the one with correct ID. * In case the provider supports reading the feature directly, override this function. */ - virtual bool featureAtId( int featureId, + virtual bool featureAtId( QgsFeatureId featureId, QgsFeature& feature, bool fetchGeometry = true, QgsAttributeList fetchAttributes = QgsAttributeList() ); @@ -410,7 +409,6 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider // list of errors QStringList mErrors; - static QStringList smEncodings; }; diff --git a/src/core/qgsvectorfilewriter.cpp b/src/core/qgsvectorfilewriter.cpp index d73905f0df4..d9c11ab7e50 100644 --- a/src/core/qgsvectorfilewriter.cpp +++ b/src/core/qgsvectorfilewriter.cpp @@ -409,7 +409,13 @@ bool QgsVectorFileWriter::addFeature( QgsFeature& feature ) // create the feature OGRFeatureH poFeature = OGR_F_Create( OGR_L_GetLayerDefn( mLayer ) ); - OGRErr err = OGR_F_SetFID( poFeature, feature.id() ); + qint64 fid = FID_TO_NUMBER( feature.id() ); + if ( fid > std::numeric_limits::max() ) + { + QgsDebugMsg( QString( "feature id %1 too large." ).arg( fid ) ); + } + + OGRErr err = OGR_F_SetFID( poFeature, static_cast( fid ) ); if ( err != OGRERR_NONE ) { QgsDebugMsg( QString( "Failed to set feature id to %1: %2 (OGR error: %3)" ) diff --git a/src/core/qgsvectorlayer.cpp b/src/core/qgsvectorlayer.cpp index 080f9ede785..3ef9d1991cf 100644 --- a/src/core/qgsvectorlayer.cpp +++ b/src/core/qgsvectorlayer.cpp @@ -1149,9 +1149,9 @@ void QgsVectorLayer::drawVertexMarker( double x, double y, QPainter& p, QgsVecto } } -void QgsVectorLayer::select( int number, bool emitSignal ) +void QgsVectorLayer::select( QgsFeatureId fid, bool emitSignal ) { - mSelectedFeatureIds.insert( number ); + mSelectedFeatureIds.insert( fid ); if ( emitSignal ) { @@ -1162,9 +1162,9 @@ void QgsVectorLayer::select( int number, bool emitSignal ) } } -void QgsVectorLayer::deselect( int number, bool emitSignal ) +void QgsVectorLayer::deselect( QgsFeatureId fid, bool emitSignal ) { - mSelectedFeatureIds.remove( number ); + mSelectedFeatureIds.remove( fid ); if ( emitSignal ) { @@ -1704,7 +1704,7 @@ bool QgsVectorLayer::nextFeature( QgsFeature &f ) // check if changed geometries are in rectangle for ( ; mFetchChangedGeomIt != mChangedGeometries.end(); mFetchChangedGeomIt++ ) { - int fid = mFetchChangedGeomIt.key(); + QgsFeatureId fid = mFetchChangedGeomIt.key(); if ( mFetchConsidered.contains( fid ) ) // skip deleted features @@ -1765,7 +1765,7 @@ bool QgsVectorLayer::nextFeature( QgsFeature &f ) for ( ; mFetchAddedFeaturesIt != mAddedFeatures.end(); mFetchAddedFeaturesIt++ ) { - int fid = mFetchAddedFeaturesIt->id(); + QgsFeatureId fid = mFetchAddedFeaturesIt->id(); if ( mFetchConsidered.contains( fid ) ) // must have changed geometry outside rectangle @@ -1813,7 +1813,7 @@ bool QgsVectorLayer::nextFeature( QgsFeature &f ) return false; } -bool QgsVectorLayer::featureAtId( int featureId, QgsFeature& f, bool fetchGeometries, bool fetchAttributes ) +bool QgsVectorLayer::featureAtId( QgsFeatureId featureId, QgsFeature& f, bool fetchGeometries, bool fetchAttributes ) { if ( !mDataProvider ) return false; @@ -1943,7 +1943,7 @@ bool QgsVectorLayer::addFeature( QgsFeature& f, bool alsoUpdateExtent ) } -bool QgsVectorLayer::insertVertex( double x, double y, int atFeatureId, int beforeVertex ) +bool QgsVectorLayer::insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex ) { if ( !hasGeometryType() ) return false; @@ -1982,7 +1982,7 @@ bool QgsVectorLayer::insertVertex( double x, double y, int atFeatureId, int befo } -bool QgsVectorLayer::moveVertex( double x, double y, int atFeatureId, int atVertex ) +bool QgsVectorLayer::moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex ) { if ( !hasGeometryType() ) return false; @@ -2022,7 +2022,7 @@ bool QgsVectorLayer::moveVertex( double x, double y, int atFeatureId, int atVert } -bool QgsVectorLayer::deleteVertex( int atFeatureId, int atVertex ) +bool QgsVectorLayer::deleteVertex( QgsFeatureId atFeatureId, int atVertex ) { if ( !hasGeometryType() ) return false; @@ -2081,7 +2081,7 @@ bool QgsVectorLayer::deleteSelectedFeatures() while ( mSelectedFeatureIds.size() > 0 ) { - int fid = *mSelectedFeatureIds.begin(); + QgsFeatureId fid = *mSelectedFeatureIds.begin(); deleteFeature( fid ); // removes from selection } @@ -2151,7 +2151,7 @@ int QgsVectorLayer::addPart( const QList &points ) return 5; } - int selectedFeatureId = *mSelectedFeatureIds.constBegin(); + QgsFeatureId selectedFeatureId = *mSelectedFeatureIds.constBegin(); //look if geometry of selected feature already contains geometry changes QgsGeometryMap::iterator changedIt = mChangedGeometries.find( selectedFeatureId ); @@ -2210,7 +2210,7 @@ int QgsVectorLayer::addPart( const QList &points ) return 6; //geometry not found } -int QgsVectorLayer::translateFeature( int featureId, double dx, double dy ) +int QgsVectorLayer::translateFeature( QgsFeatureId featureId, double dx, double dy ) { if ( !hasGeometryType() ) return 1; @@ -3316,7 +3316,7 @@ bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString& } -bool QgsVectorLayer::changeGeometry( int fid, QgsGeometry* geom ) +bool QgsVectorLayer::changeGeometry( QgsFeatureId fid, QgsGeometry* geom ) { if ( !mEditable || !mDataProvider || !hasGeometryType() ) { @@ -3330,7 +3330,7 @@ bool QgsVectorLayer::changeGeometry( int fid, QgsGeometry* geom ) } -bool QgsVectorLayer::changeAttributeValue( int fid, int field, QVariant value, bool emitSignal ) +bool QgsVectorLayer::changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal ) { if ( !isEditable() ) return false; @@ -3450,7 +3450,7 @@ bool QgsVectorLayer::deleteAttribute( int index ) return true; } -bool QgsVectorLayer::deleteFeature( int fid ) +bool QgsVectorLayer::deleteFeature( QgsFeatureId fid ) { if ( !isEditable() ) return false; @@ -4093,8 +4093,12 @@ int QgsVectorLayer::snapWithContext( const QgsPoint& startPoint, double snapping return n == 0 ? 2 : 0; } -void QgsVectorLayer::snapToGeometry( const QgsPoint& startPoint, int featureId, QgsGeometry* geom, double sqrSnappingTolerance, - QMultiMap& snappingResults, QgsSnapper::SnappingType snap_to ) const +void QgsVectorLayer::snapToGeometry( const QgsPoint& startPoint, + QgsFeatureId featureId, + QgsGeometry* geom, + double sqrSnappingTolerance, + QMultiMap& snappingResults, + QgsSnapper::SnappingType snap_to ) const { if ( !geom ) { @@ -4597,7 +4601,7 @@ void QgsVectorLayer::setUsingRendererV2( bool usingRendererV2 ) } -void QgsVectorLayer::editGeometryChange( int featureId, QgsGeometry& geometry ) +void QgsVectorLayer::editGeometryChange( QgsFeatureId featureId, QgsGeometry& geometry ) { if ( mActiveCommand != NULL ) { @@ -4616,7 +4620,7 @@ void QgsVectorLayer::editFeatureAdd( QgsFeature& feature ) mAddedFeatures.append( feature ); } -void QgsVectorLayer::editFeatureDelete( int featureId ) +void QgsVectorLayer::editFeatureDelete( QgsFeatureId featureId ) { if ( mActiveCommand != NULL ) { @@ -4625,7 +4629,7 @@ void QgsVectorLayer::editFeatureDelete( int featureId ) mDeletedFeatureIds.insert( featureId ); } -void QgsVectorLayer::editAttributeChange( int featureId, int field, QVariant value ) +void QgsVectorLayer::editAttributeChange( QgsFeatureId featureId, int field, QVariant value ) { if ( mActiveCommand != NULL ) { @@ -4655,7 +4659,7 @@ void QgsVectorLayer::editAttributeChange( int featureId, int field, QVariant val mActiveCommand->storeAttributeChange( featureId, field, original, value, isFirstChange ); } - if ( featureId >= 0 ) + if ( !FID_IS_NEW( featureId ) ) { // changed attribute of existing feature if ( !mChangedAttributeValues.contains( featureId ) ) @@ -4710,16 +4714,16 @@ void QgsVectorLayer::destroyEditCommand() void QgsVectorLayer::redoEditCommand( QgsUndoCommand* cmd ) { - QMap& geometryChange = cmd->mGeometryChange; + QMap& geometryChange = cmd->mGeometryChange; QgsFeatureIds& deletedFeatureIdChange = cmd->mDeletedFeatureIdChange; QgsFeatureList& addedFeatures = cmd->mAddedFeatures; - QMap& attributeChange = cmd->mAttributeChange; + QMap& attributeChange = cmd->mAttributeChange; QgsFieldMap& addedAttributes = cmd->mAddedAttributes; QgsFieldMap& deletedAttributes = cmd->mDeletedAttributes; // geometry changes - QMap::iterator it = geometryChange.begin(); + QMap::iterator it = geometryChange.begin(); for ( ; it != geometryChange.end(); ++it ) { if ( it.value().target == NULL ) @@ -4749,15 +4753,15 @@ void QgsVectorLayer::redoEditCommand( QgsUndoCommand* cmd ) } // changed attributes - QMap::iterator attrFeatIt = attributeChange.begin(); + QMap::iterator attrFeatIt = attributeChange.begin(); for ( ; attrFeatIt != attributeChange.end(); ++attrFeatIt ) { - int fid = attrFeatIt.key(); + QgsFeatureId fid = attrFeatIt.key(); // for every changed attribute in feature - QMap::iterator attrChIt = attrFeatIt.value().begin(); + QMap::iterator attrChIt = attrFeatIt.value().begin(); for ( ; attrChIt != attrFeatIt.value().end(); ++attrChIt ) { - if ( fid >= 0 ) + if ( !FID_IS_NEW( fid ) ) { // existing feature if ( attrChIt.value().target.isNull() ) @@ -4815,10 +4819,10 @@ void QgsVectorLayer::redoEditCommand( QgsUndoCommand* cmd ) void QgsVectorLayer::undoEditCommand( QgsUndoCommand* cmd ) { - QMap& geometryChange = cmd->mGeometryChange; + QMap& geometryChange = cmd->mGeometryChange; QgsFeatureIds& deletedFeatureIdChange = cmd->mDeletedFeatureIdChange; QgsFeatureList& addedFeatures = cmd->mAddedFeatures; - QMap& attributeChange = cmd->mAttributeChange; + QMap& attributeChange = cmd->mAttributeChange; QgsFieldMap& addedAttributes = cmd->mAddedAttributes; QgsFieldMap& deletedAttributes = cmd->mDeletedAttributes; @@ -4843,7 +4847,7 @@ void QgsVectorLayer::undoEditCommand( QgsUndoCommand* cmd ) } // geometry changes - QMap::iterator it = geometryChange.begin(); + QMap::iterator it = geometryChange.begin(); for ( ; it != geometryChange.end(); ++it ) { if ( it.value().original == NULL ) @@ -4881,14 +4885,14 @@ void QgsVectorLayer::undoEditCommand( QgsUndoCommand* cmd ) } // updated attributes - QMap::iterator attrFeatIt = attributeChange.begin(); + QMap::iterator attrFeatIt = attributeChange.begin(); for ( ; attrFeatIt != attributeChange.end(); ++attrFeatIt ) { - int fid = attrFeatIt.key(); + QgsFeatureId fid = attrFeatIt.key(); QMap::iterator attrChIt = attrFeatIt.value().begin(); for ( ; attrChIt != attrFeatIt.value().end(); ++attrChIt ) { - if ( fid >= 0 ) + if ( !FID_IS_NEW( fid ) ) { if ( attrChIt.value().isFirstChange ) { diff --git a/src/core/qgsvectorlayer.h b/src/core/qgsvectorlayer.h index 04c9dc3efe1..1ee4aecf17d 100644 --- a/src/core/qgsvectorlayer.h +++ b/src/core/qgsvectorlayer.h @@ -51,7 +51,6 @@ class QgsDiagramRendererV2; struct QgsDiagramLayerSettings; typedef QList QgsAttributeList; -typedef QSet QgsFeatureIds; typedef QSet QgsAttributeIds; /** @note added in 1.7 */ @@ -342,7 +341,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer /**Gets the feature at the given feature id. Considers the changed, added, deleted and permanent features @return true in case of success*/ - bool featureAtId( int featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true ); + bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true ); /** Adds a feature @param f feature to add @@ -356,17 +355,17 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer * in the given ring, item (first number is index 0), and feature * Not meaningful for Point geometries */ - bool insertVertex( double x, double y, int atFeatureId, int beforeVertex ); + bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex ); /** Moves the vertex at the given position number, * ring and item (first number is index 0), and feature * to the given coordinates */ - bool moveVertex( double x, double y, int atFeatureId, int atVertex ); + bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex ); /** Deletes a vertex from a feature */ - bool deleteVertex( int atFeatureId, int atVertex ); + bool deleteVertex( QgsFeatureId atFeatureId, int atVertex ); /** Deletes the selected features * @return true in case of success and false otherwise @@ -400,7 +399,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer @param dx translation of x-coordinate @param dy translation of y-coordinate @return 0 in case of success*/ - int translateFeature( int featureId, double dx, double dy ); + int translateFeature( QgsFeatureId featureId, double dx, double dy ); /**Splits features cut by the given line @param splitLine line that splits the layer features @@ -468,8 +467,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer */ int snapWithContext( const QgsPoint& startPoint, double snappingTolerance, - QMultiMap < double, - QgsSnappingResult > & snappingResults, + QMultiMap < double, QgsSnappingResult > &snappingResults, QgsSnapper::SnappingType snap_to ); /**Synchronises with changes in the datasource @@ -507,10 +505,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer /** change feature's geometry @note added in version 1.2 */ - bool changeGeometry( int fid, QgsGeometry* geom ); + bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom ); /** changed an attribute value (but does not commit it) */ - bool changeAttributeValue( int fid, int field, QVariant value, bool emitSignal = true ); + bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal = true ); /** add an attribute field (but does not commit it) returns true if the field was added @@ -541,7 +539,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer bool addFeatures( QgsFeatureList features, bool makeSelected = true ); /** delete a feature from the layer (but does not commit it) */ - bool deleteFeature( int fid ); + bool deleteFeature( QgsFeatureId fid ); /** Attempts to commit any changes to disk. Returns the result of the attempt. @@ -687,10 +685,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer public slots: /** Select feature by its ID, optionally emit signal selectionChanged() */ - void select( int featureId, bool emitSignal = true ); + void select( QgsFeatureId featureId, bool emitSignal = true ); /** Deselect feature by its ID, optionally emit signal selectionChanged() */ - void deselect( int featureId, bool emitSignal = true ); + void deselect( QgsFeatureId featureId, bool emitSignal = true ); /** Clear selection */ void removeSelection( bool emitSignal = true ); @@ -720,11 +718,11 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer void editingStopped(); void attributeAdded( int idx ); void attributeDeleted( int idx ); - void featureAdded( int fid ); // added in 1.7 - void featureDeleted( int fid ); + void featureAdded( QgsFeatureId fid ); // added in 1.7 + void featureDeleted( QgsFeatureId fid ); void layerDeleted(); - void attributeValueChanged( int fid, int idx, const QVariant & ); + void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & ); /** Signals emitted after committing changes \note added in v1.6 */ @@ -772,7 +770,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer unsigned char *drawPolygon( unsigned char *WKBpolygon, QgsRenderContext &renderContext ); /** Goes through all features and finds a free id (e.g. to give it temporarily to a not-commited feature) */ - int findFreeId(); + QgsFeatureId findFreeId(); /**Deletes the geometries in mCachedGeometries*/ void deleteCachedGeometries(); @@ -785,8 +783,12 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer @param snappingResults list to which the result is appended @param snap_to snap to vertex or to segment */ - void snapToGeometry( const QgsPoint& startPoint, int featureId, QgsGeometry* geom, double sqrSnappingTolerance, - QMultiMap& snappingResults, QgsSnapper::SnappingType snap_to ) const; + void snapToGeometry( const QgsPoint& startPoint, + QgsFeatureId featureId, + QgsGeometry* geom, + double sqrSnappingTolerance, + QMultiMap& snappingResults, + QgsSnapper::SnappingType snap_to ) const; /**Little helper function that gives bounding box from a list of points. @return 0 in case of success*/ @@ -815,16 +817,16 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer void updateFeatureGeometry( QgsFeature &f ); /** Record changed geometry, store in active command (if any) */ - void editGeometryChange( int featureId, QgsGeometry& geometry ); + void editGeometryChange( QgsFeatureId featureId, QgsGeometry& geometry ); /** Record added feature, store in active command (if any) */ void editFeatureAdd( QgsFeature& feature ); /** Record deleted feature, store in active command (if any) */ - void editFeatureDelete( int featureId ); + void editFeatureDelete( QgsFeatureId featureId ); /** Record changed attribute, store in active command (if any) */ - void editAttributeChange( int featureId, int field, QVariant value ); + void editAttributeChange( QgsFeatureId featureId, int field, QVariant value ); /** Stop version 2 renderer and selected renderer (if required) */ void stopRendererV2( QgsRenderContext& rendererContext, QgsSingleSymbolRendererV2* selRenderer ); @@ -960,7 +962,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer QgsAttributeList mFetchProvAttributes; bool mFetchGeometry; - QSet mFetchConsidered; + QSet mFetchConsidered; QgsGeometryMap::iterator mFetchChangedGeomIt; QgsFeatureList::iterator mFetchAddedFeaturesIt; diff --git a/src/core/qgsvectorlayerundocommand.cpp b/src/core/qgsvectorlayerundocommand.cpp index 46b3adea1da..3124ff604ac 100644 --- a/src/core/qgsvectorlayerundocommand.cpp +++ b/src/core/qgsvectorlayerundocommand.cpp @@ -70,7 +70,7 @@ void QgsUndoCommand::undo() } -void QgsUndoCommand::storeGeometryChange( int featureId, QgsGeometry& original, QgsGeometry& target ) +void QgsUndoCommand::storeGeometryChange( QgsFeatureId featureId, QgsGeometry& original, QgsGeometry& target ) { if ( mGeometryChange.contains( featureId ) ) { @@ -86,7 +86,7 @@ void QgsUndoCommand::storeGeometryChange( int featureId, QgsGeometry& original, } } -void QgsUndoCommand::storeAttributeChange( int featureId, int field, QVariant original, QVariant target, bool isFirstChange ) +void QgsUndoCommand::storeAttributeChange( QgsFeatureId featureId, int field, QVariant original, QVariant target, bool isFirstChange ) { AttributeChangeEntry entry; entry.isFirstChange = isFirstChange; @@ -105,7 +105,7 @@ void QgsUndoCommand::storeAttributeDelete( int index, const QgsField & orig ) mDeletedAttributes.insert( index, orig ); } -void QgsUndoCommand::storeFeatureDelete( int featureId ) +void QgsUndoCommand::storeFeatureDelete( QgsFeatureId featureId ) { mDeletedFeatureIdChange.insert( featureId ); } diff --git a/src/core/qgsvectorlayerundocommand.h b/src/core/qgsvectorlayerundocommand.h index d18ee1d5907..e7a8ace8061 100644 --- a/src/core/qgsvectorlayerundocommand.h +++ b/src/core/qgsvectorlayerundocommand.h @@ -17,11 +17,9 @@ class QgsVectorLayer; // TODO: copied from qgsvectorlayer.h typedef QList QgsAttributeList; -typedef QSet QgsFeatureIds; typedef QSet QgsAttributeIds; - /** * Class to support universal undo command sequence for application, basic for */ @@ -73,7 +71,7 @@ class QgsUndoCommand : public QUndoCommand * @param original original geometry of feature which was changed * @param target changed geometry which was changed */ - void storeGeometryChange( int featureId, QgsGeometry& original, QgsGeometry& target ); + void storeGeometryChange( QgsFeatureId featureId, QgsGeometry& original, QgsGeometry& target ); /** * Stores changes of attributes for the feature to be returned to this state after undo/redo @@ -83,13 +81,13 @@ class QgsUndoCommand : public QUndoCommand * @param target target value of attribute after change * @param isFirstChange flag if this change is the first one */ - void storeAttributeChange( int featureId, int field, QVariant original, QVariant target, bool isFirstChange ); + void storeAttributeChange( QgsFeatureId featureId, int field, QVariant original, QVariant target, bool isFirstChange ); /** * Add id of feature to deleted list to be reverted if needed afterwards * @param featureId id of feature which is to be deleted */ - void storeFeatureDelete( int featureId ); + void storeFeatureDelete( QgsFeatureId featureId ); /** * Add new feature to list of new features to be stored for undo/redo operations. @@ -119,10 +117,10 @@ class QgsUndoCommand : public QUndoCommand QgsVectorLayer* mLayer; /** Map of changes of geometry for features it describes changes of geometry */ - QMap mGeometryChange; + QMap mGeometryChange; /** Map of changes of atrributes for features which describes changes of attributes */ - QMap mAttributeChange; + QMap mAttributeChange; /** Deleted feature IDs which are not commited. Note a feature can be added and then deleted again before the change is committed - in that case the added feature would be removed diff --git a/src/core/qgsvectoroverlay.cpp b/src/core/qgsvectoroverlay.cpp index 54298839e8b..a0cc9d36f4c 100644 --- a/src/core/qgsvectoroverlay.cpp +++ b/src/core/qgsvectoroverlay.cpp @@ -30,7 +30,7 @@ QgsVectorOverlay::~QgsVectorOverlay() void QgsVectorOverlay::removeOverlayObjects() { - QMap::iterator it = mOverlayObjects.begin(); + QMap::iterator it = mOverlayObjects.begin(); for ( ; it != mOverlayObjects.end(); ++it ) { delete( it.value() ); diff --git a/src/core/qgsvectoroverlay.h b/src/core/qgsvectoroverlay.h index 73b068a55d0..5176d52821a 100644 --- a/src/core/qgsvectoroverlay.h +++ b/src/core/qgsvectoroverlay.h @@ -50,7 +50,7 @@ class CORE_EXPORT QgsVectorOverlay virtual void drawOverlayObjects( QgsRenderContext& context ) const = 0; /**Gives direct access to oberlay objects*/ - QMap* overlayObjects() {return &mOverlayObjects;} + QMap* overlayObjects() {return &mOverlayObjects;} /**Describes the overlay type (e.g. "diagram" or "label")*/ virtual QString typeName() const = 0; @@ -80,7 +80,7 @@ class CORE_EXPORT QgsVectorOverlay QgsAttributeList mAttributes; /**Key: feature ids, value: the corresponding overlay objects. Normally, they are created for each redraw and deleted before the next redraw*/ - QMap mOverlayObjects; + QMap mOverlayObjects; /**Position constraints that may be set to be persistent after redraws. Key is the feature id, value the map point where the feature should be placed*/ diff --git a/src/core/raster/qgscolorrampshader.cpp b/src/core/raster/qgscolorrampshader.cpp index ef2187f7743..7cb18c3dc7d 100644 --- a/src/core/raster/qgscolorrampshader.cpp +++ b/src/core/raster/qgscolorrampshader.cpp @@ -277,6 +277,10 @@ bool QgsColorRampShader::shade( double theValue, int* theReturnRedValue, int* th bool QgsColorRampShader::shade( double theRedValue, double theGreenValue, double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue ) { + Q_UNUSED( theRedValue ); + Q_UNUSED( theGreenValue ); + Q_UNUSED( theBlueValue ); + *theReturnRedValue = 0; *theReturnGreenValue = 0; *theReturnBlueValue = 0; diff --git a/src/core/raster/qgsfreakoutshader.cpp b/src/core/raster/qgsfreakoutshader.cpp index a177c728ca4..3ae29360814 100644 --- a/src/core/raster/qgsfreakoutshader.cpp +++ b/src/core/raster/qgsfreakoutshader.cpp @@ -111,6 +111,10 @@ bool QgsFreakOutShader::shade( double theValue, int* theReturnRedValue, int* the bool QgsFreakOutShader::shade( double theRedValue, double theGreenValue, double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue ) { + Q_UNUSED( theRedValue ); + Q_UNUSED( theGreenValue ); + Q_UNUSED( theBlueValue ); + *theReturnRedValue = 0; *theReturnGreenValue = 0; *theReturnBlueValue = 0; diff --git a/src/core/raster/qgspseudocolorshader.cpp b/src/core/raster/qgspseudocolorshader.cpp index 299973a16f8..96175a570a0 100644 --- a/src/core/raster/qgspseudocolorshader.cpp +++ b/src/core/raster/qgspseudocolorshader.cpp @@ -70,6 +70,10 @@ bool QgsPseudoColorShader::shade( double theValue, int* theReturnRedValue, int* bool QgsPseudoColorShader::shade( double theRedValue, double theGreenValue, double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue ) { + Q_UNUSED( theRedValue ); + Q_UNUSED( theGreenValue ); + Q_UNUSED( theBlueValue ); + *theReturnRedValue = 0; *theReturnGreenValue = 0; *theReturnBlueValue = 0; diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp index d8f34b8a375..144d2d697a7 100755 --- a/src/core/raster/qgsrasterlayer.cpp +++ b/src/core/raster/qgsrasterlayer.cpp @@ -130,6 +130,8 @@ QgsRasterLayer::QgsRasterLayer( int dummy, , mFormat( format ) , mCrs( crs ) { + Q_UNUSED( dummy ); + QgsDebugMsg( "(8 arguments) starting. with layer list of " + layers.join( ", " ) + " and style list of " + styles.join( ", " ) + " and format of " + format + " and CRS of " + crs ); @@ -2348,6 +2350,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider, QString const & crs, bool loadDefaultStyleFlag ) { + Q_UNUSED( loadDefaultStyleFlag ); // XXX should I check for and possibly delete any pre-existing providers? // XXX How often will that scenario occur? @@ -3409,6 +3412,7 @@ bool QgsRasterLayer::readXml( const QDomNode& layer_node ) */ bool QgsRasterLayer::writeSymbology( QDomNode & layer_node, QDomDocument & document, QString& errorMessage ) const { + Q_UNUSED( errorMessage ); // QDomElement rasterPropertiesElement = document.createElement( "rasterproperties" ); layer_node.appendChild( rasterPropertiesElement ); @@ -4237,6 +4241,10 @@ void QgsRasterLayer::drawPalettedSingleBandPseudoColor( QPainter * theQPainter, void QgsRasterLayer::drawPalettedMultiBandColor( QPainter * theQPainter, QgsRasterViewPort * theRasterViewPort, const QgsMapToPixel* theQgsMapToPixel, int theBandNo ) { + Q_UNUSED( theQPainter ); + Q_UNUSED( theRasterViewPort ); + Q_UNUSED( theQgsMapToPixel ); + Q_UNUSED( theBandNo ); QgsDebugMsg( "Not supported at this time" ); } diff --git a/src/core/raster/qgsrasterlayer.h b/src/core/raster/qgsrasterlayer.h index 6874b8ab771..060a382fd1e 100644 --- a/src/core/raster/qgsrasterlayer.h +++ b/src/core/raster/qgsrasterlayer.h @@ -43,15 +43,6 @@ #include "qgsrastershaderfunction.h" #include "qgsrasterdataprovider.h" -#define CPL_SUPRESS_CPLUSPLUS -#include -/** \ingroup core - * A call back function for showing progress of gdal operations. - */ -int CPL_STDCALL progressCallback( double dfComplete, - const char *pszMessage, - void * pProgressArg ); - // // Forward declarations // diff --git a/src/core/raster/qgsrastershaderfunction.cpp b/src/core/raster/qgsrastershaderfunction.cpp index f277095cbf0..c473a857268 100644 --- a/src/core/raster/qgsrastershaderfunction.cpp +++ b/src/core/raster/qgsrastershaderfunction.cpp @@ -65,6 +65,8 @@ void QgsRasterShaderFunction::setMinimumValue( double theValue ) */ bool QgsRasterShaderFunction::shade( double theValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue ) { + Q_UNUSED( theValue ); + *theReturnRedValue = 0; *theReturnGreenValue = 0; *theReturnBlueValue = 0; @@ -86,6 +88,10 @@ bool QgsRasterShaderFunction::shade( double theValue, int* theReturnRedValue, in */ bool QgsRasterShaderFunction::shade( double theRedValue, double theGreenValue, double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue ) { + Q_UNUSED( theRedValue ); + Q_UNUSED( theGreenValue ); + Q_UNUSED( theBlueValue ); + *theReturnRedValue = 0; *theReturnGreenValue = 0; *theReturnBlueValue = 0; diff --git a/src/core/renderer/qgsgraduatedsymbolrenderer.cpp b/src/core/renderer/qgsgraduatedsymbolrenderer.cpp index a1832443cf9..7ec64781ed5 100644 --- a/src/core/renderer/qgsgraduatedsymbolrenderer.cpp +++ b/src/core/renderer/qgsgraduatedsymbolrenderer.cpp @@ -33,6 +33,8 @@ QgsGraduatedSymbolRenderer::QgsGraduatedSymbolRenderer( QGis::GeometryType type, Mode mode ) { + Q_UNUSED( mode ); + mGeometryType = type; } diff --git a/src/core/renderer/qgsrenderer.h b/src/core/renderer/qgsrenderer.h index 691a5355a70..55698a195c0 100644 --- a/src/core/renderer/qgsrenderer.h +++ b/src/core/renderer/qgsrenderer.h @@ -113,7 +113,7 @@ class CORE_EXPORT QgsRenderer /**Returns renderer symbol for a feature. @note: this method was added in version 1.6*/ - virtual QgsSymbol* symbolForFeature( const QgsFeature* f ) { return 0;} + virtual QgsSymbol* symbolForFeature( const QgsFeature* f ) { Q_UNUSED( f ); return 0;} /**Scales a brush to a given raster scale factor (e.g. for printing)*/ static void scaleBrush( QBrush& b, double rasterScaleFactor ); diff --git a/src/core/renderer/qgssinglesymbolrenderer.h b/src/core/renderer/qgssinglesymbolrenderer.h index 130cf7cd245..b27b029bfbf 100644 --- a/src/core/renderer/qgssinglesymbolrenderer.h +++ b/src/core/renderer/qgssinglesymbolrenderer.h @@ -66,7 +66,7 @@ class CORE_EXPORT QgsSingleSymbolRenderer: public QgsRenderer /**Returns renderer symbol for a feature @note: this method was added in version 1.6*/ - QgsSymbol* symbolForFeature( const QgsFeature* f ) { return mSymbol0; } + QgsSymbol* symbolForFeature( const QgsFeature* f ) { Q_UNUSED( f ); return mSymbol0; } protected: /**Object containing symbology information*/ diff --git a/src/core/spatialindex/geometry/LineSegment.cc b/src/core/spatialindex/geometry/LineSegment.cc index 2885815d139..25beb4fd017 100644 --- a/src/core/spatialindex/geometry/LineSegment.cc +++ b/src/core/spatialindex/geometry/LineSegment.cc @@ -153,6 +153,7 @@ void Tools::Geometry::LineSegment::storeToByteArray( byte** data, unsigned long& // bool Tools::Geometry::LineSegment::intersectsShape( const IShape& s ) const { + Q_UNUSED( s ); throw IllegalStateException( "Tools::Geometry::LineSegment::intersectsShape: Not implemented yet!" ); @@ -160,11 +161,13 @@ bool Tools::Geometry::LineSegment::intersectsShape( const IShape& s ) const bool Tools::Geometry::LineSegment::containsShape( const IShape& s ) const { + Q_UNUSED( s ); return false; } bool Tools::Geometry::LineSegment::touchesShape( const IShape& s ) const { + Q_UNUSED( s ); throw IllegalStateException( "Tools::Geometry::LineSegment::touchesShape: Not implemented yet!" ); diff --git a/src/core/spatialindex/geometry/Point.cc b/src/core/spatialindex/geometry/Point.cc index 57552bd2fe3..94d9f79d333 100644 --- a/src/core/spatialindex/geometry/Point.cc +++ b/src/core/spatialindex/geometry/Point.cc @@ -136,6 +136,7 @@ bool Tools::Geometry::Point::intersectsShape( const IShape& s ) const bool Tools::Geometry::Point::containsShape( const IShape& s ) const { + Q_UNUSED( s ); return false; } @@ -217,7 +218,7 @@ double Tools::Geometry::Point::getMinimumDistance( const Point& p ) const double Tools::Geometry::Point::getCoordinate( unsigned long index ) const { - if ( index < 0 || index >= m_dimension ) + if ( index >= m_dimension ) throw IndexOutOfBoundsException( index ); return m_pCoords[index]; diff --git a/src/core/spatialindex/geometry/Region.cc b/src/core/spatialindex/geometry/Region.cc index aefe6cbda96..bd92efe5b07 100644 --- a/src/core/spatialindex/geometry/Region.cc +++ b/src/core/spatialindex/geometry/Region.cc @@ -482,7 +482,7 @@ void Tools::Geometry::Region::getCombinedRegion( Region& out, const Region& in ) double Tools::Geometry::Region::getLow( unsigned long index ) const { - if ( index < 0 || index >= m_dimension ) + if ( index >= m_dimension ) throw IndexOutOfBoundsException( index ); return m_pLow[index]; @@ -490,7 +490,7 @@ double Tools::Geometry::Region::getLow( unsigned long index ) const double Tools::Geometry::Region::getHigh( unsigned long index ) const { - if ( index < 0 || index >= m_dimension ) + if ( index >= m_dimension ) throw IndexOutOfBoundsException( index ); return m_pHigh[index]; diff --git a/src/core/spatialindex/include/PointerPool.h b/src/core/spatialindex/include/PointerPool.h index 8163ecbfb36..9a4666ab352 100644 --- a/src/core/spatialindex/include/PointerPool.h +++ b/src/core/spatialindex/include/PointerPool.h @@ -104,7 +104,6 @@ namespace Tools unsigned long getCapacity() const { return m_capacity; } void setCapacity( unsigned long c ) { - assert( c >= 0 ); m_capacity = c; } diff --git a/src/core/spatialindex/qgsspatialindex.cpp b/src/core/spatialindex/qgsspatialindex.cpp index 62f585468c7..ad3a74ba5ef 100644 --- a/src/core/spatialindex/qgsspatialindex.cpp +++ b/src/core/spatialindex/qgsspatialindex.cpp @@ -29,20 +29,22 @@ using namespace SpatialIndex; class QgisVisitor : public SpatialIndex::IVisitor { public: - QgisVisitor( QList & list ) + QgisVisitor( QList & list ) : mList( list ) {} - void visitNode( const INode& n ) {} + void visitNode( const INode& n ) + { Q_UNUSED( n ); } void visitData( const IData& d ) { mList.append( d.getIdentifier() ); } - void visitData( std::vector& v ) {} + void visitData( std::vector& v ) + { Q_UNUSED( v ); } private: - QList& mList; + QList& mList; }; @@ -87,7 +89,7 @@ Tools::Geometry::Region QgsSpatialIndex::rectToRegion( QgsRectangle rect ) return Tools::Geometry::Region( pt1, pt2, 2 ); } -bool QgsSpatialIndex::featureInfo( QgsFeature& f, Tools::Geometry::Region& r, long& id ) +bool QgsSpatialIndex::featureInfo( QgsFeature& f, Tools::Geometry::Region& r, QgsFeatureId &id ) { QgsGeometry *g = f.geometry(); if ( !g ) @@ -101,14 +103,14 @@ bool QgsSpatialIndex::featureInfo( QgsFeature& f, Tools::Geometry::Region& r, lo bool QgsSpatialIndex::insertFeature( QgsFeature& f ) { Tools::Geometry::Region r; - long id; + QgsFeatureId id; if ( !featureInfo( f, r, id ) ) return false; // TODO: handle possible exceptions correctly try { - mRTree->insertData( 0, 0, r, id ); + mRTree->insertData( 0, 0, r, FID_TO_NUMBER( id ) ); } catch ( Tools::Exception &e ) { @@ -131,17 +133,17 @@ bool QgsSpatialIndex::insertFeature( QgsFeature& f ) bool QgsSpatialIndex::deleteFeature( QgsFeature& f ) { Tools::Geometry::Region r; - long id; + QgsFeatureId id; if ( !featureInfo( f, r, id ) ) return false; // TODO: handle exceptions - return mRTree->deleteData( r, id ); + return mRTree->deleteData( r, FID_TO_NUMBER( id ) ); } -QList QgsSpatialIndex::intersects( QgsRectangle rect ) +QList QgsSpatialIndex::intersects( QgsRectangle rect ) { - QList list; + QList list; QgisVisitor visitor( list ); Tools::Geometry::Region r = rectToRegion( rect ); @@ -151,9 +153,9 @@ QList QgsSpatialIndex::intersects( QgsRectangle rect ) return list; } -QList QgsSpatialIndex::nearestNeighbor( QgsPoint point, int neighbors ) +QList QgsSpatialIndex::nearestNeighbor( QgsPoint point, int neighbors ) { - QList list; + QList list; QgisVisitor visitor( list ); double pt[2]; diff --git a/src/core/spatialindex/qgsspatialindex.h b/src/core/spatialindex/qgsspatialindex.h index 118c973ca4e..8422d3d8c3f 100644 --- a/src/core/spatialindex/qgsspatialindex.h +++ b/src/core/spatialindex/qgsspatialindex.h @@ -39,8 +39,11 @@ namespace Tools class QgsFeature; class QgsRectangle; class QgsPoint; + #include +#include "qgsfeature.h" + class CORE_EXPORT QgsSpatialIndex { @@ -73,17 +76,17 @@ class CORE_EXPORT QgsSpatialIndex /* queries */ /** returns features that intersect the specified rectangle */ - QList intersects( QgsRectangle rect ); + QList intersects( QgsRectangle rect ); /** returns nearest neighbors (their count is specified by second parameter) */ - QList nearestNeighbor( QgsPoint point, int neighbors ); + QList nearestNeighbor( QgsPoint point, int neighbors ); protected: Tools::Geometry::Region rectToRegion( QgsRectangle rect ); - bool featureInfo( QgsFeature& f, Tools::Geometry::Region& r, long& id ); + bool featureInfo( QgsFeature& f, Tools::Geometry::Region& r, QgsFeatureId &id ); private: diff --git a/src/core/spatialindex/rtree/Index.cc b/src/core/spatialindex/rtree/Index.cc index 298245aa6e5..8804a231f45 100644 --- a/src/core/spatialindex/rtree/Index.cc +++ b/src/core/spatialindex/rtree/Index.cc @@ -72,11 +72,10 @@ NodePtr Index::chooseSubtree( const Region& mbr, unsigned long insertionLevel, s default: throw Tools::NotSupportedException( "Index::chooseSubtree: Tree variant not supported." ); } - assert( child >= 0 ); NodePtr n = m_pTree->readNode( m_pIdentifier[child] ); NodePtr ret = n->chooseSubtree( mbr, insertionLevel, pathBuffer ); - assert( n.unique() ); + Q_ASSERT( n.unique() ); if ( ret.get() == n.get() ) n.relinquish(); return ret; @@ -224,7 +223,7 @@ long Index::findLeastOverlap( const Region& r ) const ::qsort( entries, m_children, sizeof( OverlapEntry* ), OverlapEntry::compareEntries ); - assert( entries[0]->m_enlargement <= entries[m_children - 1]->m_enlargement ); + Q_ASSERT( entries[0]->m_enlargement <= entries[m_children - 1]->m_enlargement ); cIterations = m_pTree->m_nearMinimumOverlapFactor; } diff --git a/src/core/spatialindex/rtree/Leaf.cc b/src/core/spatialindex/rtree/Leaf.cc index 5c97cd8085a..1039cd62a52 100644 --- a/src/core/spatialindex/rtree/Leaf.cc +++ b/src/core/spatialindex/rtree/Leaf.cc @@ -46,6 +46,9 @@ Leaf::Leaf( RTree* pTree, long id ): Node( pTree, id, 0, pTree->m_leafCapacity ) NodePtr Leaf::chooseSubtree( const Region& mbr, unsigned long level, std::stack& pathBuffer ) { + Q_UNUSED( mbr ); + Q_UNUSED( level ); + Q_UNUSED( pathBuffer ); // should make sure to relinquish other PoolPointer lists that might be pointing to the // same leaf. return NodePtr( this, &( m_pTree->m_leafPool ) ); @@ -53,6 +56,7 @@ NodePtr Leaf::chooseSubtree( const Region& mbr, unsigned long level, std::stack< NodePtr Leaf::findLeaf( const Region& mbr, long id, std::stack& pathBuffer ) { + Q_UNUSED( pathBuffer ); for ( unsigned long cChild = 0; cChild < m_children; cChild++ ) { // should make sure to relinquish other PoolPointer lists that might be pointing to the diff --git a/src/core/spatialindex/rtree/Node.cc b/src/core/spatialindex/rtree/Node.cc index ebacd631398..01cc09f8d8b 100644 --- a/src/core/spatialindex/rtree/Node.cc +++ b/src/core/spatialindex/rtree/Node.cc @@ -146,7 +146,7 @@ void Node::storeToByteArray( byte** data, unsigned long& len ) memcpy( ptr, m_nodeMBR.m_pHigh, m_pTree->m_dimension * sizeof( double ) ); //ptr += m_pTree->m_dimension * sizeof(double); - assert( len == ( ptr - *data ) + m_pTree->m_dimension * sizeof( double ) ); + Q_ASSERT( len == ( ptr - *data ) + m_pTree->m_dimension * sizeof( double ) ); } // @@ -172,14 +172,16 @@ unsigned long Node::getChildrenCount() const long Node::getChildIdentifier( unsigned long index ) const { - if ( index < 0 || index >= m_children ) throw Tools::IndexOutOfBoundsException( index ); + if ( index >= m_children ) + throw Tools::IndexOutOfBoundsException( index ); return m_pIdentifier[index]; } void Node::getChildShape( unsigned long index, IShape** out ) const { - if ( index < 0 || index >= m_children ) throw Tools::IndexOutOfBoundsException( index ); + if ( index >= m_children ) + throw Tools::IndexOutOfBoundsException( index ); *out = new Region( *( m_ptrMBR[index] ) ); } @@ -272,12 +274,13 @@ Node::~Node() Node& Node::operator=( const Node & n ) { + Q_UNUSED( n ); throw Tools::IllegalStateException( "operator =: This should never be called." ); } void Node::insertEntry( unsigned long dataLength, byte* pData, Region& mbr, long id ) { - assert( m_children < m_capacity ); + Q_ASSERT( m_children < m_capacity ); m_pDataLength[m_children] = dataLength; m_pData[m_children] = pData; @@ -293,7 +296,7 @@ void Node::insertEntry( unsigned long dataLength, byte* pData, Region& mbr, long void Node::deleteEntry( unsigned long index ) { - assert( index >= 0 && index < m_children ); + Q_ASSERT( index < m_children ); // cache it, since I might need it for "touches" later. RegionPtr ptrR = m_ptrMBR[index]; diff --git a/src/core/spatialindex/rtree/Node.h b/src/core/spatialindex/rtree/Node.h index e8cdd5bddde..d6c94c10bf7 100644 --- a/src/core/spatialindex/rtree/Node.h +++ b/src/core/spatialindex/rtree/Node.h @@ -140,7 +140,7 @@ namespace SpatialIndex RstarSplitEntry* pe1 = * ( RstarSplitEntry** ) pv1; RstarSplitEntry* pe2 = * ( RstarSplitEntry** ) pv2; - assert( pe1->m_sortDim == pe2->m_sortDim ); + Q_ASSERT( pe1->m_sortDim == pe2->m_sortDim ); if ( pe1->m_pRegion->m_pLow[pe1->m_sortDim] < pe2->m_pRegion->m_pLow[pe2->m_sortDim] ) return -1; if ( pe1->m_pRegion->m_pLow[pe1->m_sortDim] > pe2->m_pRegion->m_pLow[pe2->m_sortDim] ) return 1; @@ -152,7 +152,7 @@ namespace SpatialIndex RstarSplitEntry* pe1 = * ( RstarSplitEntry** ) pv1; RstarSplitEntry* pe2 = * ( RstarSplitEntry** ) pv2; - assert( pe1->m_sortDim == pe2->m_sortDim ); + Q_ASSERT( pe1->m_sortDim == pe2->m_sortDim ); if ( pe1->m_pRegion->m_pHigh[pe1->m_sortDim] < pe2->m_pRegion->m_pHigh[pe2->m_sortDim] ) return -1; if ( pe1->m_pRegion->m_pHigh[pe1->m_sortDim] > pe2->m_pRegion->m_pHigh[pe2->m_sortDim] ) return 1; diff --git a/src/core/spatialindex/rtree/PointerPoolNode.h b/src/core/spatialindex/rtree/PointerPoolNode.h index e8e272f5901..f61999437fa 100644 --- a/src/core/spatialindex/rtree/PointerPoolNode.h +++ b/src/core/spatialindex/rtree/PointerPoolNode.h @@ -45,7 +45,7 @@ namespace Tools ~PointerPool() { - assert( m_pool.size() <= m_capacity ); + Q_ASSERT( m_pool.size() <= m_capacity ); while ( ! m_pool.empty() ) { @@ -116,14 +116,13 @@ namespace Tools delete p; } - assert( m_pool.size() <= m_capacity ); + Q_ASSERT( m_pool.size() <= m_capacity ); } } unsigned long getCapacity() const { return m_capacity; } void setCapacity( unsigned long c ) { - assert( c >= 0 ); m_capacity = c; } diff --git a/src/core/spatialindex/rtree/RTree.cc b/src/core/spatialindex/rtree/RTree.cc index 0f9ffe8cecd..d0dfa2120a6 100644 --- a/src/core/spatialindex/rtree/RTree.cc +++ b/src/core/spatialindex/rtree/RTree.cc @@ -1031,7 +1031,7 @@ void SpatialIndex::RTree::RTree::storeHeader() ptr += sizeof( unsigned long ); } - assert( headerSize == ( ptr - header ) ); + Q_ASSERT( headerSize == ( ptr - header ) ); m_pStorageManager->storeByteArray( m_headerID, headerSize, header ); @@ -1088,7 +1088,7 @@ void SpatialIndex::RTree::RTree::loadHeader() void SpatialIndex::RTree::RTree::insertData_impl( unsigned long dataLength, byte* pData, Region& mbr, long id ) { - assert( mbr.getDimension() == m_dimension ); + Q_ASSERT( mbr.getDimension() == m_dimension ); stack pathBuffer; byte* overflowTable = 0; @@ -1103,7 +1103,7 @@ void SpatialIndex::RTree::RTree::insertData_impl( unsigned long dataLength, byte NodePtr l = root->chooseSubtree( mbr, 0, pathBuffer ); if ( l.get() == root.get() ) { - assert( root.unique() ); + Q_ASSERT( root.unique() ); root.relinquish(); } l->insertData( dataLength, pData, mbr, id, pathBuffer, overflowTable ); @@ -1120,17 +1120,17 @@ void SpatialIndex::RTree::RTree::insertData_impl( unsigned long dataLength, byte void SpatialIndex::RTree::RTree::insertData_impl( unsigned long dataLength, byte* pData, Region& mbr, long id, unsigned long level, byte* overflowTable ) { - assert( mbr.getDimension() == m_dimension ); + Q_ASSERT( mbr.getDimension() == m_dimension ); stack pathBuffer; NodePtr root = readNode( m_rootID ); NodePtr n = root->chooseSubtree( mbr, level, pathBuffer ); - assert( n->m_level == level ); + Q_ASSERT( n->m_level == level ); if ( n.get() == root.get() ) { - assert( root.unique() ); + Q_ASSERT( root.unique() ); root.relinquish(); } n->insertData( dataLength, pData, mbr, id, pathBuffer, overflowTable ); @@ -1138,14 +1138,14 @@ void SpatialIndex::RTree::RTree::insertData_impl( unsigned long dataLength, byte bool SpatialIndex::RTree::RTree::deleteData_impl( const Region& mbr, long id ) { - assert( mbr.m_dimension == m_dimension ); + Q_ASSERT( mbr.m_dimension == m_dimension ); stack pathBuffer; NodePtr root = readNode( m_rootID ); NodePtr l = root->findLeaf( mbr, id, pathBuffer ); if ( l.get() == root.get() ) { - assert( root.unique() ); + Q_ASSERT( root.unique() ); root.relinquish(); } @@ -1371,7 +1371,7 @@ void SpatialIndex::RTree::RTree::selfJoinQuery( long id1, long id2, const Region { if ( n1->m_pIdentifier[cChild1] != n2->m_pIdentifier[cChild2] ) { - assert( n2->m_level == 0 ); + Q_ASSERT( n2->m_level == 0 ); std::vector v; Data e1( n1->m_pDataLength[cChild1], n1->m_pData[cChild1], *( n1->m_ptrMBR[cChild1] ), n1->m_pIdentifier[cChild1] ); diff --git a/src/core/spatialindex/storagemanager/MemoryStorageManager.cc b/src/core/spatialindex/storagemanager/MemoryStorageManager.cc index 0ad67a30855..0e5584e7d0d 100644 --- a/src/core/spatialindex/storagemanager/MemoryStorageManager.cc +++ b/src/core/spatialindex/storagemanager/MemoryStorageManager.cc @@ -44,6 +44,7 @@ SpatialIndex::IStorageManager* SpatialIndex::StorageManager::createNewMemoryStor MemoryStorageManager::MemoryStorageManager( Tools::PropertySet& ps ) { + Q_UNUSED( ps ); } MemoryStorageManager::~MemoryStorageManager() diff --git a/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp b/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp index d2bfb5e6883..255296f4e9d 100644 --- a/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp +++ b/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp @@ -117,9 +117,13 @@ QgsSymbolV2* QgsCategorizedSymbolRendererV2::symbolForValue( QVariant value ) if ( it == mSymbolHash.end() ) { if ( mSymbolHash.count() == 0 ) + { QgsDebugMsg( "there are no hashed symbols!!!" ); + } else + { QgsDebugMsg( "attribute value not found: " + value.toString() ); + } return NULL; } diff --git a/src/core/symbology-ng/qgsfillsymbollayerv2.cpp b/src/core/symbology-ng/qgsfillsymbollayerv2.cpp index 81549acf789..c6aaf7c2baf 100644 --- a/src/core/symbology-ng/qgsfillsymbollayerv2.cpp +++ b/src/core/symbology-ng/qgsfillsymbollayerv2.cpp @@ -74,6 +74,7 @@ void QgsSimpleFillSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context void QgsSimpleFillSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context ) { + Q_UNUSED( context ); } void QgsSimpleFillSymbolLayerV2::renderPolygon( const QPolygonF& points, QList* rings, QgsSymbolV2RenderContext& context ) @@ -403,6 +404,8 @@ void QgsCentroidFillSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context void QgsCentroidFillSymbolLayerV2::renderPolygon( const QPolygonF& points, QList* rings, QgsSymbolV2RenderContext& context ) { + Q_UNUSED( rings ); + // calculate centroid double cx = 0, cy = 0; double area, sum = 0; diff --git a/src/core/symbology-ng/qgslinesymbollayerv2.cpp b/src/core/symbology-ng/qgslinesymbollayerv2.cpp index b320c093030..8dfee7baada 100644 --- a/src/core/symbology-ng/qgslinesymbollayerv2.cpp +++ b/src/core/symbology-ng/qgslinesymbollayerv2.cpp @@ -93,6 +93,7 @@ void QgsSimpleLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context void QgsSimpleLineSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context ) { + Q_UNUSED( context ); } void QgsSimpleLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context ) @@ -628,6 +629,7 @@ void QgsLineDecorationSymbolLayerV2::startRender( QgsSymbolV2RenderContext& cont void QgsLineDecorationSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context ) { + Q_UNUSED( context ); } void QgsLineDecorationSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context ) @@ -645,7 +647,8 @@ void QgsLineDecorationSymbolLayerV2::renderPolyline( const QPolygonF& points, Qg QPointF p1 = points.at( --cnt ); while ( p2 == p1 && cnt ) p1 = points.at( --cnt ); - if ( p1 == p2 ) { + if ( p1 == p2 ) + { // this is a collapsed line... don't bother drawing an arrow // with arbitrary orientation return; diff --git a/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp b/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp index a2fb5469822..0851edd2e54 100644 --- a/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp +++ b/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp @@ -214,6 +214,7 @@ void QgsSimpleMarkerSymbolLayerV2::prepareCache( QgsSymbolV2RenderContext& conte void QgsSimpleMarkerSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context ) { + Q_UNUSED( context ); } bool QgsSimpleMarkerSymbolLayerV2::prepareShape() @@ -426,6 +427,8 @@ QgsSymbolLayerV2* QgsSimpleMarkerSymbolLayerV2::clone() const void QgsSimpleMarkerSymbolLayerV2::drawMarker( QPainter* p, QgsSymbolV2RenderContext& context ) { + Q_UNUSED( context ); + if ( mPolygon.count() != 0 ) { p->drawPolygon( mPolygon ); @@ -504,9 +507,9 @@ void QgsSvgMarkerSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context ) void QgsSvgMarkerSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context ) { + Q_UNUSED( context ); } - void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context ) { QPainter* p = context.renderContext().painter(); @@ -707,6 +710,7 @@ void QgsFontMarkerSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context void QgsFontMarkerSymbolLayerV2::stopRender( QgsSymbolV2RenderContext& context ) { + Q_UNUSED( context ); } void QgsFontMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context ) diff --git a/src/core/symbology-ng/qgsrendererv2.cpp b/src/core/symbology-ng/qgsrendererv2.cpp index f03d96b345e..33cf8bfa878 100644 --- a/src/core/symbology-ng/qgsrendererv2.cpp +++ b/src/core/symbology-ng/qgsrendererv2.cpp @@ -360,6 +360,7 @@ QDomElement QgsFeatureRendererV2::save( QDomDocument& doc ) QgsLegendSymbologyList QgsFeatureRendererV2::legendSymbologyItems( QSize iconSize ) { + Q_UNUSED( iconSize ); // empty list by default return QgsLegendSymbologyList(); } diff --git a/src/core/symbology-ng/qgsrendererv2registry.h b/src/core/symbology-ng/qgsrendererv2registry.h index a2fd14ec3db..cc650af38ef 100644 --- a/src/core/symbology-ng/qgsrendererv2registry.h +++ b/src/core/symbology-ng/qgsrendererv2registry.h @@ -34,7 +34,7 @@ class CORE_EXPORT QgsRendererV2AbstractMetadata virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) = 0; /** Return new instance of settings widget for the renderer. Returns NULL on error. */ virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) - { return NULL; } + { Q_UNUSED( layer ); Q_UNUSED( style ); Q_UNUSED( renderer ); return NULL; } protected: //! name used within QGIS for identification (the same what renderer's type() returns) diff --git a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp index 9e40f9d8ce3..44dfb2ab9ac 100644 --- a/src/core/symbology-ng/qgsrulebasedrendererv2.cpp +++ b/src/core/symbology-ng/qgsrulebasedrendererv2.cpp @@ -128,6 +128,7 @@ QgsRuleBasedRendererV2::QgsRuleBasedRendererV2( QgsSymbolV2* defaultSymbol ) QgsSymbolV2* QgsRuleBasedRendererV2::symbolForFeature( QgsFeature& feature ) { + Q_UNUSED( feature ); return mCurrentSymbol; } diff --git a/src/core/symbology/qgsmarkercatalogue.cpp b/src/core/symbology/qgsmarkercatalogue.cpp index 301c9b916cf..0efef602ef2 100644 --- a/src/core/symbology/qgsmarkercatalogue.cpp +++ b/src/core/symbology/qgsmarkercatalogue.cpp @@ -271,6 +271,8 @@ bool QgsMarkerCatalogue::fontMarker( QPainter *thepPainter, QString fullName, do bool QgsMarkerCatalogue::svgMarker( QPainter * thepPainter, QString fileName, double scaleFactor ) { + Q_UNUSED( scaleFactor ); + QSvgRenderer mySVG; if ( !mySVG.load( fileName ) ) return false; diff --git a/src/crssync/main.cpp b/src/crssync/main.cpp index 8236cc9b9f6..0f083b88a12 100644 --- a/src/crssync/main.cpp +++ b/src/crssync/main.cpp @@ -28,6 +28,7 @@ void CPL_STDCALL showError( CPLErr errClass, int errNo, const char *msg ) { + Q_UNUSED( errClass ); QRegExp re( "EPSG PCS/GCS code \\d+ not found in EPSG support files. Is this a valid\nEPSG coordinate system?" ); if ( errNo != 6 && !re.exactMatch( msg ) ) { diff --git a/src/gui/attributetable/qgsattributetabledelegate.cpp b/src/gui/attributetable/qgsattributetabledelegate.cpp index 0cda26ba91f..1599f2b1d3c 100644 --- a/src/gui/attributetable/qgsattributetabledelegate.cpp +++ b/src/gui/attributetable/qgsattributetabledelegate.cpp @@ -52,7 +52,7 @@ int QgsAttributeTableDelegate::fieldIdx( const QModelIndex &index ) const return -1; } -int QgsAttributeTableDelegate::featureId( const QModelIndex &index ) const +QgsFeatureId QgsAttributeTableDelegate::featureId( const QModelIndex &index ) const { const QgsAttributeTableModel *tm = qobject_cast( index.model() ); if ( tm ) @@ -71,6 +71,7 @@ QWidget *QgsAttributeTableDelegate::createEditor( const QStyleOptionViewItem &option, const QModelIndex &index ) const { + Q_UNUSED( option ); QgsVectorLayer *vl = layer( index.model() ); if ( !vl ) return NULL; @@ -101,7 +102,7 @@ void QgsAttributeTableDelegate::setModelData( QWidget *editor, QAbstractItemMode return; int idx = fieldIdx( index ); - int fid = featureId( index ); + QgsFeatureId fid = featureId( index ); QVariant value; if ( !QgsAttributeEditor::retrieveValue( editor, vl, idx, value ) ) diff --git a/src/gui/attributetable/qgsattributetabledelegate.h b/src/gui/attributetable/qgsattributetabledelegate.h index 1666c43c11e..b6e93811a7d 100644 --- a/src/gui/attributetable/qgsattributetabledelegate.h +++ b/src/gui/attributetable/qgsattributetabledelegate.h @@ -17,6 +17,7 @@ #define QGSATTRIBUTETABLEDELEGATE_H #include +#include "qgsfeature.h" class QPainter; class QgsVectorLayer; @@ -32,7 +33,7 @@ class QgsAttributeTableDelegate : public QItemDelegate QgsVectorLayer *layer( const QAbstractItemModel *model ) const; int fieldIdx( const QModelIndex &index ) const; - int featureId( const QModelIndex &index ) const; + QgsFeatureId featureId( const QModelIndex &index ) const; public: /** Constructor diff --git a/src/gui/attributetable/qgsattributetablefiltermodel.cpp b/src/gui/attributetable/qgsattributetablefiltermodel.cpp index 71ade622d3c..f54802af27c 100644 --- a/src/gui/attributetable/qgsattributetablefiltermodel.cpp +++ b/src/gui/attributetable/qgsattributetablefiltermodel.cpp @@ -35,6 +35,7 @@ QgsAttributeTableFilterModel::QgsAttributeTableFilterModel( QgsVectorLayer *theL bool QgsAttributeTableFilterModel::filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const { + Q_UNUSED( sourceParent ); if ( mHideUnselected ) return mLayer->selectedFeaturesIds().contains( tableModel()->rowToId( sourceRow ) ); diff --git a/src/gui/attributetable/qgsattributetableidcolumnpair.h b/src/gui/attributetable/qgsattributetableidcolumnpair.h index c3987f064bb..6a5a43a4824 100644 --- a/src/gui/attributetable/qgsattributetableidcolumnpair.h +++ b/src/gui/attributetable/qgsattributetableidcolumnpair.h @@ -18,20 +18,21 @@ #define QGSATTRIBUTETABKEIDCOLUMNPAIR_H #include +#include "qgsfeature.h" class QgsAttributeTableIdColumnPair { - int mId; + QgsFeatureId mId; QVariant mItem; public: - QgsAttributeTableIdColumnPair( int anId, QVariant anItem ) : mId( anId ), mItem( anItem ) {} + QgsAttributeTableIdColumnPair( QgsFeatureId anId, QVariant anItem ) : mId( anId ), mItem( anItem ) {} /** * Returns true if this id-column pair is less the the tested one * @param b the tested id-column pair */ bool operator<( const QgsAttributeTableIdColumnPair &b ) const; - int id() { return mId; } + QgsFeatureId id() { return mId; } }; #endif diff --git a/src/gui/attributetable/qgsattributetablememorymodel.cpp b/src/gui/attributetable/qgsattributetablememorymodel.cpp index b6ce993e6b5..957ae4f2db5 100644 --- a/src/gui/attributetable/qgsattributetablememorymodel.cpp +++ b/src/gui/attributetable/qgsattributetablememorymodel.cpp @@ -46,7 +46,7 @@ QgsAttributeTableMemoryModel::QgsAttributeTableMemoryModel loadLayer(); } -bool QgsAttributeTableMemoryModel::featureAtId( int fid ) +bool QgsAttributeTableMemoryModel::featureAtId( QgsFeatureId fid ) { if ( mFeatureMap.contains( fid ) ) { @@ -60,14 +60,14 @@ bool QgsAttributeTableMemoryModel::featureAtId( int fid ) } } -void QgsAttributeTableMemoryModel::featureDeleted( int fid ) +void QgsAttributeTableMemoryModel::featureDeleted( QgsFeatureId fid ) { QgsDebugMsg( "entered." ); mFeatureMap.remove( fid ); QgsAttributeTableModel::featureDeleted( fid ); } -void QgsAttributeTableMemoryModel::featureAdded( int fid ) +void QgsAttributeTableMemoryModel::featureAdded( QgsFeatureId fid ) { QgsDebugMsg( "entered." ); QgsFeature f; @@ -83,7 +83,7 @@ void QgsAttributeTableMemoryModel::layerDeleted() QgsAttributeTableModel::layerDeleted(); } -void QgsAttributeTableMemoryModel::attributeValueChanged( int fid, int idx, const QVariant &value ) +void QgsAttributeTableMemoryModel::attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value ) { QgsDebugMsg( "entered." ); mFeatureMap[fid].changeAttribute( idx, value ); diff --git a/src/gui/attributetable/qgsattributetablememorymodel.h b/src/gui/attributetable/qgsattributetablememorymodel.h index 8918e3215b5..08315597e23 100644 --- a/src/gui/attributetable/qgsattributetablememorymodel.h +++ b/src/gui/attributetable/qgsattributetablememorymodel.h @@ -49,12 +49,12 @@ class QgsAttributeTableMemoryModel : public QgsAttributeTableModel * Launched when a feature has been deleted * @param fid feature id */ - virtual void featureDeleted( int fid ); + virtual void featureDeleted( QgsFeatureId fid ); /** * Launched when a feature has been deleted * @param fid feature id */ - virtual void featureAdded( int fid ); + virtual void featureAdded( QgsFeatureId fid ); /** * Launched when layer has been deleted */ @@ -67,7 +67,7 @@ class QgsAttributeTableMemoryModel : public QgsAttributeTableModel * @param idx attribute index * @param value new value */ - virtual void attributeValueChanged( int fid, int idx, const QVariant &value ); + virtual void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value ); private: /** @@ -75,14 +75,14 @@ class QgsAttributeTableMemoryModel : public QgsAttributeTableModel * @param fid feature id * @return feature exists */ - virtual bool featureAtId( int fid ); + virtual bool featureAtId( QgsFeatureId fid ); /** * Loads the layer into the model */ virtual void loadLayer(); - QHash mFeatureMap; + QHash mFeatureMap; }; #endif //QGSATTRIBUTETABLEMEMORYMODEL_H diff --git a/src/gui/attributetable/qgsattributetablemodel.cpp b/src/gui/attributetable/qgsattributetablemodel.cpp index e91d0405256..cb4675c5bf2 100644 --- a/src/gui/attributetable/qgsattributetablemodel.cpp +++ b/src/gui/attributetable/qgsattributetablemodel.cpp @@ -36,16 +36,16 @@ QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayer *theLayer, QObjec mLayer = theLayer; loadAttributes(); - connect( mLayer, SIGNAL( attributeValueChanged( int, int, const QVariant& ) ), this, SLOT( attributeValueChanged( int, int, const QVariant& ) ) ); - connect( mLayer, SIGNAL( featureAdded( int ) ), this, SLOT( featureAdded( int ) ) ); - connect( mLayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) ); + connect( mLayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant& ) ), this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant& ) ) ); + connect( mLayer, SIGNAL( featureAdded( QgsFeatureId ) ), this, SLOT( featureAdded( QgsFeatureId ) ) ); + connect( mLayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) ); connect( mLayer, SIGNAL( attributeAdded( int ) ), this, SLOT( attributeAdded( int ) ) ); connect( mLayer, SIGNAL( attributeDeleted( int ) ), this, SLOT( attributeDeleted( int ) ) ); loadLayer(); } -bool QgsAttributeTableModel::featureAtId( int fid ) const +bool QgsAttributeTableModel::featureAtId( QgsFeatureId fid ) const { QgsDebugMsgLevel( QString( "loading feature %1" ).arg( fid ), 3 ); @@ -55,7 +55,7 @@ bool QgsAttributeTableModel::featureAtId( int fid ) const return mLayer->featureAtId( fid, mFeat, false, true ); } -void QgsAttributeTableModel::featureDeleted( int fid ) +void QgsAttributeTableModel::featureDeleted( QgsFeatureId fid ) { QgsDebugMsgLevel( QString( "deleted fid=%1 => row=%2" ).arg( fid ).arg( idToRow( fid ) ), 3 ); @@ -68,6 +68,7 @@ void QgsAttributeTableModel::featureDeleted( int fid ) bool QgsAttributeTableModel::removeRows( int row, int count, const QModelIndex &parent ) { + Q_UNUSED( parent ); QgsDebugMsgLevel( QString( "remove %2 rows at %1 (rows %3, ids %4)" ).arg( row ).arg( count ).arg( mRowIdMap.size() ).arg( mIdRowMap.size() ), 3 ); // clean old references @@ -81,23 +82,23 @@ bool QgsAttributeTableModel::removeRows( int row, int count, const QModelIndex & int n = mRowIdMap.size() + count; for ( int i = row + count; i < n; i++ ) { - int id = mRowIdMap[i]; + QgsFeatureId id = mRowIdMap[i]; mIdRowMap[ id ] -= count; mRowIdMap[ i-count ] = id; mRowIdMap.remove( i ); } #ifdef QGISDEBUG - QHash::iterator it; - QgsDebugMsgLevel( QString( "after removal rows %1, ids %2" ).arg( mRowIdMap.size() ).arg( mIdRowMap.size() ), 4 ); QgsDebugMsgLevel( "id->row", 4 ); - for ( it = mIdRowMap.begin(); it != mIdRowMap.end(); ++it ) - QgsDebugMsgLevel( QString( "%1->%2" ).arg( it.key() ).arg( *it ), 4 ); + for ( QHash::iterator it = mIdRowMap.begin(); it != mIdRowMap.end(); ++it ) + QgsDebugMsgLevel( QString( "%1->%2" ).arg( FID_TO_STRING( it.key() ) ).arg( *it ), 4 ); + + QHash::iterator idit; QgsDebugMsgLevel( "row->id", 4 ); - for ( it = mRowIdMap.begin(); it != mRowIdMap.end(); ++it ) - QgsDebugMsgLevel( QString( "%1->%2" ).arg( it.key() ).arg( *it ), 4 ); + for ( QHash::iterator it = mRowIdMap.begin(); it != mRowIdMap.end(); ++it ) + QgsDebugMsgLevel( QString( "%1->%2" ).arg( it.key() ).arg( FID_TO_STRING( *it ) ), 4 ); #endif Q_ASSERT( mRowIdMap.size() == mIdRowMap.size() ); @@ -105,7 +106,7 @@ bool QgsAttributeTableModel::removeRows( int row, int count, const QModelIndex & return true; } -void QgsAttributeTableModel::featureAdded( int fid, bool newOperation ) +void QgsAttributeTableModel::featureAdded( QgsFeatureId fid, bool newOperation ) { QgsDebugMsgLevel( QString( "feature %1 added (%2, rows %3, ids %4)" ).arg( fid ).arg( newOperation ).arg( mRowIdMap.size() ).arg( mIdRowMap.size() ), 3 ); @@ -124,6 +125,7 @@ void QgsAttributeTableModel::featureAdded( int fid, bool newOperation ) void QgsAttributeTableModel::attributeAdded( int idx ) { + Q_UNUSED( idx ); QgsDebugMsg( "entered." ); loadAttributes(); loadLayer(); @@ -132,6 +134,7 @@ void QgsAttributeTableModel::attributeAdded( int idx ) void QgsAttributeTableModel::attributeDeleted( int idx ) { + Q_UNUSED( idx ); QgsDebugMsg( "entered." ); loadAttributes(); loadLayer(); @@ -147,7 +150,7 @@ void QgsAttributeTableModel::layerDeleted() endRemoveRows(); } -void QgsAttributeTableModel::attributeValueChanged( int fid, int idx, const QVariant &value ) +void QgsAttributeTableModel::attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value ) { setData( index( idToRow( fid ), fieldCol( idx ) ), value, Qt::EditRole ); } @@ -219,7 +222,7 @@ void QgsAttributeTableModel::loadLayer() if ( behaviour == 1 ) { beginInsertRows( QModelIndex(), 0, mLayer->selectedFeatureCount() ); - foreach( int fid, mLayer->selectedFeaturesIds() ) + foreach( QgsFeatureId fid, mLayer->selectedFeaturesIds() ) { featureAdded( fid, false ); } @@ -246,7 +249,7 @@ void QgsAttributeTableModel::loadLayer() mFieldCount = mAttributes.size(); } -void QgsAttributeTableModel::swapRows( int a, int b ) +void QgsAttributeTableModel::swapRows( QgsFeatureId a, QgsFeatureId b ) { if ( a == b ) return; @@ -269,7 +272,7 @@ void QgsAttributeTableModel::swapRows( int a, int b ) //emit layoutChanged(); } -int QgsAttributeTableModel::idToRow( const int id ) const +int QgsAttributeTableModel::idToRow( QgsFeatureId id ) const { if ( !mIdRowMap.contains( id ) ) { @@ -280,16 +283,16 @@ int QgsAttributeTableModel::idToRow( const int id ) const return mIdRowMap[id]; } -int QgsAttributeTableModel::rowToId( const int id ) const +QgsFeatureId QgsAttributeTableModel::rowToId( const int row ) const { - if ( !mRowIdMap.contains( id ) ) + if ( !mRowIdMap.contains( row ) ) { - QgsDebugMsg( QString( "rowToId: row %1 not in the map" ).arg( id ) ); + QgsDebugMsg( QString( "rowToId: row %1 not in the map" ).arg( row ) ); // return negative infinite (to avoid collision with newly added features) return std::numeric_limits::min(); } - return mRowIdMap[id]; + return mRowIdMap[row]; } int QgsAttributeTableModel::fieldIdx( int col ) const @@ -304,11 +307,13 @@ int QgsAttributeTableModel::fieldCol( int idx ) const int QgsAttributeTableModel::rowCount( const QModelIndex &parent ) const { + Q_UNUSED( parent ); return mRowIdMap.size(); } int QgsAttributeTableModel::columnCount( const QModelIndex &parent ) const { + Q_UNUSED( parent ); return mFieldCount; } @@ -398,7 +403,7 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons } // if we don't have the row in current cache, load it from layer first - int rowId = rowToId( index.row() ); + QgsFeatureId rowId = rowToId( index.row() ); if ( mFeat.id() != rowId ) { if ( !featureAtId( rowId ) ) @@ -437,7 +442,7 @@ bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant & if ( !index.isValid() || role != Qt::EditRole || !mLayer->isEditable() ) return false; - int rowId = rowToId( index.row() ); + QgsFeatureId rowId = rowToId( index.row() ); if ( mFeat.id() == rowId || featureAtId( rowId ) ) { mFeat.changeAttribute( mAttributes[ index.column()], value ); diff --git a/src/gui/attributetable/qgsattributetablemodel.h b/src/gui/attributetable/qgsattributetablemodel.h index d24c09c217b..9ce66ae0cfa 100644 --- a/src/gui/attributetable/qgsattributetablemodel.h +++ b/src/gui/attributetable/qgsattributetablemodel.h @@ -101,7 +101,7 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel * Maps feature id to table row * @param id feature id */ - int idToRow( const int id ) const; + int idToRow( QgsFeatureId id ) const; /** * get field index from column */ @@ -114,7 +114,7 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel * Maps row to feature id * @param row row number */ - int rowToId( const int row ) const; + QgsFeatureId rowToId( int row ) const; /** * Sorts the model * @param column column to sort by @@ -126,7 +126,7 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel * @param a first row * @param b second row */ - void swapRows( int a, int b ); + void swapRows( QgsFeatureId a, QgsFeatureId b ); /** * Returns layer pointer @@ -174,18 +174,18 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel * @param idx attribute index * @param value new value */ - virtual void attributeValueChanged( int fid, int idx, const QVariant &value ); + virtual void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value ); /** * Launched when a feature has been deleted * @param fid feature id */ - virtual void featureDeleted( int fid ); + virtual void featureDeleted( QgsFeatureId fid ); /** * Launched when a feature has been added * @param fid feature id * @parem inOperation guard insertion with beginInsertRows() / endInsertRows() */ - virtual void featureAdded( int fid, bool inOperation = true ); + virtual void featureAdded( QgsFeatureId fid, bool inOperation = true ); /** * Launched when layer has been deleted */ @@ -201,8 +201,8 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel QMap< int, const QMap * > mValueMaps; QList mSortList; - QHash mIdRowMap; - QHash mRowIdMap; + QHash mIdRowMap; + QHash mRowIdMap; //! useful when showing only features from a particular extent static QgsRectangle mCurrentExtent; @@ -227,7 +227,7 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel * @param fid feature id * @return feature exists */ - virtual bool featureAtId( int fid ) const; + virtual bool featureAtId( QgsFeatureId fid ) const; }; diff --git a/src/gui/attributetable/qgsattributetableview.cpp b/src/gui/attributetable/qgsattributetableview.cpp index d322085d7fc..ed2299bfb2c 100644 --- a/src/gui/attributetable/qgsattributetableview.cpp +++ b/src/gui/attributetable/qgsattributetableview.cpp @@ -82,8 +82,9 @@ QgsAttributeTableView::~QgsAttributeTableView() delete mActionPopup; } -void QgsAttributeTableView::closeEvent( QCloseEvent *event ) +void QgsAttributeTableView::closeEvent( QCloseEvent *e ) { + Q_UNUSED( e ); QSettings settings; settings.setValue( "/BetterAttributeTable/geometry", QVariant( saveGeometry() ) ); } diff --git a/src/gui/qgisgui.cpp b/src/gui/qgisgui.cpp index 283833c9277..83dc39ee163 100644 --- a/src/gui/qgisgui.cpp +++ b/src/gui/qgisgui.cpp @@ -29,6 +29,7 @@ namespace QgisGui QString const &filters, QStringList & selectedFiles, QString& enc, QString &title, bool cancelAll ) { + Q_UNUSED( enc ); bool haveLastUsedFilter = false; // by default, there is no last // used filter @@ -90,6 +91,7 @@ namespace QgisGui QPair GUI_EXPORT getSaveAsImageName( QWidget * theParent, QString theMessage ) { + Q_UNUSED( theMessage ); //create a map to hold the QImageIO names and the filter names //the QImageIO name must be passed to the mapcanvas saveas image function typedef QMap FilterMap; diff --git a/src/gui/qgsannotationitem.cpp b/src/gui/qgsannotationitem.cpp index ea223559663..639370cbb7b 100644 --- a/src/gui/qgsannotationitem.cpp +++ b/src/gui/qgsannotationitem.cpp @@ -413,6 +413,7 @@ void QgsAnnotationItem::_writeXML( QDomDocument& doc, QDomElement& itemElem ) co void QgsAnnotationItem::_readXML( const QDomDocument& doc, const QDomElement& annotationElem ) { + Q_UNUSED( doc ); if ( annotationElem.isNull() ) { return; diff --git a/src/gui/qgscomposerview.cpp b/src/gui/qgscomposerview.cpp index c237b95d8ef..a5c4827d119 100644 --- a/src/gui/qgscomposerview.cpp +++ b/src/gui/qgscomposerview.cpp @@ -30,9 +30,17 @@ #include "qgscomposershape.h" #include "qgscomposerattributetable.h" -QgsComposerView::QgsComposerView( QWidget* parent, const char* name, Qt::WFlags f ) : - QGraphicsView( parent ), mShiftKeyPressed( false ), mRubberBandItem( 0 ), mRubberBandLineItem( 0 ), mMoveContentItem( 0 ), mPaintingEnabled( true ) +QgsComposerView::QgsComposerView( QWidget* parent, const char* name, Qt::WFlags f ) + : QGraphicsView( parent ) + , mShiftKeyPressed( false ) + , mRubberBandItem( 0 ) + , mRubberBandLineItem( 0 ) + , mMoveContentItem( 0 ) + , mPaintingEnabled( true ) { + Q_UNUSED( f ); + Q_UNUSED( name ); + setResizeAnchor( QGraphicsView::AnchorViewCenter ); setMouseTracking( true ); viewport()->setMouseTracking( true ); diff --git a/src/gui/qgsformannotationitem.cpp b/src/gui/qgsformannotationitem.cpp index a1aea252b07..601ae61b7f8 100644 --- a/src/gui/qgsformannotationitem.cpp +++ b/src/gui/qgsformannotationitem.cpp @@ -115,11 +115,13 @@ void QgsFormAnnotationItem::setMapPosition( const QgsPoint& pos ) void QgsFormAnnotationItem::paint( QPainter * painter ) { - + Q_UNUSED( painter ); } void QgsFormAnnotationItem::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget ) { + Q_UNUSED( option ); + Q_UNUSED( widget ); if ( !painter || !mWidgetContainer ) { return; @@ -233,7 +235,7 @@ void QgsFormAnnotationItem::setFeatureForMapPosition() mVectorLayer->select( noAttributes, searchRect, false, true ); QgsFeature currentFeature; - int currentFeatureId = 0; + QgsFeatureId currentFeatureId = 0; bool featureFound = false; while ( mVectorLayer->nextFeature( currentFeature ) ) diff --git a/src/gui/qgsformannotationitem.h b/src/gui/qgsformannotationitem.h index 102a0e73fa5..863f024843f 100644 --- a/src/gui/qgsformannotationitem.h +++ b/src/gui/qgsformannotationitem.h @@ -19,6 +19,7 @@ #define QGSFORMANNOTATIONITEM_H #include "qgsannotationitem.h" +#include "qgsfeature.h" #include class QGraphicsProxyWidget; @@ -65,7 +66,7 @@ class GUI_EXPORT QgsFormAnnotationItem: public QObject, public QgsAnnotationItem /**True if the item is related to a vector feature*/ bool mHasAssociatedFeature; /**Associated feature*/ - int mFeature; + QgsFeatureId mFeature; /**Path to (and including) the .ui file*/ QString mDesignerForm; diff --git a/src/gui/qgsmapcanvas.cpp b/src/gui/qgsmapcanvas.cpp index bef23b3bfcd..9eb05f606f7 100644 --- a/src/gui/qgsmapcanvas.cpp +++ b/src/gui/qgsmapcanvas.cpp @@ -83,6 +83,7 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name ) , mPainting( false ) , mAntiAliasing( false ) { + Q_UNUSED( name ); //disable the update that leads to the resize crash if ( viewport() ) { @@ -1308,6 +1309,7 @@ void QgsMapCanvas::setRenderFlag( bool theFlag ) void QgsMapCanvas::connectNotify( const char * signal ) { + Q_UNUSED( signal ); QgsDebugMsg( "QgsMapCanvas connected to " + QString( signal ) ); } //connectNotify @@ -1368,6 +1370,8 @@ void QgsMapCanvas::panActionEnd( QPoint releasePoint ) void QgsMapCanvas::panAction( QMouseEvent * e ) { + Q_UNUSED( e ); + if ( mDrawing ) { return; diff --git a/src/gui/qgsmapcanvasitem.cpp b/src/gui/qgsmapcanvasitem.cpp index ddcdeee983f..8c8cdfd3c2b 100644 --- a/src/gui/qgsmapcanvasitem.cpp +++ b/src/gui/qgsmapcanvasitem.cpp @@ -41,6 +41,8 @@ void QgsMapCanvasItem::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget ) { + Q_UNUSED( option ); + Q_UNUSED( widget ); if ( mMapCanvas->antiAliasingEnabled() ) { painter->setRenderHint( QPainter::Antialiasing ); diff --git a/src/gui/qgsmapoverviewcanvas.cpp b/src/gui/qgsmapoverviewcanvas.cpp index da6c02561f9..338b2700e04 100644 --- a/src/gui/qgsmapoverviewcanvas.cpp +++ b/src/gui/qgsmapoverviewcanvas.cpp @@ -52,6 +52,8 @@ class QgsPanningWidget : public QWidget void paintEvent( QPaintEvent* pe ) { + Q_UNUSED( pe ); + QRect r( QPoint( 0, 0 ), size() ); QPainter p; p.begin( this ); diff --git a/src/gui/qgsmaptool.cpp b/src/gui/qgsmaptool.cpp index 27cf939261c..a3af6632ae5 100644 --- a/src/gui/qgsmaptool.cpp +++ b/src/gui/qgsmaptool.cpp @@ -111,28 +111,34 @@ QAbstractButton* QgsMapTool::button() } -void QgsMapTool::canvasMoveEvent( QMouseEvent * ) +void QgsMapTool::canvasMoveEvent( QMouseEvent *e ) { + Q_UNUSED( e ); } -void QgsMapTool::canvasDoubleClickEvent( QMouseEvent * ) +void QgsMapTool::canvasDoubleClickEvent( QMouseEvent *e ) { + Q_UNUSED( e ); } -void QgsMapTool::canvasPressEvent( QMouseEvent * ) +void QgsMapTool::canvasPressEvent( QMouseEvent *e ) { + Q_UNUSED( e ); } -void QgsMapTool::canvasReleaseEvent( QMouseEvent * ) +void QgsMapTool::canvasReleaseEvent( QMouseEvent *e ) { + Q_UNUSED( e ); } -void QgsMapTool::keyPressEvent( QKeyEvent* e ) +void QgsMapTool::keyPressEvent( QKeyEvent *e ) { + Q_UNUSED( e ); } -void QgsMapTool::keyReleaseEvent( QKeyEvent* e ) +void QgsMapTool::keyReleaseEvent( QKeyEvent *e ) { + Q_UNUSED( e ); } void QgsMapTool::renderComplete() diff --git a/src/gui/qgsmaptoolemitpoint.cpp b/src/gui/qgsmaptoolemitpoint.cpp index e9128cb8093..34383405c0e 100644 --- a/src/gui/qgsmaptoolemitpoint.cpp +++ b/src/gui/qgsmaptoolemitpoint.cpp @@ -26,6 +26,7 @@ QgsMapToolEmitPoint::QgsMapToolEmitPoint( QgsMapCanvas* canvas ) void QgsMapToolEmitPoint::canvasMoveEvent( QMouseEvent * e ) { + Q_UNUSED( e ); } void QgsMapToolEmitPoint::canvasPressEvent( QMouseEvent * e ) @@ -36,4 +37,5 @@ void QgsMapToolEmitPoint::canvasPressEvent( QMouseEvent * e ) void QgsMapToolEmitPoint::canvasReleaseEvent( QMouseEvent * e ) { + Q_UNUSED( e ); } diff --git a/src/gui/qgsmessageviewer.cpp b/src/gui/qgsmessageviewer.cpp index 62c6af09d0b..035238397f2 100644 --- a/src/gui/qgsmessageviewer.cpp +++ b/src/gui/qgsmessageviewer.cpp @@ -35,23 +35,23 @@ QgsMessageViewer::~QgsMessageViewer() { } -void QgsMessageViewer::setMessageAsHtml( const QString& msg ) +void QgsMessageViewer::setMessageAsHtml( const QString &msg ) { txtMessage->setHtml( msg ); } -void QgsMessageViewer::setMessageAsPlainText( const QString& msg ) +void QgsMessageViewer::setMessageAsPlainText( const QString &msg ) { txtMessage->setPlainText( msg ); } -void QgsMessageViewer::appendMessage( const QString& msg ) +void QgsMessageViewer::appendMessage( const QString &msg ) { txtMessage->append( msg ); } -void QgsMessageViewer::setMessage( const QString& message, MessageType msgType ) +void QgsMessageViewer::setMessage( const QString &message, MessageType msgType ) { if ( msgType == MessageHtml ) setMessageAsHtml( message ); @@ -106,6 +106,7 @@ void QgsMessageViewer::setCheckBoxQSettingsLabel( QString label ) void QgsMessageViewer::on_checkBox_toggled( bool toggled ) { + Q_UNUSED( toggled ); if ( !mCheckBoxQSettingsLabel.isEmpty() ) { QSettings settings; diff --git a/src/gui/qgsprojectbadlayerguihandler.cpp b/src/gui/qgsprojectbadlayerguihandler.cpp index bfd9fa44c7b..51b86777bc2 100644 --- a/src/gui/qgsprojectbadlayerguihandler.cpp +++ b/src/gui/qgsprojectbadlayerguihandler.cpp @@ -18,6 +18,8 @@ bool QgsProjectBadLayerGuiHandler::mIgnore = false; void QgsProjectBadLayerGuiHandler::handleBadLayers( QList layers, QDomDocument projectDom ) { + Q_UNUSED( projectDom ); + QgsDebugMsg( QString( "%1 bad layers found" ).arg( layers.size() ) ); // make sure we have arrow cursor (and not a wait cursor) diff --git a/src/gui/qgsprojectionselector.cpp b/src/gui/qgsprojectionselector.cpp index 1b202c24cac..d0f550cc851 100644 --- a/src/gui/qgsprojectionselector.cpp +++ b/src/gui/qgsprojectionselector.cpp @@ -33,7 +33,7 @@ const int NAME_COLUMN = 0; const int AUTHID_COLUMN = 1; const int QGIS_CRS_ID_COLUMN = 2; -QgsProjectionSelector::QgsProjectionSelector( QWidget* parent, const char * name, Qt::WFlags fl ) +QgsProjectionSelector::QgsProjectionSelector( QWidget* parent, const char *name, Qt::WFlags fl ) : QWidget( parent, fl ) , mProjListDone( false ) , mUserProjListDone( false ) @@ -41,6 +41,7 @@ QgsProjectionSelector::QgsProjectionSelector( QWidget* parent, const char * name , mCRSIDSelectionPending( false ) , mAuthIDSelectionPending( false ) { + Q_UNUSED( name ); setupUi( this ); connect( lstCoordinateSystems, SIGNAL( currentItemChanged( QTreeWidgetItem*, QTreeWidgetItem* ) ), this, SLOT( coordinateSystemSelected( QTreeWidgetItem* ) ) ); @@ -854,6 +855,7 @@ void QgsProjectionSelector::on_cbxHideDeprecated_stateChanged() void QgsProjectionSelector::on_lstRecent_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous ) { + Q_UNUSED( previous ); setSelectedCrsId( current->text( QGIS_CRS_ID_COLUMN ).toLong() ); } diff --git a/src/gui/symbology-ng/qgssymbollayerv2widget.cpp b/src/gui/symbology-ng/qgssymbollayerv2widget.cpp index fd79a7292ae..5a12da19766 100644 --- a/src/gui/symbology-ng/qgssymbollayerv2widget.cpp +++ b/src/gui/symbology-ng/qgssymbollayerv2widget.cpp @@ -525,6 +525,7 @@ class QgsSvgListModel : public QAbstractListModel int rowCount( const QModelIndex & parent = QModelIndex() ) const { + Q_UNUSED( parent ); return mSvgFiles.count(); } diff --git a/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp b/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp index 45138722a9f..45c5f677161 100644 --- a/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp +++ b/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp @@ -266,6 +266,7 @@ void QgsSymbolV2SelectorDialog::keyPressEvent( QKeyEvent * e ) void QgsSymbolV2SelectorDialog::on_mSymbolUnitComboBox_currentIndexChanged( const QString & text ) { + Q_UNUSED( text ); if ( mSymbol ) { mSymbol->setOutputUnit(( QgsSymbolV2::OutputUnit ) mSymbolUnitComboBox->currentIndex() ); diff --git a/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp b/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp index 07df93d2866..31ab83e837c 100644 --- a/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp +++ b/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp @@ -234,5 +234,6 @@ void QgsVectorGradientColorRampV2Dialog::removeStop() void QgsVectorGradientColorRampV2Dialog::toggledStops( bool on ) { + Q_UNUSED( on ); updatePreview(); } diff --git a/src/helpviewer/qgshelpviewer.cpp b/src/helpviewer/qgshelpviewer.cpp index 32cddb8b187..a999e7201c6 100644 --- a/src/helpviewer/qgshelpviewer.cpp +++ b/src/helpviewer/qgshelpviewer.cpp @@ -70,11 +70,13 @@ void QgsHelpViewer::fileExit() */ void QgsHelpViewer::moveEvent( QMoveEvent *event ) { + Q_UNUSED( event ); saveWindowLocation(); } void QgsHelpViewer::resizeEvent( QResizeEvent *event ) { + Q_UNUSED( event ); saveWindowLocation(); } diff --git a/src/mapserver/qgis_map_serv.cpp b/src/mapserver/qgis_map_serv.cpp index 11f01b10a89..79057aad465 100644 --- a/src/mapserver/qgis_map_serv.cpp +++ b/src/mapserver/qgis_map_serv.cpp @@ -42,6 +42,8 @@ map service syntax for SOAP/HTTP POST void dummyMessageHandler( QtMsgType type, const char *msg ) { + Q_UNUSED( type ); + Q_UNUSED( msg ); #ifdef QGSMSDEBUG QString output; diff --git a/src/mapserver/qgsconfigparser.cpp b/src/mapserver/qgsconfigparser.cpp index cb5a2db36fa..f2fb64b5743 100644 --- a/src/mapserver/qgsconfigparser.cpp +++ b/src/mapserver/qgsconfigparser.cpp @@ -437,7 +437,7 @@ QgsComposition* QgsConfigParser::createPrintComposition( const QString& composer continue; } - if( !titleIt.key().isEmpty() ) //no label text replacement with empty key + if ( !titleIt.key().isEmpty() ) //no label text replacement with empty key { currentLabel->setText( titleIt.value() ); currentLabel->adjustSizeToText(); @@ -449,6 +449,7 @@ QgsComposition* QgsConfigParser::createPrintComposition( const QString& composer void QgsConfigParser::serviceCapabilities( QDomElement& parentElement, QDomDocument& doc ) const { + Q_UNUSED( doc ); QFile wmsService( "wms_metadata.xml" ); if ( wmsService.open( QIODevice::ReadOnly ) ) { diff --git a/src/mapserver/qgsconfigparser.h b/src/mapserver/qgsconfigparser.h index 4a3ef2e9abd..151f655cf15 100644 --- a/src/mapserver/qgsconfigparser.h +++ b/src/mapserver/qgsconfigparser.h @@ -54,7 +54,8 @@ class QgsConfigParser virtual QDomDocument getStyle( const QString& styleName, const QString& layerName ) const = 0; /**Possibility to add a parameter map to the config parser. This is used by the SLD parser. Default implementation does nothing*/ - virtual void setParameterMap( const std::map& parameterMap ) {} + virtual void setParameterMap( const std::map& parameterMap ) + { Q_UNUSED( parameterMap ); } /**Returns if output are MM or PIXEL*/ QgsMapRenderer::OutputUnits outputUnits() const { return mOutputUnits; } diff --git a/src/mapserver/qgsgetrequesthandler.cpp b/src/mapserver/qgsgetrequesthandler.cpp index 7e569f51a32..e330f0509e3 100644 --- a/src/mapserver/qgsgetrequesthandler.cpp +++ b/src/mapserver/qgsgetrequesthandler.cpp @@ -42,7 +42,7 @@ std::map QgsGetRequestHandler::parseInput() { element = *it; int sepidx = element.indexOf( "=", 0, Qt::CaseSensitive ); - if( sepidx == -1 ) + if ( sepidx == -1 ) { continue; } @@ -131,6 +131,7 @@ std::map QgsGetRequestHandler::parseInput() void QgsGetRequestHandler::sendGetMapResponse( const QString& service, QImage* img ) const { + Q_UNUSED( service ); if ( img ) { if ( mFormat != "PNG" && mFormat != "JPG" ) diff --git a/src/mapserver/qgshostedrdsbuilder.cpp b/src/mapserver/qgshostedrdsbuilder.cpp index 8c9dbe384c0..ff3072b3f14 100644 --- a/src/mapserver/qgshostedrdsbuilder.cpp +++ b/src/mapserver/qgshostedrdsbuilder.cpp @@ -33,8 +33,13 @@ QgsHostedRDSBuilder::~QgsHostedRDSBuilder() } -QgsMapLayer* QgsHostedRDSBuilder::createMapLayer( const QDomElement& elem, const QString& layerName, QList& filesToRemove, QList& layersToRemove, bool allowCaching ) const +QgsMapLayer* QgsHostedRDSBuilder::createMapLayer( const QDomElement& elem, + const QString &layerName, + QList &filesToRemove, + QList &layersToRemove, + bool allowCaching ) const { + Q_UNUSED( filesToRemove ); QgsDebugMsg( "entering." ); if ( elem.isNull() ) diff --git a/src/mapserver/qgshostedvdsbuilder.cpp b/src/mapserver/qgshostedvdsbuilder.cpp index f767baccf4b..07ca7b6fc6d 100644 --- a/src/mapserver/qgshostedvdsbuilder.cpp +++ b/src/mapserver/qgshostedvdsbuilder.cpp @@ -32,8 +32,13 @@ QgsHostedVDSBuilder::~QgsHostedVDSBuilder() } -QgsMapLayer* QgsHostedVDSBuilder::createMapLayer( const QDomElement& elem, const QString& layerName, QList& filesToRemove, QList& layersToRemove, bool allowCaching ) const +QgsMapLayer* QgsHostedVDSBuilder::createMapLayer( const QDomElement& elem, + const QString& layerName, + QList &filesToRemove, + QList &layersToRemove, + bool allowCaching ) const { + Q_UNUSED( filesToRemove ); if ( elem.isNull() ) { return 0; diff --git a/src/mapserver/qgsinterpolationlayerbuilder.cpp b/src/mapserver/qgsinterpolationlayerbuilder.cpp index afaddf5d75e..8d816bcd414 100644 --- a/src/mapserver/qgsinterpolationlayerbuilder.cpp +++ b/src/mapserver/qgsinterpolationlayerbuilder.cpp @@ -43,8 +43,14 @@ QgsInterpolationLayerBuilder::~QgsInterpolationLayerBuilder() } -QgsMapLayer* QgsInterpolationLayerBuilder::createMapLayer( const QDomElement& elem, const QString& layerName, QList& filesToRemove, QList& layersToRemove, bool allowCaching ) const +QgsMapLayer* QgsInterpolationLayerBuilder::createMapLayer( const QDomElement &elem, + const QString &layerName, + QList &filesToRemove, + QList &layersToRemove, + bool allowCaching ) const { + Q_UNUSED( layerName ); + Q_UNUSED( allowCaching ); if ( !mVectorLayer ) { return 0; diff --git a/src/mapserver/qgsprojectparser.cpp b/src/mapserver/qgsprojectparser.cpp index ba490777cff..a079a654058 100644 --- a/src/mapserver/qgsprojectparser.cpp +++ b/src/mapserver/qgsprojectparser.cpp @@ -145,22 +145,22 @@ void QgsProjectParser::addLayers( QDomDocument &doc, titleElem.appendChild( titleText ); layerElem.appendChild( titleElem ); - if( currentChildElem.attribute("embedded") == "1" ) + if ( currentChildElem.attribute( "embedded" ) == "1" ) { //add layers from other project files and embed into this group - QString project = convertToAbsolutePath( currentChildElem.attribute("project") ); - QString embeddedGroupName = currentChildElem.attribute("name"); + QString project = convertToAbsolutePath( currentChildElem.attribute( "project" ) ); + QString embeddedGroupName = currentChildElem.attribute( "name" ); QgsProjectParser* p = dynamic_cast( QgsConfigCache::instance()->searchConfiguration( project ) ); - if( p ) + if ( p ) { QStringList pIdDisabled = p->identifyDisabledLayers(); QDomElement embeddedGroupElem; QList pLegendElems = p->legendGroupElements(); QList::const_iterator pLegendIt = pLegendElems.constBegin(); - for(; pLegendIt != pLegendElems.constEnd(); ++pLegendIt ) + for ( ; pLegendIt != pLegendElems.constEnd(); ++pLegendIt ) { - if( pLegendIt->attribute("name") == embeddedGroupName ) + if ( pLegendIt->attribute( "name" ) == embeddedGroupName ) { embeddedGroupElem = *pLegendIt; break; @@ -170,12 +170,12 @@ void QgsProjectParser::addLayers( QDomDocument &doc, QList pLayerElems = p->projectLayerElements(); QMap pLayerMap; QList::const_iterator pLayerIt = pLayerElems.constBegin(); - for(; pLayerIt != pLayerElems.constEnd(); ++pLayerIt ) + for ( ; pLayerIt != pLayerElems.constEnd(); ++pLayerIt ) { pLayerMap.insert( layerId( *pLayerIt ), p->createLayerFromElement( *pLayerIt ) ); } - p->addLayers( doc, layerElem, embeddedGroupElem, pLayerMap, pIdDisabled, mapExtent, mapCRS); + p->addLayers( doc, layerElem, embeddedGroupElem, pLayerMap, pIdDisabled, mapExtent, mapCRS ); } } else //normal (not embedded) legend group @@ -320,6 +320,8 @@ void QgsProjectParser::addLayers( QDomDocument &doc, QList QgsProjectParser::mapLayerFromStyle( const QString& lName, const QString& styleName, bool allowCaching ) const { + Q_UNUSED( styleName ); + Q_UNUSED( allowCaching ); QList layerList; //first assume lName refers to a leaf layer @@ -356,34 +358,34 @@ QList QgsProjectParser::mapLayerFromStyle( const QString& lName, c { if ( groupIt->attribute( "name" ) == lName ) { - if( groupIt->attribute("embedded") == "1") //requested group is embedded from another project + if ( groupIt->attribute( "embedded" ) == "1" ) //requested group is embedded from another project { - QgsProjectParser* p = dynamic_cast(QgsConfigCache::instance()->searchConfiguration( convertToAbsolutePath(groupIt->attribute("project") ) ) ); - if( p ) + QgsProjectParser* p = dynamic_cast( QgsConfigCache::instance()->searchConfiguration( convertToAbsolutePath( groupIt->attribute( "project" ) ) ) ); + if ( p ) { QList pGroupElems = p->legendGroupElements(); QList::const_iterator pGroupIt = pGroupElems.constBegin(); QDomElement embeddedGroupElem; - for(; pGroupIt != pGroupElems.constEnd(); ++pGroupIt ) + for ( ; pGroupIt != pGroupElems.constEnd(); ++pGroupIt ) { - if( pGroupIt->attribute("name") == lName ) + if ( pGroupIt->attribute( "name" ) == lName ) { embeddedGroupElem = *pGroupIt; break; } } - if( !embeddedGroupElem.isNull() ) + if ( !embeddedGroupElem.isNull() ) { //add all the layers under the group QMap< QString, QDomElement > pLayerElems = p->projectLayerElementsById(); - QDomNodeList pLayerNodes = embeddedGroupElem.elementsByTagName("legendlayer"); - for( int i = 0; i < pLayerNodes.size(); ++i ) + QDomNodeList pLayerNodes = embeddedGroupElem.elementsByTagName( "legendlayer" ); + for ( int i = 0; i < pLayerNodes.size(); ++i ) { - QString pLayerId = pLayerNodes.at(i).toElement().firstChildElement("filegroup").firstChildElement("legendlayerfile").attribute("layerid"); + QString pLayerId = pLayerNodes.at( i ).toElement().firstChildElement( "filegroup" ).firstChildElement( "legendlayerfile" ).attribute( "layerid" ); QgsMapLayer* pLayer = p->createLayerFromElement( pLayerElems[pLayerId] ); - if( pLayer ) + if ( pLayer ) { layerList.push_back( pLayer ); } @@ -409,23 +411,23 @@ QList QgsProjectParser::mapLayerFromStyle( const QString& lName, c //maybe the layer is embedded from another project QMap< QString, QDomElement >::const_iterator layerIt = idLayerMap.constBegin(); - for(; layerIt != idLayerMap.constEnd(); ++layerIt ) + for ( ; layerIt != idLayerMap.constEnd(); ++layerIt ) { - if( layerIt.value().attribute("embedded") == "1" ) + if ( layerIt.value().attribute( "embedded" ) == "1" ) { - QString id = layerIt.value().attribute("id"); - QString project = layerIt.value().attribute("project"); + QString id = layerIt.value().attribute( "id" ); + QString project = layerIt.value().attribute( "project" ); //get config parser from cache - QgsProjectParser* otherParser = dynamic_cast(QgsConfigCache::instance()->searchConfiguration( project ) ); - if( otherParser ) + QgsProjectParser* otherParser = dynamic_cast( QgsConfigCache::instance()->searchConfiguration( project ) ); + if ( otherParser ) { //get element by id QMap< QString, QDomElement > otherLayerElems = otherParser->projectLayerElementsById(); QMap< QString, QDomElement >::const_iterator otherLayerIt = otherLayerElems.find( id ); - if( otherLayerIt != otherLayerElems.constEnd() ) + if ( otherLayerIt != otherLayerElems.constEnd() ) { - if( otherLayerIt.value().firstChildElement("layername").text() == lName ) + if ( otherLayerIt.value().firstChildElement( "layername" ).text() == lName ) { layerList.push_back( otherParser->createLayerFromElement( otherLayerIt.value() ) ); return layerList; @@ -437,19 +439,19 @@ QList QgsProjectParser::mapLayerFromStyle( const QString& lName, c //layer still not found. Check if it is a single layer contained in a embedded layer group groupIt = legendGroups.constBegin(); - for(; groupIt != legendGroups.constEnd(); ++groupIt ) + for ( ; groupIt != legendGroups.constEnd(); ++groupIt ) { - if( groupIt->attribute("embedded") == "1") + if ( groupIt->attribute( "embedded" ) == "1" ) { - QgsProjectParser* p = dynamic_cast(QgsConfigCache::instance()->searchConfiguration( convertToAbsolutePath(groupIt->attribute("project") ) ) ); - if( p ) + QgsProjectParser* p = dynamic_cast( QgsConfigCache::instance()->searchConfiguration( convertToAbsolutePath( groupIt->attribute( "project" ) ) ) ); + if ( p ) { QMap< QString, QDomElement > pLayers = p->projectLayerElementsByName(); QMap< QString, QDomElement >::const_iterator pLayerIt = pLayers.find( lName ); - if( pLayerIt != pLayers.constEnd() ) + if ( pLayerIt != pLayers.constEnd() ) { QgsMapLayer* layer = p->createLayerFromElement( pLayerIt.value() ); - if( layer ) + if ( layer ) { layerList.push_back( layer ); return layerList; @@ -487,8 +489,9 @@ int QgsProjectParser::layersAndStyles( QStringList& layers, QStringList& styles QDomDocument QgsProjectParser::getStyle( const QString& styleName, const QString& layerName ) const { - QDomDocument doc; - return doc; //soon... + Q_UNUSED( styleName ); + Q_UNUSED( layerName ); + return QDomDocument(); } QgsMapRenderer::OutputUnits QgsProjectParser::outputUnits() const @@ -884,17 +887,17 @@ QgsMapLayer* QgsProjectParser::createLayerFromElement( const QDomElement& elem ) { layer = new QgsRasterLayer(); } - else if ( elem.attribute("embedded") == "1" ) //layer is embedded from another project file + else if ( elem.attribute( "embedded" ) == "1" ) //layer is embedded from another project file { QgsProjectParser* otherConfig = dynamic_cast( QgsConfigCache::instance()->searchConfiguration( convertToAbsolutePath( elem.attribute( "project" ) ) ) ); - if( !otherConfig ) + if ( !otherConfig ) { return 0; } QMap< QString, QDomElement > layerMap = otherConfig->projectLayerElementsById(); QMap< QString, QDomElement >::const_iterator layerIt = layerMap.find( elem.attribute( "id" ) ); - if( layerIt == layerMap.constEnd() ) + if ( layerIt == layerMap.constEnd() ) { return 0; } diff --git a/src/mapserver/qgsremotedatasourcebuilder.cpp b/src/mapserver/qgsremotedatasourcebuilder.cpp index d25e925e2d7..11884b518f3 100644 --- a/src/mapserver/qgsremotedatasourcebuilder.cpp +++ b/src/mapserver/qgsremotedatasourcebuilder.cpp @@ -54,9 +54,16 @@ QgsMapLayer* QgsRemoteDataSourceBuilder::createMapLayer( const QDomElement& elem return theLayer; } -QgsRasterLayer* QgsRemoteDataSourceBuilder::rasterLayerFromRemoteRDS( const QDomElement& remoteRDSElem, const QString& layerName, QList& filesToRemove, QList& layersToRemove, bool allowCaching ) const +QgsRasterLayer* QgsRemoteDataSourceBuilder::rasterLayerFromRemoteRDS( const QDomElement& remoteRDSElem, + const QString& layerName, + QList &filesToRemove, + QList &layersToRemove, + bool allowCaching ) const { + Q_UNUSED( layerName ); + Q_UNUSED( allowCaching ); QgsDebugMsg( "entering." ); + //load file with QgsHttpTransaction or QgsFtpTransaction QByteArray fileContents; QString uri = remoteRDSElem.text(); @@ -88,8 +95,14 @@ QgsRasterLayer* QgsRemoteDataSourceBuilder::rasterLayerFromRemoteRDS( const QDom return rl; } -QgsVectorLayer* QgsRemoteDataSourceBuilder::vectorLayerFromRemoteVDS( const QDomElement& remoteVDSElem, const QString& layerName, QList& filesToRemove, QList& layersToRemove, bool allowCaching ) const +QgsVectorLayer* QgsRemoteDataSourceBuilder::vectorLayerFromRemoteVDS( const QDomElement& remoteVDSElem, + const QString& layerName, + QList& filesToRemove, + QList& layersToRemove, + bool allowCaching ) const { + Q_UNUSED( layerName ); + Q_UNUSED( allowCaching ); QString providerString; QString formatString = remoteVDSElem.attribute( "format" ); if ( formatString.compare( "gml", Qt::CaseInsensitive ) == 0 ) diff --git a/src/mapserver/qgsremoteowsbuilder.cpp b/src/mapserver/qgsremoteowsbuilder.cpp index 4f911be76e5..5b8e1e1afd3 100644 --- a/src/mapserver/qgsremoteowsbuilder.cpp +++ b/src/mapserver/qgsremoteowsbuilder.cpp @@ -217,8 +217,14 @@ QgsRasterLayer* QgsRemoteOWSBuilder::wmsLayerFromUrl( const QString& url, const return result; } -QgsRasterLayer* QgsRemoteOWSBuilder::wcsLayerFromUrl( const QString& url, const QString& layerName, QList& filesToRemove, QList& layersToRemove, bool allowCaching ) const +QgsRasterLayer* QgsRemoteOWSBuilder::wcsLayerFromUrl( const QString &url, + const QString &layerName, + QList &filesToRemove, + QList &layersToRemove, + bool allowCaching ) const { + Q_UNUSED( layerName ); + Q_UNUSED( allowCaching ); QgsDebugMsg( "Entering" ); //write server url and coverage name to a temporary file diff --git a/src/mapserver/qgssentdatasourcebuilder.cpp b/src/mapserver/qgssentdatasourcebuilder.cpp index c4945e1df5c..d2d81b56a8f 100644 --- a/src/mapserver/qgssentdatasourcebuilder.cpp +++ b/src/mapserver/qgssentdatasourcebuilder.cpp @@ -34,8 +34,14 @@ QgsSentDataSourceBuilder::~QgsSentDataSourceBuilder() } -QgsMapLayer* QgsSentDataSourceBuilder::createMapLayer( const QDomElement& elem, const QString& layerName, QList& filesToRemove, QList& layersToRemove, bool allowCaching ) const +QgsMapLayer* QgsSentDataSourceBuilder::createMapLayer( const QDomElement& elem, + const QString& layerName, + QList& filesToRemove, + QList& layersToRemove, + bool allowCaching ) const { + Q_UNUSED( layerName ); + Q_UNUSED( allowCaching ); if ( elem.tagName() == "SentRDS" ) { return rasterLayerFromSentRDS( elem, filesToRemove, layersToRemove ); diff --git a/src/mapserver/qgssldrenderer.cpp b/src/mapserver/qgssldrenderer.cpp index 80b77652949..043886e4521 100644 --- a/src/mapserver/qgssldrenderer.cpp +++ b/src/mapserver/qgssldrenderer.cpp @@ -47,6 +47,7 @@ void QgsSLDRenderer::addRule( QgsSLDRule* rule ) void QgsSLDRenderer::renderFeature( QgsRenderContext &renderContext, QgsFeature& f, QImage* pic, bool selected, double opacity ) { + Q_UNUSED( opacity ); //find a rule that matches the feature QList::const_iterator rule_it = mRules.constBegin(); for ( ; rule_it != mRules.constEnd(); ++rule_it ) @@ -108,6 +109,7 @@ const QList QgsSLDRenderer::symbols() const void QgsSLDRenderer::refreshLegend( std::list< std::pair >* symbologyList ) const { + Q_UNUSED( symbologyList ); //soon... } diff --git a/src/mapserver/qgssldrenderer.h b/src/mapserver/qgssldrenderer.h index 3bdc010e726..3d3f2865009 100644 --- a/src/mapserver/qgssldrenderer.h +++ b/src/mapserver/qgssldrenderer.h @@ -36,9 +36,11 @@ class QgsSLDRenderer: public QgsRenderer /**Traverses the rule list until a suitable entry is found. If no rule matches, Qt::NoPen and Qt::NoBrush are set*/ void renderFeature( QgsRenderContext &renderContext, QgsFeature& f, QImage* pic, bool selected, double opacity ); /**This method is not needed because QgsSLDRenderer is not meant to provide reading from/ storing to project file*/ - int readXML( const QDomNode& rnode, QgsVectorLayer& vl ) {return 1;} + int readXML( const QDomNode& rnode, QgsVectorLayer& vl ) + { Q_UNUSED( rnode ); Q_UNUSED( vl ); return 1; } /**This method is not needed because QgsSLDRenderer is not meant to provide reading from/ storing to project file*/ - bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const {return false;} + bool writeXML( QDomNode & layer_node, QDomDocument & document, const QgsVectorLayer& vl ) const + { Q_UNUSED( layer_node ); Q_UNUSED( document ); Q_UNUSED( vl ); return false; } /**Has to be decided at runtime depending upon mComparisonOperators and mClassificationFields*/ bool needsAttributes() const; QgsAttributeList classificationAttributes() const; diff --git a/src/mapserver/qgssldrule.cpp b/src/mapserver/qgssldrule.cpp index 9ad9a43dc14..5d73798abce 100644 --- a/src/mapserver/qgssldrule.cpp +++ b/src/mapserver/qgssldrule.cpp @@ -29,9 +29,12 @@ #include #include -QgsSLDRule::QgsSLDRule( double minDenom, double maxDenom, const QgsSymbol& s, const QgsFilter* f ): mSymbol( s ), mMinScaleDenominator( minDenom ), mMaxScaleDenominator( maxDenom ) +QgsSLDRule::QgsSLDRule( double minDenom, double maxDenom, const QgsSymbol& s, const QgsFilter* f ) + : mSymbol( s ) + , mMinScaleDenominator( minDenom ) + , mMaxScaleDenominator( maxDenom ) { - + Q_UNUSED( f ); } QgsSLDRule::~QgsSLDRule() diff --git a/src/mapserver/qgssoaprequesthandler.cpp b/src/mapserver/qgssoaprequesthandler.cpp index 0207b905a62..cd457847bae 100644 --- a/src/mapserver/qgssoaprequesthandler.cpp +++ b/src/mapserver/qgssoaprequesthandler.cpp @@ -284,7 +284,7 @@ void QgsSOAPRequestHandler::sendGetCapabilitiesResponse( const QDomDocument& doc if ( !externCapDoc.setContent( &common, false, &parseError, &errorLineNo ) ) { QgsDebugMsg( "parse error at setting content of external orchestra common capabilities: " - + parseError + " at line " + QString::number( errorLineNo ) ); + + parseError + " at line " + QString::number( errorLineNo ) ); common.close(); } common.close(); @@ -358,7 +358,7 @@ void QgsSOAPRequestHandler::sendGetCapabilitiesResponse( const QDomDocument& doc if ( !externServiceDoc.setContent( &wmsService, false, &parseError, &errorLineNo ) ) { QgsDebugMsg( "parse error at setting content of external wms service capabilities: " - + parseError + " at line " + QString::number( errorLineNo ) ); + + parseError + " at line " + QString::number( errorLineNo ) ); wmsService.close(); } wmsService.close(); @@ -405,7 +405,7 @@ void QgsSOAPRequestHandler::sendGetCapabilitiesResponse( const QDomDocument& doc if ( !externCapDoc.setContent( &common, false, &parseError, &errorLineNo ) ) { QgsDebugMsg( "parse error at setting content of external orchestra common capabilities: " - + parseError + " at line " + QString::number( errorLineNo ) ); + + parseError + " at line " + QString::number( errorLineNo ) ); common.close(); } common.close(); @@ -424,6 +424,7 @@ void QgsSOAPRequestHandler::sendGetCapabilitiesResponse( const QDomDocument& doc void QgsSOAPRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoDoc, const QString& infoFormat ) const { + Q_UNUSED( infoFormat ); QDomDocument featureInfoResponseDoc; //Envelope @@ -466,6 +467,7 @@ void QgsSOAPRequestHandler::sendGetStyleResponse( const QDomDocument& infoDoc ) void QgsSOAPRequestHandler::sendGetPrintResponse( QByteArray* ba ) const { + Q_UNUSED( ba ); //soon... } diff --git a/src/mapserver/qgswmsserver.cpp b/src/mapserver/qgswmsserver.cpp index 2e976483d9f..9acaf16a7a3 100644 --- a/src/mapserver/qgswmsserver.cpp +++ b/src/mapserver/qgswmsserver.cpp @@ -740,9 +740,9 @@ QImage* QgsWMSServer::initializeRendering( QStringList& layersList, QStringList& //create objects for qgis rendering layerIdList.clear(); - QgsDebugMsg( "Layers to render" ); + QgsDebugMsg( "Layers to render" ); QString myLayer; - foreach ( myLayer, layerIdList) + foreach( myLayer, layerIdList ) { QgsDebugMsg( myLayer ); } @@ -1095,7 +1095,7 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer, } QDomElement featureElement = infoDocument.createElement( "Feature" ); - featureElement.setAttribute( "id", QString::number( feature.id() ) ); + featureElement.setAttribute( "id", FID_TO_STRING( feature.id() ) ); layerElement.appendChild( featureElement ); //read all attribute values from the feature @@ -1165,10 +1165,11 @@ int QgsWMSServer::featureInfoFromRasterLayer( QgsRasterLayer* layer, return 0; } -QStringList QgsWMSServer::layerSet( const QStringList& layersList, - const QStringList& stylesList, - const QgsCoordinateReferenceSystem& destCRS ) const +QStringList QgsWMSServer::layerSet( const QStringList &layersList, + const QStringList &stylesList, + const QgsCoordinateReferenceSystem &destCRS ) const { + Q_UNUSED( destCRS ); QStringList layerKeys; QStringList::const_iterator llstIt; QStringList::const_iterator slstIt; @@ -1200,7 +1201,7 @@ QStringList QgsWMSServer::layerSet( const QStringList& layersList, for ( listIndex = layerList.size() - 1; listIndex >= 0; listIndex-- ) { theMapLayer = layerList.at( listIndex ); - QgsDebugMsg( QString( "Checking layer: %1").arg( theMapLayer->name() ) ); + QgsDebugMsg( QString( "Checking layer: %1" ).arg( theMapLayer->name() ) ); if ( theMapLayer ) { layerKeys.push_front( theMapLayer->id() ); @@ -1543,7 +1544,7 @@ QMap QgsWMSServer::applyRequestedLayerFilters( const QStringLi QgsVectorLayer* filteredLayer = dynamic_cast( QgsMapLayerRegistry::instance()->mapLayer( layerId ) ); if ( filteredLayer ) { - if( filteredLayer ) + if ( filteredLayer ) { filterMap.insert( layerId, filteredLayer->subsetString() ); QString newSubsetString = eqSplit.at( 1 ); @@ -1562,20 +1563,20 @@ QMap QgsWMSServer::applyRequestedLayerFilters( const QStringLi //No BBOX parameter in request. We use the union of the filtered layer //to provide the functionality of zooming to selected records via (enhanced) WMS. - if( mMapRenderer && mMapRenderer->extent().isEmpty() ) + if ( mMapRenderer && mMapRenderer->extent().isEmpty() ) { QgsRectangle filterExtent; QMap::const_iterator filterIt = filterMap.constBegin(); - for(; filterIt != filterMap.constEnd(); ++filterIt ) + for ( ; filterIt != filterMap.constEnd(); ++filterIt ) { QgsMapLayer* mapLayer = QgsMapLayerRegistry::instance()->mapLayer( filterIt.key() ); - if( !mapLayer ) + if ( !mapLayer ) { continue; } QgsRectangle layerExtent = mapLayer->extent(); - if( filterExtent.isEmpty() ) + if ( filterExtent.isEmpty() ) { filterExtent = layerExtent; } diff --git a/src/plugins/coordinate_capture/coordinatecapture.cpp b/src/plugins/coordinate_capture/coordinatecapture.cpp index cc43bfb109a..ebdc0cd02be 100644 --- a/src/plugins/coordinate_capture/coordinatecapture.cpp +++ b/src/plugins/coordinate_capture/coordinatecapture.cpp @@ -264,6 +264,7 @@ void CoordinateCapture::unload() // Set icons to the current theme void CoordinateCapture::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); mQActionPointer->setIcon( QIcon( getIconPath( "coordinate_capture.png" ) ) ); mpTrackMouseButton->setIcon( QIcon( getIconPath( "tracking.png" ) ) ); mpCaptureButton->setIcon( QIcon( getIconPath( "coordinate_capture.png" ) ) ); diff --git a/src/plugins/coordinate_capture/coordinatecapturemaptool.cpp b/src/plugins/coordinate_capture/coordinatecapturemaptool.cpp index 6901d84f4cf..b49d86b34ec 100644 --- a/src/plugins/coordinate_capture/coordinatecapturemaptool.cpp +++ b/src/plugins/coordinate_capture/coordinatecapturemaptool.cpp @@ -53,6 +53,7 @@ void CoordinateCaptureMapTool::canvasMoveEvent( QMouseEvent * thepEvent ) void CoordinateCaptureMapTool::canvasPressEvent( QMouseEvent * thepEvent ) { + Q_UNUSED( thepEvent ); } void CoordinateCaptureMapTool::canvasReleaseEvent( QMouseEvent * thepEvent ) diff --git a/src/plugins/copyright_label/plugin.cpp b/src/plugins/copyright_label/plugin.cpp index 6363300d860..1bd89271ebb 100644 --- a/src/plugins/copyright_label/plugin.cpp +++ b/src/plugins/copyright_label/plugin.cpp @@ -259,6 +259,7 @@ void QgsCopyrightLabelPlugin::setEnable( bool theBool ) //! Set icons to the current theme void QgsCopyrightLabelPlugin::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/copyright_label.png"; QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/copyright_label.png"; QString myQrcPath = ":/copyright_label.png"; diff --git a/src/plugins/delimited_text/qgsdelimitedtextplugin.cpp b/src/plugins/delimited_text/qgsdelimitedtextplugin.cpp index ef3368fe19a..4eb8a9768f2 100644 --- a/src/plugins/delimited_text/qgsdelimitedtextplugin.cpp +++ b/src/plugins/delimited_text/qgsdelimitedtextplugin.cpp @@ -150,6 +150,7 @@ void QgsDelimitedTextPlugin::unload() //! Set icons to the current theme void QgsDelimitedTextPlugin::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/delimited_text.png"; QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/delimited_text.png"; QString myQrcPath = ":/delimited_text.png"; diff --git a/src/plugins/diagram_overlay/qgsbardiagramfactory.h b/src/plugins/diagram_overlay/qgsbardiagramfactory.h index 5ee2ced6e3d..f13105d3c3b 100644 --- a/src/plugins/diagram_overlay/qgsbardiagramfactory.h +++ b/src/plugins/diagram_overlay/qgsbardiagramfactory.h @@ -31,7 +31,8 @@ class QgsBarDiagramFactory: public QgsWKNDiagramFactory QImage* createDiagram( int size, const QgsFeature& f, const QgsRenderContext& renderContext ) const; /**Creates items to show in the legend*/ - int createLegendContent( int size, const QgsRenderContext& renderContext, QString value, QMap& items ) const {return 1;} //soon + int createLegendContent( int size, const QgsRenderContext& renderContext, QString value, QMap& items ) const + { Q_UNUSED( size ); Q_UNUSED( renderContext ); Q_UNUSED( value ); Q_UNUSED( items ); return 1; } //soon /**Gets the width and height (in pixels) of the diagram image. Considers different width, height values, the maximum width of the drawing pen and the conversion from mm size to pixels according to render context. @param size diagram size calculated by diagram renderer (in mm) diff --git a/src/plugins/diagram_overlay/qgsdiagramfactory.cpp b/src/plugins/diagram_overlay/qgsdiagramfactory.cpp index bbc1a99f1f9..418c1de2f9f 100644 --- a/src/plugins/diagram_overlay/qgsdiagramfactory.cpp +++ b/src/plugins/diagram_overlay/qgsdiagramfactory.cpp @@ -51,6 +51,7 @@ double QgsDiagramFactory::diagramSizeScaleFactor( const QgsRenderContext& contex bool QgsDiagramFactory::writeSizeUnits( QDomElement& factoryElem, QDomDocument& doc ) const { + Q_UNUSED( doc ); if ( factoryElem.isNull() ) { return false; diff --git a/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp b/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp index 4ad2638f6c4..a6c909422ae 100644 --- a/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp +++ b/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp @@ -44,7 +44,7 @@ QgsDiagramOverlay::QgsDiagramOverlay( QgsVectorLayer* vl ): QgsVectorOverlay( vl QgsDiagramOverlay::~QgsDiagramOverlay() { //memory cleanup - for ( QMap::iterator it = mOverlayObjects.begin(); it != mOverlayObjects.end(); ++it ) + for ( QMap::iterator it = mOverlayObjects.begin(); it != mOverlayObjects.end(); ++it ) { delete it.value(); } @@ -70,7 +70,7 @@ void QgsDiagramOverlay::createOverlayObjects( const QgsRenderContext& renderCont } //memory cleanup - for ( QMap::iterator it = mOverlayObjects.begin(); it != mOverlayObjects.end(); ++it ) + for ( QMap::iterator it = mOverlayObjects.begin(); it != mOverlayObjects.end(); ++it ) { delete it.value(); } @@ -145,7 +145,7 @@ void QgsDiagramOverlay::drawOverlayObjects( QgsRenderContext& context ) const continue; } //search for overlay object in the map - QMap::const_iterator it = mOverlayObjects.find( currentFeature.id() ); + QMap::const_iterator it = mOverlayObjects.find( currentFeature.id() ); if ( it != mOverlayObjects.constEnd() ) { if ( it.value() ) @@ -180,6 +180,7 @@ void QgsDiagramOverlay::drawOverlayObjects( QgsRenderContext& context ) const int QgsDiagramOverlay::getOverlayObjectSize( int& width, int& height, double value, const QgsFeature& f, const QgsRenderContext& renderContext ) const { + Q_UNUSED( value ); return mDiagramRenderer->getDiagramDimensions( width, height, f, renderContext ); } @@ -332,6 +333,7 @@ bool QgsDiagramOverlay::writeXML( QDomNode& layer_node, QDomDocument& doc ) cons int QgsDiagramOverlay::createLegendContent( std::list >& content ) const { + Q_UNUSED( content ); #if 0 //first make sure the list is clean std::list >::iterator it; diff --git a/src/plugins/diagram_overlay/qgsdiagramrendererwidget.h b/src/plugins/diagram_overlay/qgsdiagramrendererwidget.h index 4a27efe303d..6463c484418 100644 --- a/src/plugins/diagram_overlay/qgsdiagramrendererwidget.h +++ b/src/plugins/diagram_overlay/qgsdiagramrendererwidget.h @@ -41,9 +41,9 @@ class QgsDiagramRendererWidget: public QWidget /**Applies the settings of an existing renderer*/ virtual void applySettings( const QgsDiagramRenderer* renderer ) = 0; /**Possibility to adapt the dialog to a new field*/ - virtual void changeClassificationField( int newField ) {} + virtual void changeClassificationField( int newField ) { Q_UNUSED( newField ); } - virtual QgsDiagramFactory::SizeUnit sizeUnit() const {return QgsDiagramFactory::MM;} + virtual QgsDiagramFactory::SizeUnit sizeUnit() const { return QgsDiagramFactory::MM; } private: QgsDiagramRendererWidget(); diff --git a/src/plugins/diagram_overlay/qgslinearlyscalingdialog.cpp b/src/plugins/diagram_overlay/qgslinearlyscalingdialog.cpp index d7ab7508b8c..24436ace858 100644 --- a/src/plugins/diagram_overlay/qgslinearlyscalingdialog.cpp +++ b/src/plugins/diagram_overlay/qgslinearlyscalingdialog.cpp @@ -36,6 +36,7 @@ QgsLinearlyScalingDialog::~QgsLinearlyScalingDialog() QgsDiagramRenderer* QgsLinearlyScalingDialog::createRenderer( int classAttr, const QgsAttributeList& attributes ) const { + Q_UNUSED( attributes ); //create a linearly scaling renderer QList attributesList; attributesList.push_back( classAttr ); diff --git a/src/plugins/diagram_overlay/qgspiediagramfactory.cpp b/src/plugins/diagram_overlay/qgspiediagramfactory.cpp index 7119949f5b4..5360a35ff9f 100644 --- a/src/plugins/diagram_overlay/qgspiediagramfactory.cpp +++ b/src/plugins/diagram_overlay/qgspiediagramfactory.cpp @@ -100,6 +100,7 @@ QImage* QgsPieDiagramFactory::createDiagram( int size, const QgsFeature& f, cons int QgsPieDiagramFactory::getDiagramDimensions( int size, const QgsFeature& f, const QgsRenderContext& context, int& width, int& height ) const { + Q_UNUSED( f ); double squareSide = size * diagramSizeScaleFactor( context ) * context.rasterScaleFactor() + 2 * mMaximumPenWidth + 2 * mMaximumGap; width = squareSide; height = squareSide; diff --git a/src/plugins/diagram_overlay/qgspiediagramfactory.h b/src/plugins/diagram_overlay/qgspiediagramfactory.h index a462a5f3c07..4fe8b19a874 100644 --- a/src/plugins/diagram_overlay/qgspiediagramfactory.h +++ b/src/plugins/diagram_overlay/qgspiediagramfactory.h @@ -34,7 +34,8 @@ class QgsPieDiagramFactory: public QgsWKNDiagramFactory QImage* createDiagram( int size, const QgsFeature& f, const QgsRenderContext& renderContext ) const; /**Creates items to show in the legend*/ - int createLegendContent( int size, const QgsRenderContext& renderContext, QString value, QMap& items ) const {return 1;} //soon + int createLegendContent( int size, const QgsRenderContext& renderContext, QString value, QMap& items ) const + { Q_UNUSED( size ); Q_UNUSED( renderContext ); Q_UNUSED( value ); Q_UNUSED( items ); return 1; } //soon /**Gets the width and height (in pixels) of the diagram image. Considers different width, height values, the maximum width of the drawing pen and the conversion from mm size to pixels according to render context. @param size diagram size calculated by diagram renderer (in mm) diff --git a/src/plugins/diagram_overlay/qgssvgdiagramfactory.cpp b/src/plugins/diagram_overlay/qgssvgdiagramfactory.cpp index 170d80310db..52a5ac045d7 100644 --- a/src/plugins/diagram_overlay/qgssvgdiagramfactory.cpp +++ b/src/plugins/diagram_overlay/qgssvgdiagramfactory.cpp @@ -33,6 +33,7 @@ QgsSVGDiagramFactory::~QgsSVGDiagramFactory() QImage* QgsSVGDiagramFactory::createDiagram( int size, const QgsFeature& f, const QgsRenderContext& renderContext ) const { + Q_UNUSED( f ); //check default size QSize defaultSize = mRenderer.defaultSize(); qreal scaleFactor; @@ -67,6 +68,7 @@ QImage* QgsSVGDiagramFactory::createDiagram( int size, const QgsFeature& f, cons int QgsSVGDiagramFactory::getDiagramDimensions( int size, const QgsFeature& f, const QgsRenderContext& context, int& width, int& height ) const { + Q_UNUSED( f ); double scaleFactor; QSize defaultSize = mRenderer.defaultSize(); //size parameter applies to maximum of width, height diff --git a/src/plugins/diagram_overlay/qgssvgdiagramfactory.h b/src/plugins/diagram_overlay/qgssvgdiagramfactory.h index 426966bdba5..7368d6170b9 100644 --- a/src/plugins/diagram_overlay/qgssvgdiagramfactory.h +++ b/src/plugins/diagram_overlay/qgssvgdiagramfactory.h @@ -39,7 +39,8 @@ class QgsSVGDiagramFactory: public QgsDiagramFactory @param value diagram value that should be represented in the legend @param items generated items @return 0 in case of success*/ - int createLegendContent( int size, const QgsRenderContext& renderContext, QString value, QMap& items ) const {return 1;} //later... + int createLegendContent( int size, const QgsRenderContext& renderContext, QString value, QMap& items ) const + { Q_UNUSED( size ); Q_UNUSED( renderContext ); Q_UNUSED( value ); Q_UNUSED( items ); return 1; } //later... /**Gets the width and height (in pixels) of the diagram image. Considers different width, height values, the maximum width of the drawing pen and the conversion from mm size to pixels according to render context. @param size diagram size calculated by diagram renderer diff --git a/src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp b/src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp index 6a44778715e..ccd5376cc37 100644 --- a/src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp +++ b/src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp @@ -119,6 +119,7 @@ void QgsSVGDiagramFactoryWidget::on_mPictureBrowseButton_clicked() void QgsSVGDiagramFactoryWidget::on_mPreviewListWidget_currentItemChanged( QListWidgetItem* current, QListWidgetItem* previous ) { + Q_UNUSED( previous ); if ( !current ) { return; diff --git a/src/plugins/diagram_overlay/qgswkndiagramfactory.h b/src/plugins/diagram_overlay/qgswkndiagramfactory.h index 9c6e3c6fbfc..009c9bb765d 100644 --- a/src/plugins/diagram_overlay/qgswkndiagramfactory.h +++ b/src/plugins/diagram_overlay/qgswkndiagramfactory.h @@ -42,7 +42,8 @@ class QgsWKNDiagramFactory: public QgsDiagramFactory /**Writes the wkn diagram information into a tag*/ bool writeXML( QDomNode& overlay_node, QDomDocument& doc ) const; /**Possibility for wkn subclasses to write specific information into the XML document*/ - virtual bool _writeXML( QDomNode& factory_node, QDomDocument& doc ) const {return true;} + virtual bool _writeXML( QDomNode& factory_node, QDomDocument& doc ) const + { Q_UNUSED( factory_node ); Q_UNUSED( doc ); return true; } /**Returns the property described by the size (e.g. diameter or height). This can be important to know if e.g. size has to be calculated proportional to pie area*/ virtual QgsDiagramFactory::SizeType sizeType() const = 0; diff --git a/src/plugins/dxf2shp_converter/builder.cpp b/src/plugins/dxf2shp_converter/builder.cpp index a090b2ca029..318616900fe 100644 --- a/src/plugins/dxf2shp_converter/builder.cpp +++ b/src/plugins/dxf2shp_converter/builder.cpp @@ -108,6 +108,7 @@ void Builder::endBlock() void Builder::addLayer( const DL_LayerData& data ) { + Q_UNUSED( data ); QgsDebugMsg( QString( "Layer: %1" ).arg( data.name.c_str() ) ); } diff --git a/src/plugins/dxf2shp_converter/dxf2shpconverter.cpp b/src/plugins/dxf2shp_converter/dxf2shpconverter.cpp index 896a4007be1..1750e21bd4e 100644 --- a/src/plugins/dxf2shp_converter/dxf2shpconverter.cpp +++ b/src/plugins/dxf2shp_converter/dxf2shpconverter.cpp @@ -124,6 +124,7 @@ void dxf2shpConverter::addMyLayer( QString myfname, QString mytitle ) //! Set icons to the current theme void dxf2shpConverter::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/dxf2shp_converter.png"; QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/dxf2shp_converter.png"; QString myQrcPath = ":/dxf2shp_converter.png"; diff --git a/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp b/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp index e54cb208746..e9194caa2ad 100644 --- a/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp +++ b/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp @@ -150,6 +150,7 @@ void eVisDatabaseConnectionGui::on_buttonBox_accepted( ) */ void eVisDatabaseConnectionGui::on_cboxDatabaseType_currentIndexChanged( int currentIndex ) { + Q_UNUSED( currentIndex ); if ( cboxDatabaseType->currentText( ) == "MYSQL" ) { lblDatabaseHost->setEnabled( true ); diff --git a/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp b/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp index 80c4424baa0..fc3a86361dc 100644 --- a/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp +++ b/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp @@ -258,14 +258,14 @@ bool eVisGenericEventBrowserGui::initBrowser( ) if ( 0 == mVectorLayer->selectedFeatureCount( ) ) //if nothing is selected select everything { mVectorLayer->invertSelection(); - mFeatureIds = mVectorLayer->selectedFeaturesIds( ).toList( ); + mFeatureIds = mVectorLayer->selectedFeaturesIds().toList(); } else //use selected features { - mFeatureIds = mVectorLayer->selectedFeaturesIds( ).toList( ); + mFeatureIds = mVectorLayer->selectedFeaturesIds().toList(); } - if ( 0 == mFeatureIds.size( ) ) + if ( 0 == mFeatureIds.size() ) return false; //get the first feature in the list so we can set the field in the pulldown menues @@ -556,7 +556,7 @@ void eVisGenericEventBrowserGui::displayImage( ) * Returns a pointer to the reqested feature with a given featureid * @param id - FeatureId of the feature to find/select */ -QgsFeature* eVisGenericEventBrowserGui::featureAtId( int id ) +QgsFeature* eVisGenericEventBrowserGui::featureAtId( QgsFeatureId id ) { //This method was originally necessary because delimited text data provider did not support featureAtId( ) //It has mostly been stripped down now @@ -820,6 +820,7 @@ void eVisGenericEventBrowserGui::on_buttonboxOptions_clicked( QAbstractButton* t */ void eVisGenericEventBrowserGui::on_chkboxApplyPathRulesToDocs_stateChanged( int theState ) { + Q_UNUSED( theState ); mConfiguration.setApplyPathRulesToDocs( chkboxApplyPathRulesToDocs->isChecked( ) ); } @@ -829,6 +830,7 @@ void eVisGenericEventBrowserGui::on_chkboxApplyPathRulesToDocs_stateChanged( int */ void eVisGenericEventBrowserGui::on_cboxEventImagePathField_currentIndexChanged( int theIndex ) { + Q_UNUSED( theIndex ); if ( !mIgnoreEvent ) { mConfiguration.setEventImagePathField( cboxEventImagePathField->currentText( ) ); @@ -856,6 +858,7 @@ void eVisGenericEventBrowserGui::on_cboxEventImagePathField_currentIndexChanged( */ void eVisGenericEventBrowserGui::on_cboxCompassBearingField_currentIndexChanged( int theIndex ) { + Q_UNUSED( theIndex ); if ( !mIgnoreEvent ) { mConfiguration.setCompassBearingField( cboxCompassBearingField->currentText( ) ); @@ -883,6 +886,7 @@ void eVisGenericEventBrowserGui::on_cboxCompassBearingField_currentIndexChanged( */ void eVisGenericEventBrowserGui::on_cboxCompassOffsetField_currentIndexChanged( int theIndex ) { + Q_UNUSED( theIndex ); if ( !mIgnoreEvent ) { mConfiguration.setCompassOffsetField( cboxCompassOffsetField->currentText( ) ); @@ -910,6 +914,7 @@ void eVisGenericEventBrowserGui::on_cboxCompassOffsetField_currentIndexChanged( */ void eVisGenericEventBrowserGui::on_chkboxDisplayCompassBearing_stateChanged( int theState ) { + Q_UNUSED( theState ); mConfiguration.setDisplayCompassBearing( chkboxDisplayCompassBearing->isChecked( ) ); cboxCompassBearingField->setEnabled( chkboxDisplayCompassBearing->isChecked( ) ); } @@ -920,6 +925,7 @@ void eVisGenericEventBrowserGui::on_chkboxDisplayCompassBearing_stateChanged( in */ void eVisGenericEventBrowserGui::on_chkboxEventImagePathRelative_stateChanged( int theState ) { + Q_UNUSED( theState ); mConfiguration.setEventImagePathRelative( chkboxEventImagePathRelative->isChecked( ) ); if ( chkboxEventImagePathRelative->isChecked( ) && "" == leBasePath->text( ) ) @@ -935,6 +941,7 @@ void eVisGenericEventBrowserGui::on_chkboxEventImagePathRelative_stateChanged( i */ void eVisGenericEventBrowserGui::on_chkboxUseOnlyFilename_stateChanged( int theState ) { + Q_UNUSED( theState ); mConfiguration.setUseOnlyFilename( chkboxUseOnlyFilename->isChecked( ) ); } diff --git a/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.h b/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.h index 9aa628fdf21..af20ad9609d 100644 --- a/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.h +++ b/src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.h @@ -116,7 +116,7 @@ class eVisGenericEventBrowserGui : public QDialog, private Ui::eVisGenericEventB QString mEventImagePath; /** \brief List of current select featured ids*/ - QList mFeatureIds; + QList mFeatureIds; /** \brief Index of selected feature being viewed, used to access mFeatureIds */ int mCurrentFeatureIndex; @@ -135,7 +135,7 @@ class eVisGenericEventBrowserGui : public QDialog, private Ui::eVisGenericEventB void displayImage( ); /** \brief Generic method to get a feature by id. Access mLocalFeatureList when layer is of type delimitedtext otherwise calls existing methods in mDataProvider */ - QgsFeature* featureAtId( int ); + QgsFeature* featureAtId( QgsFeatureId ); /** \brief Functionality common to both constructors */ bool initBrowser( ); diff --git a/src/plugins/georeferencer/qgsgcpcanvasitem.cpp b/src/plugins/georeferencer/qgsgcpcanvasitem.cpp index d0e8a5150cf..e36743a49a1 100644 --- a/src/plugins/georeferencer/qgsgcpcanvasitem.cpp +++ b/src/plugins/georeferencer/qgsgcpcanvasitem.cpp @@ -162,6 +162,7 @@ void QgsGCPCanvasItem::updatePosition() void QgsGCPCanvasItem::drawResidualArrow( QPainter* p, const QgsRenderContext& context ) { + Q_UNUSED( context ); if ( !mDataPoint || !mIsGCPSource || !mMapCanvas ) { return; diff --git a/src/plugins/georeferencer/qgsgcplist.cpp b/src/plugins/georeferencer/qgsgcplist.cpp index 35904b8b537..eaf99062b7e 100644 --- a/src/plugins/georeferencer/qgsgcplist.cpp +++ b/src/plugins/georeferencer/qgsgcplist.cpp @@ -24,6 +24,7 @@ QgsGCPList::QgsGCPList() } QgsGCPList::QgsGCPList( const QgsGCPList &list ) + : QList() { clear(); QgsGCPList::const_iterator it = list.constBegin(); diff --git a/src/plugins/georeferencer/qgsgeorefdatapoint.cpp b/src/plugins/georeferencer/qgsgeorefdatapoint.cpp index a1e1129153c..4d79e782c80 100644 --- a/src/plugins/georeferencer/qgsgeorefdatapoint.cpp +++ b/src/plugins/georeferencer/qgsgeorefdatapoint.cpp @@ -39,7 +39,9 @@ QgsGeorefDataPoint::QgsGeorefDataPoint( QgsMapCanvas* srcCanvas, QgsMapCanvas *d } QgsGeorefDataPoint::QgsGeorefDataPoint( const QgsGeorefDataPoint &p ) + : QObject() { + Q_UNUSED( p ); // we share item representation on canvas between all points // mGCPSourceItem = new QgsGCPCanvasItem(p.srcCanvas(), p.pixelCoords(), p.mapCoords(), p.isEnabled()); // mGCPDestinationItem = new QgsGCPCanvasItem(p.dstCanvas(), p.pixelCoords(), p.mapCoords(), p.isEnabled()); diff --git a/src/plugins/georeferencer/qgsgeorefplugingui.cpp b/src/plugins/georeferencer/qgsgeorefplugingui.cpp index 558ad61ed77..c6bc1924be9 100644 --- a/src/plugins/georeferencer/qgsgeorefplugingui.cpp +++ b/src/plugins/georeferencer/qgsgeorefplugingui.cpp @@ -535,6 +535,7 @@ void QgsGeorefPluginGui::movePoint( const QPoint &p ) void QgsGeorefPluginGui::releasePoint( const QPoint &p ) { + Q_UNUSED( p ); // Get Map Sender if ( sender() == mToolMovePoint ) { @@ -1342,6 +1343,7 @@ bool QgsGeorefPluginGui::calculateMeanError( double& error ) const bool QgsGeorefPluginGui::writePDFMapFile( const QString& fileName, const QgsGeorefTransform& transform ) { + Q_UNUSED( transform ); if ( !mCanvas ) { return false; diff --git a/src/plugins/georeferencer/qgsgeoreftransform.cpp b/src/plugins/georeferencer/qgsgeoreftransform.cpp index 05bc0123212..a643fb67f69 100644 --- a/src/plugins/georeferencer/qgsgeoreftransform.cpp +++ b/src/plugins/georeferencer/qgsgeoreftransform.cpp @@ -352,6 +352,7 @@ uint QgsLinearGeorefTransform::getMinimumGCPCount() const int QgsLinearGeorefTransform::linear_transform( void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess ) { + Q_UNUSED( z ); LinearParameters* t = static_cast( pTransformerArg ); if ( t == NULL ) { @@ -426,6 +427,7 @@ bool QgsHelmertGeorefTransform::getOriginScaleRotation( QgsPoint &origin, double int QgsHelmertGeorefTransform::helmert_transform( void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess ) { + Q_UNUSED( z ); HelmertParameters* t = static_cast( pTransformerArg ); if ( t == NULL ) { @@ -615,6 +617,7 @@ uint QgsProjectiveGeorefTransform::getMinimumGCPCount() const int QgsProjectiveGeorefTransform::projective_transform( void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess ) { + Q_UNUSED( z ); ProjectiveParameters* t = static_cast( pTransformerArg ); if ( t == NULL ) { diff --git a/src/plugins/georeferencer/qgsimagewarper.cpp b/src/plugins/georeferencer/qgsimagewarper.cpp index ee0664f55a2..9bed1c1f9fa 100644 --- a/src/plugins/georeferencer/qgsimagewarper.cpp +++ b/src/plugins/georeferencer/qgsimagewarper.cpp @@ -202,7 +202,7 @@ int QgsImageWarper::warpFile( const QString& input, // Asserts are bad as they just crash out, changed to just return false. TS if ( adfGeoTransform[0] <= 0.0 || adfGeoTransform[5] >= 0.0 ) { - QgsDebugMsg("Image is not north up after GDALSuggestedWarpOutput, bailing out."); + QgsDebugMsg( "Image is not north up after GDALSuggestedWarpOutput, bailing out." ); return false; } // Find suggested output image extent (in georeferenced units) @@ -346,6 +346,7 @@ void *QgsImageWarper::createWarpProgressArg( QProgressDialog *progressDialog ) c int CPL_STDCALL QgsImageWarper::updateWarpProgress( double dfComplete, const char *pszMessage, void *pProgressArg ) { + Q_UNUSED( pszMessage ); QProgressDialog *progress = static_cast( pProgressArg ); progress->setValue( qMin( 100u, ( uint )( dfComplete*100.0 ) ) ); qApp->processEvents(); diff --git a/src/plugins/georeferencer/qgsresidualplotitem.cpp b/src/plugins/georeferencer/qgsresidualplotitem.cpp index 5dcabd0f054..a03c16f7a43 100644 --- a/src/plugins/georeferencer/qgsresidualplotitem.cpp +++ b/src/plugins/georeferencer/qgsresidualplotitem.cpp @@ -31,6 +31,8 @@ QgsResidualPlotItem::~QgsResidualPlotItem() void QgsResidualPlotItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { + Q_UNUSED( itemStyle ); + Q_UNUSED( pWidget ); if ( mGCPList.size() < 1 || !painter ) { return; @@ -209,11 +211,15 @@ double QgsResidualPlotItem::maxMMToPixelRatioForGCP( const QgsGeorefDataPoint* p bool QgsResidualPlotItem::writeXML( QDomElement& elem, QDomDocument & doc ) const { + Q_UNUSED( elem ); + Q_UNUSED( doc ); return false; } bool QgsResidualPlotItem::readXML( const QDomElement& itemElem, const QDomDocument& doc ) { + Q_UNUSED( itemElem ); + Q_UNUSED( doc ); return false; } diff --git a/src/plugins/gps_importer/qgsbabelformat.cpp b/src/plugins/gps_importer/qgsbabelformat.cpp index a4dbd2fe570..3493abebf7b 100644 --- a/src/plugins/gps_importer/qgsbabelformat.cpp +++ b/src/plugins/gps_importer/qgsbabelformat.cpp @@ -41,8 +41,11 @@ QStringList QgsBabelFormat::importCommand( const QString& babel, const QString& input, const QString& output ) const { - QStringList empty; - return empty; + Q_UNUSED( babel ); + Q_UNUSED( featuretype ); + Q_UNUSED( input ); + Q_UNUSED( output ); + return QStringList(); } @@ -51,8 +54,11 @@ QStringList QgsBabelFormat::exportCommand( const QString& babel, const QString& input, const QString& output ) const { - QStringList empty; - return empty; + Q_UNUSED( babel ); + Q_UNUSED( featuretype ); + Q_UNUSED( input ); + Q_UNUSED( output ); + return QStringList(); } diff --git a/src/plugins/gps_importer/qgsgpsplugin.cpp b/src/plugins/gps_importer/qgsgpsplugin.cpp index 36eca53407e..6aa35a56980 100644 --- a/src/plugins/gps_importer/qgsgpsplugin.cpp +++ b/src/plugins/gps_importer/qgsgpsplugin.cpp @@ -668,6 +668,7 @@ void QgsGPSPlugin::setupBabel() //! Set icons to the current theme void QgsGPSPlugin::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/gps_importer.png"; QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/gps_importer.png"; QString myQrcPath = ":/gps_importer.png"; diff --git a/src/plugins/grass/qgsgrassattributes.cpp b/src/plugins/grass/qgsgrassattributes.cpp index b72538c440e..2610c31ea78 100644 --- a/src/plugins/grass/qgsgrassattributes.cpp +++ b/src/plugins/grass/qgsgrassattributes.cpp @@ -35,6 +35,7 @@ QgsGrassAttributesKeyPress::~QgsGrassAttributesKeyPress() {} bool QgsGrassAttributesKeyPress::eventFilter( QObject *o, QEvent *e ) { + Q_UNUSED( o ); if ( e->type() == QEvent::KeyPress ) { QKeyEvent *k = ( QKeyEvent * )e; @@ -55,6 +56,7 @@ QgsGrassAttributes::QgsGrassAttributes( QgsGrassEdit *edit, QgsGrassProvider *pr QWidget * parent, const char * name, Qt::WFlags f ) : QDialog( parent, f ), QgsGrassAttributesBase() { + Q_UNUSED( name ); QgsDebugMsg( "QgsGrassAttributes()" ); setupUi( this ); @@ -324,6 +326,7 @@ void QgsGrassAttributes::clear( ) void QgsGrassAttributes::tabChanged( int index ) { + Q_UNUSED( index ); QgsDebugMsg( "entered." ); resultLabel->setText( "" ); @@ -350,6 +353,7 @@ void QgsGrassAttributes::resetButtons( ) void QgsGrassAttributes::columnSizeChanged( int section, int oldSize, int newSize ) { + Q_UNUSED( oldSize ); QSettings settings; QString path = "/GRASS/windows/attributes/columnWidth/" + QString::number( section ); diff --git a/src/plugins/grass/qgsgrassbrowser.cpp b/src/plugins/grass/qgsgrassbrowser.cpp index 814da2c489f..82c3d0a47e9 100644 --- a/src/plugins/grass/qgsgrassbrowser.cpp +++ b/src/plugins/grass/qgsgrassbrowser.cpp @@ -38,6 +38,7 @@ QgsGrassBrowser::QgsGrassBrowser( QgisInterface *iface, QWidget * parent, Qt::WFlags f ) : QMainWindow( parent, Qt::Dialog ), mIface( iface ) { + Q_UNUSED( f ); QgsDebugMsg( "QgsGrassBrowser()" ); QActionGroup *ag = new QActionGroup( this ); @@ -188,6 +189,7 @@ void QgsGrassBrowser::addMap() void QgsGrassBrowser::doubleClicked( const QModelIndex & index ) { + Q_UNUSED( index ); QgsDebugMsg( "entered." ); addMap(); @@ -502,6 +504,7 @@ bool QgsGrassBrowser::getItemRegion( const QModelIndex & index, struct Cell_head void QgsGrassBrowser::selectionChanged( const QItemSelection & selected, const QItemSelection & deselected ) { + Q_UNUSED( deselected ); QgsDebugMsg( "entered." ); mActionAddMap->setEnabled( false ); @@ -545,6 +548,8 @@ void QgsGrassBrowser::selectionChanged( const QItemSelection & selected, const Q void QgsGrassBrowser::currentChanged( const QModelIndex & current, const QModelIndex & previous ) { + Q_UNUSED( current ); + Q_UNUSED( previous ); QgsDebugMsg( "entered." ); } diff --git a/src/plugins/grass/qgsgrassedittools.cpp b/src/plugins/grass/qgsgrassedittools.cpp index 1e696dff2c1..657430b442e 100644 --- a/src/plugins/grass/qgsgrassedittools.cpp +++ b/src/plugins/grass/qgsgrassedittools.cpp @@ -875,6 +875,7 @@ QgsGrassEditAttributes::QgsGrassEditAttributes( QgsGrassEdit* edit ) void QgsGrassEditAttributes::mouseClick( QgsPoint & point, Qt::MouseButton button ) { + Q_UNUSED( button ); double thresh = e->threshold(); // Redraw previously selected line diff --git a/src/plugins/grass/qgsgrassedittools.h b/src/plugins/grass/qgsgrassedittools.h index a0bda840aca..185dc116d2a 100644 --- a/src/plugins/grass/qgsgrassedittools.h +++ b/src/plugins/grass/qgsgrassedittools.h @@ -33,8 +33,10 @@ class QgsGrassEditTool : public QgsMapTool virtual void canvasMoveEvent( QMouseEvent * e ); //! functions to be overridden by grass edit tools - virtual void mouseClick( QgsPoint & point, Qt::MouseButton button ) { } - virtual void mouseMove( QgsPoint & point ) { } + virtual void mouseClick( QgsPoint & point, Qt::MouseButton button ) + { Q_UNUSED( point ); Q_UNUSED( button ); } + virtual void mouseMove( QgsPoint & point ) + { Q_UNUSED( point ); } protected: QgsGrassEdit* e; diff --git a/src/plugins/grass/qgsgrassmapcalc.cpp b/src/plugins/grass/qgsgrassmapcalc.cpp index f112f3b02d7..408539db956 100644 --- a/src/plugins/grass/qgsgrassmapcalc.cpp +++ b/src/plugins/grass/qgsgrassmapcalc.cpp @@ -40,11 +40,15 @@ QgsGrassMapcalc::QgsGrassMapcalc( QgsGrassTools *tools, QgsGrassModule *module, QgisInterface *iface, QWidget * parent, Qt::WFlags f ) - : QMainWindow( 0, Qt::Dialog ), - QgsGrassMapcalcBase( ), - QgsGrassModuleOptions( tools, module, iface ), - mTool( -1 ), mObject( 0 ), mConnector( 0 ) + : QMainWindow( 0, Qt::Dialog ) + , QgsGrassMapcalcBase( ) + , QgsGrassModuleOptions( tools, module, iface ) + , mTool( -1 ) + , mObject( 0 ) + , mConnector( 0 ) { + Q_UNUSED( parent ); + Q_UNUSED( f ); QgsDebugMsg( "QgsGrassMapcalc()" ); setupUi( this ); @@ -529,6 +533,7 @@ QStringList QgsGrassMapcalc::checkRegion() bool QgsGrassMapcalc::inputRegion( struct Cell_head *window, bool all ) { + Q_UNUSED( all ); QgsDebugMsg( "entered." ); if ( !QgsGrass::region( QgsGrass::getDefaultGisdbase(), @@ -1545,6 +1550,8 @@ int QgsGrassMapcalcObject::type() void QgsGrassMapcalcObject::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget ) { + Q_UNUSED( option ); + Q_UNUSED( widget ); //QGraphicsRectItem::paint(painter, option, widget); painter->setPen( QPen( QColor( 0, 0, 0 ) ) ); @@ -1930,6 +1937,8 @@ QgsGrassMapcalcConnector::~QgsGrassMapcalcConnector() void QgsGrassMapcalcConnector::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget ) { + Q_UNUSED( option ); + Q_UNUSED( widget ); for ( int i = 0; i < 2; i++ ) { if ( mSocketObjects[i] ) @@ -2122,6 +2131,7 @@ QgsGrassMapcalcView::QgsGrassMapcalcView( QgsGrassMapcalc * mapcalc, QWidget * parent, Qt::WFlags f ) : QGraphicsView( parent ) { + Q_UNUSED( f ); setAttribute( Qt::WA_StaticContents ); mMapcalc = mapcalc; diff --git a/src/plugins/grass/qgsgrassmapcalc.h b/src/plugins/grass/qgsgrassmapcalc.h index ec8f4832104..4961e12975b 100644 --- a/src/plugins/grass/qgsgrassmapcalc.h +++ b/src/plugins/grass/qgsgrassmapcalc.h @@ -66,7 +66,8 @@ class QgsGrassMapcalc: public QMainWindow, private Ui::QgsGrassMapcalcBase, QStringList checkRegion(); bool inputRegion( struct Cell_head *window, bool all ); QStringList output( int type ); - bool hasOutput( int type ) { return true; } + bool hasOutput( int type ) + { Q_UNUSED( type ); return true; } /** \brief recieves contentsMousePressEvent from view */ void mousePressEvent( QMouseEvent* ); diff --git a/src/plugins/grass/qgsgrassmodel.cpp b/src/plugins/grass/qgsgrassmodel.cpp index 448b27ef663..50029b70095 100644 --- a/src/plugins/grass/qgsgrassmodel.cpp +++ b/src/plugins/grass/qgsgrassmodel.cpp @@ -874,6 +874,7 @@ int QgsGrassModel::rowCount( const QModelIndex & parent ) const int QgsGrassModel::columnCount( const QModelIndex & parent ) const { + Q_UNUSED( parent ); // QgsDebugMsg("entered."); return 1; } @@ -1007,6 +1008,9 @@ void QgsGrassModel::setLocation( const QString &gisbase, const QString &location QVariant QgsGrassModel::headerData( int section, Qt::Orientation orientation, int role ) const { + Q_UNUSED( section ); + Q_UNUSED( orientation ); + Q_UNUSED( role ); // QgsDebugMsg("entered."); //TODO diff --git a/src/plugins/grass/qgsgrassmodule.cpp b/src/plugins/grass/qgsgrassmodule.cpp index 258f899550a..4e05dec9393 100644 --- a/src/plugins/grass/qgsgrassmodule.cpp +++ b/src/plugins/grass/qgsgrassmodule.cpp @@ -148,6 +148,7 @@ QgsGrassModule::QgsGrassModule( QgsGrassTools *tools, QString moduleName, QgisIn QString path, QWidget * parent, Qt::WFlags f ) : QgsGrassModuleBase( ), mSuccess( false ) { + Q_UNUSED( f ); QgsDebugMsg( "called" ); setupUi( this ); @@ -2668,6 +2669,7 @@ QString QgsGrassModuleInput::currentMap() void QgsGrassModuleInput::changed( int i ) { + Q_UNUSED( i ); emit valueChanged(); } @@ -2693,11 +2695,12 @@ QgsGrassModuleInput::~QgsGrassModuleInput() QgsGrassModuleItem::QgsGrassModuleItem( QgsGrassModule *module, QString key, QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode ) - : mModule( module ), - mKey( key ), - mHidden( false ), - mRequired( false ) + : mModule( module ) + , mKey( key ) + , mHidden( false ) + , mRequired( false ) { + Q_UNUSED( gdesc ); //mAnswer = qdesc.attribute("answer", ""); if ( !qdesc.attribute( "answer" ).isNull() ) @@ -2787,6 +2790,7 @@ QgsGrassModuleGroupBoxItem::~QgsGrassModuleGroupBoxItem() {} void QgsGrassModuleGroupBoxItem::resizeEvent( QResizeEvent * event ) { + Q_UNUSED( event ); adjustTitle(); setToolTip( mToolTip ); } @@ -3431,6 +3435,7 @@ QgsGrassModuleCheckBox::~QgsGrassModuleCheckBox() void QgsGrassModuleCheckBox::resizeEvent( QResizeEvent * event ) { + Q_UNUSED( event ); adjustText(); } void QgsGrassModuleCheckBox::setText( const QString & text ) diff --git a/src/plugins/grass/qgsgrassmodule.h b/src/plugins/grass/qgsgrassmodule.h index fcca101b1f2..bf8fb2e062f 100644 --- a/src/plugins/grass/qgsgrassmodule.h +++ b/src/plugins/grass/qgsgrassmodule.h @@ -190,10 +190,12 @@ class QgsGrassModuleOptions virtual QStringList ready() { return QStringList() ; } //! Get list of current output maps - virtual QStringList output( int type ) { return QStringList() ; } + virtual QStringList output( int type ) + { Q_UNUSED( type ); return QStringList(); } //! Has any output - virtual bool hasOutput( int type ) { return true; } + virtual bool hasOutput( int type ) + { Q_UNUSED( type ); return true; } //! Has raster input or output virtual bool usesRegion() { return false; } @@ -209,7 +211,8 @@ class QgsGrassModuleOptions //! Get region covering all input maps // \param all true all input maps // \param all false only the mas which were switched on - virtual bool inputRegion( struct Cell_head *window, bool all ) { return false; } + virtual bool inputRegion( struct Cell_head *window, bool all ) + { Q_UNUSED( window ); Q_UNUSED( all ); return false; } // ! Flag names virtual QStringList flagNames() { return QStringList() ; } diff --git a/src/plugins/grass/qgsgrassnewmapset.cpp b/src/plugins/grass/qgsgrassnewmapset.cpp index 9d276181db4..c90cd1a3f45 100644 --- a/src/plugins/grass/qgsgrassnewmapset.cpp +++ b/src/plugins/grass/qgsgrassnewmapset.cpp @@ -350,6 +350,7 @@ void QgsGrassNewMapset::checkLocation() void QgsGrassNewMapset::existingLocationChanged( const QString &text ) { + Q_UNUSED( text ); QgsDebugMsg( "entered." ); } @@ -368,6 +369,7 @@ void QgsGrassNewMapset::setProjectionPage() void QgsGrassNewMapset::sridSelected( QString theSRID ) { + Q_UNUSED( theSRID ); QgsDebugMsg( "entered." ); projectionSelected(); } @@ -449,16 +451,16 @@ void QgsGrassNewMapset::setGrassProjection() QgsDebugMsg( QString( "wkt = %1" ).arg( wkt ) ); } - int ret; // Note: GPJ_osr_to_grass() defaults in PROJECTION_XY if projection // cannot be set // There was a bug in GRASS, it is present in 6.0.x line - ret = GPJ_wkt_to_grass( &mCellHead, &mProjInfo, &mProjUnits, wkt, 0 ); + int ret = GPJ_wkt_to_grass( &mCellHead, &mProjInfo, &mProjUnits, wkt, 0 ); // Note: It seems that GPJ_osr_to_grass()returns always 1, // -> test if mProjInfo was set + Q_UNUSED( ret ); QgsDebugMsg( QString( "ret = %1" ).arg( ret ) ); QgsDebugMsg( QString( "mProjInfo = %1" ).arg( QString::number(( qulonglong )mProjInfo, 16 ).toLocal8Bit().constData() ) ); @@ -1385,6 +1387,7 @@ void QgsGrassNewMapset::setError( QLabel *line, const QString &err ) // to next page if Key_Enter is pressed void QgsGrassNewMapset::keyPressEvent( QKeyEvent * e ) { + Q_UNUSED( e ); // QgsDebugMsg(QString("key = %1").arg(e->key())); } diff --git a/src/plugins/grass/qgsgrassplugin.cpp b/src/plugins/grass/qgsgrassplugin.cpp index e13fdd466bc..e5218085b49 100644 --- a/src/plugins/grass/qgsgrassplugin.cpp +++ b/src/plugins/grass/qgsgrassplugin.cpp @@ -491,7 +491,7 @@ void QgsGrassPlugin::closeEdit( QString layerId ) void QgsGrassPlugin::editClosed() { - if( mEdit == sender() ) + if ( mEdit == sender() ) mEdit = 0; } @@ -589,6 +589,7 @@ void QgsGrassPlugin::newVector() void QgsGrassPlugin::postRender( QPainter *painter ) { + Q_UNUSED( painter ); // We have to redraw rectangle, because canvas->mapRenderer()->destinationCrs is set after GRASS plugin constructor! This way it is redrawn also if canvas CRS has changed. displayRegion(); // QgsDebugMsg("entered."); @@ -849,6 +850,8 @@ void QgsGrassPlugin::unload() // Set icons to the current theme void QgsGrassPlugin::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); + mOpenMapsetAction->setIcon( getThemeIcon( "grass_open_mapset.png" ) ); mNewMapsetAction->setIcon( getThemeIcon( "grass_new_mapset.png" ) ); mCloseMapsetAction->setIcon( getThemeIcon( "grass_close_mapset.png" ) ); diff --git a/src/plugins/grass/qgsgrassshell.cpp b/src/plugins/grass/qgsgrassshell.cpp index c7df322f4fc..b286b348948 100644 --- a/src/plugins/grass/qgsgrassshell.cpp +++ b/src/plugins/grass/qgsgrassshell.cpp @@ -33,6 +33,7 @@ extern "C" QgsGrassShell::QgsGrassShell( QgsGrassTools *tools, QTabWidget *parent, const char *name ) : QFrame( parent ), mTools( tools ), mTabWidget( parent ) { + Q_UNUSED( name ); QVBoxLayout *mainLayout = new QVBoxLayout( this ); QTermWidget *mTerminal = new QTermWidget( 0, this ); initTerminal( mTerminal ); diff --git a/src/plugins/grass/qgsgrasstools.cpp b/src/plugins/grass/qgsgrasstools.cpp index dc1fa743a65..33f37d0d724 100644 --- a/src/plugins/grass/qgsgrasstools.cpp +++ b/src/plugins/grass/qgsgrasstools.cpp @@ -48,7 +48,7 @@ QgsGrassTools::QgsGrassTools( QgisInterface *iface, QWidget * parent, const char * name, Qt::WFlags f ) : QDialog( parent, f ), QgsGrassToolsBase() { - + Q_UNUSED( name ); setupUi( this ); QgsDebugMsg( "QgsGrassTools()" ); qRegisterMetaType(); @@ -119,6 +119,7 @@ QgsGrassTools::QgsGrassTools( QgisInterface *iface, void QgsGrassTools::moduleClicked( QTreeWidgetItem * item, int column ) { + Q_UNUSED( column ); QgsDebugMsg( "entered." ); if ( !item ) return; diff --git a/src/plugins/interpolation/qgsinterpolationdialog.cpp b/src/plugins/interpolation/qgsinterpolationdialog.cpp index a758d99af41..535dfb0a894 100644 --- a/src/plugins/interpolation/qgsinterpolationdialog.cpp +++ b/src/plugins/interpolation/qgsinterpolationdialog.cpp @@ -204,6 +204,7 @@ void QgsInterpolationDialog::on_buttonBox_accepted() void QgsInterpolationDialog::on_mInputLayerComboBox_currentIndexChanged( const QString& text ) { + Q_UNUSED( text ); mInterpolationAttributeComboBox->clear(); mUseZCoordCheckBox->setEnabled( false ); @@ -362,41 +363,49 @@ void QgsInterpolationDialog::on_mInterpolationMethodComboBox_currentIndexChanged void QgsInterpolationDialog::on_mNumberOfColumnsSpinBox_valueChanged( int value ) { + Q_UNUSED( value ); setNewCellsizeXOnNColumnsChange(); } void QgsInterpolationDialog::on_mNumberOfRowsSpinBox_valueChanged( int value ) { + Q_UNUSED( value ); setNewCellsizeYOnNRowschange(); } void QgsInterpolationDialog::on_mCellsizeXSpinBox_valueChanged( double value ) { + Q_UNUSED( value ); setNColsOnCellsizeXChange(); } void QgsInterpolationDialog::on_mCellSizeYSpinBox_valueChanged( double value ) { + Q_UNUSED( value ); setNRowsOnCellsizeYChange(); } void QgsInterpolationDialog::on_mXMinLineEdit_textEdited( const QString& text ) { + Q_UNUSED( text ); setNewCellsizeOnBoundingBoxChange(); } void QgsInterpolationDialog::on_mXMaxLineEdit_textEdited( const QString& text ) { + Q_UNUSED( text ); setNewCellsizeOnBoundingBoxChange(); } void QgsInterpolationDialog::on_mYMinLineEdit_textEdited( const QString& text ) { + Q_UNUSED( text ); setNewCellsizeOnBoundingBoxChange(); } void QgsInterpolationDialog::on_mYMaxLineEdit_textEdited( const QString& text ) { + Q_UNUSED( text ); setNewCellsizeOnBoundingBoxChange(); } diff --git a/src/plugins/interpolation/qgsinterpolationplugin.cpp b/src/plugins/interpolation/qgsinterpolationplugin.cpp index d41f03e4f5b..d8a9458f1b7 100644 --- a/src/plugins/interpolation/qgsinterpolationplugin.cpp +++ b/src/plugins/interpolation/qgsinterpolationplugin.cpp @@ -67,6 +67,7 @@ void QgsInterpolationPlugin::showInterpolationDialog() //! Set icons to the current theme void QgsInterpolationPlugin::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/interpolation.png"; QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/interpolation.png"; QString myQrcPath = ":/interpolation.png"; diff --git a/src/plugins/north_arrow/plugin.cpp b/src/plugins/north_arrow/plugin.cpp index b736c2945e0..f59aa5d3875 100644 --- a/src/plugins/north_arrow/plugin.cpp +++ b/src/plugins/north_arrow/plugin.cpp @@ -393,6 +393,7 @@ bool QgsNorthArrowPlugin::calculateNorthDirection() //! Set icons to the current theme void QgsNorthArrowPlugin::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/north_arrow.png"; QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/north_arrow.png"; QString myQrcPath = ":/north_arrow.png"; diff --git a/src/plugins/north_arrow/plugingui.cpp b/src/plugins/north_arrow/plugingui.cpp index bdd99bc1aef..c36bb970eb7 100644 --- a/src/plugins/north_arrow/plugingui.cpp +++ b/src/plugins/north_arrow/plugingui.cpp @@ -86,7 +86,7 @@ void QgsNorthArrowPluginGui::setAutomaticDisabled() //overides function by the same name created in .ui void QgsNorthArrowPluginGui::on_spinAngle_valueChanged( int theInt ) { - + Q_UNUSED( theInt ); } void QgsNorthArrowPluginGui::on_sliderRotation_valueChanged( int theInt ) @@ -157,7 +157,8 @@ void QgsNorthArrowPluginGui::rotatePixmap( int theRotationInt ) // Called when the widget has been resized. // -void QgsNorthArrowPluginGui::resizeEvent( QResizeEvent * theResizeEvent ) +void QgsNorthArrowPluginGui::resizeEvent( QResizeEvent *theResizeEvent ) { + Q_UNUSED( theResizeEvent ); rotatePixmap( sliderRotation->value() ); } diff --git a/src/plugins/offline_editing/offline_editing.cpp b/src/plugins/offline_editing/offline_editing.cpp index 0ae9a56d342..e0f187fb94d 100644 --- a/src/plugins/offline_editing/offline_editing.cpp +++ b/src/plugins/offline_editing/offline_editing.cpp @@ -137,6 +137,7 @@ bool QgsOfflineEditing::isOfflineProject() void QgsOfflineEditing::synchronize( QgsLegendInterface* legendInterface ) { + Q_UNUSED( legendInterface ); // open logging db sqlite3* db = openLoggingDb(); if ( db == NULL ) @@ -516,7 +517,7 @@ void QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlite3* db, con mProgressDialog->setupProgressBar( tr( "%v / %m features copied" ), layer->featureCount() ); int featureCount = 1; - QList remoteFeatureIds; + QList remoteFeatureIds; while ( layer->nextFeature( f ) ) { remoteFeatureIds << f.id(); @@ -543,7 +544,7 @@ void QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlite3* db, con // update feature id lookup int layerId = getOrCreateLayerId( db, newLayer->id() ); - QList offlineFeatureIds; + QList offlineFeatureIds; newLayer->select( QgsAttributeList(), QgsRectangle(), false, false ); while ( newLayer->nextFeature( f ) ) { @@ -659,7 +660,7 @@ void QgsOfflineEditing::applyFeaturesRemoved( QgsVectorLayer* remoteLayer, sqlit int i = 1; for ( QgsFeatureIds::const_iterator it = values.begin(); it != values.end(); ++it ) { - int fid = remoteFid( db, layerId, *it ); + QgsFeatureId fid = remoteFid( db, layerId, *it ); remoteLayer->deleteFeature( fid ); mProgressDialog->setProgressValue( i++ ); @@ -677,7 +678,7 @@ void QgsOfflineEditing::applyAttributeValueChanges( QgsVectorLayer* offlineLayer for ( int i = 0; i < values.size(); i++ ) { - int fid = remoteFid( db, layerId, values.at( i ).fid ); + QgsFeatureId fid = remoteFid( db, layerId, values.at( i ).fid ); remoteLayer->changeAttributeValue( fid, attrLookup[ values.at( i ).attr ], values.at( i ).value, false ); @@ -694,7 +695,7 @@ void QgsOfflineEditing::applyGeometryChanges( QgsVectorLayer* remoteLayer, sqlit for ( int i = 0; i < values.size(); i++ ) { - int fid = remoteFid( db, layerId, values.at( i ).fid ); + QgsFeatureId fid = remoteFid( db, layerId, values.at( i ).fid ); remoteLayer->changeGeometry( fid, QgsGeometry::fromWkt( values.at( i ).geom_wkt ) ); mProgressDialog->setProgressValue( i + 1 ); @@ -707,7 +708,7 @@ void QgsOfflineEditing::updateFidLookup( QgsVectorLayer* remoteLayer, sqlite3* d // get remote added fids // NOTE: use QMap for sorted fids - QMap < int, bool /*dummy*/ > newRemoteFids; + QMap < QgsFeatureId, bool /*dummy*/ > newRemoteFids; QgsFeature f; remoteLayer->select( QgsAttributeList(), QgsRectangle(), false, false ); @@ -738,7 +739,7 @@ void QgsOfflineEditing::updateFidLookup( QgsVectorLayer* remoteLayer, sqlite3* d // add new fid lookups i = 0; sqlExec( db, "BEGIN" ); - for ( QMap::const_iterator it = newRemoteFids.begin(); it != newRemoteFids.end(); ++it ) + for ( QMap::const_iterator it = newRemoteFids.begin(); it != newRemoteFids.end(); ++it ) { addFidLookup( db, layerId, newOfflineFids.at( i++ ), it.key() ); } @@ -839,25 +840,25 @@ void QgsOfflineEditing::increaseCommitNo( sqlite3* db ) sqlExec( db, sql ); } -void QgsOfflineEditing::addFidLookup( sqlite3* db, int layerId, int offlineFid, int remoteFid ) +void QgsOfflineEditing::addFidLookup( sqlite3* db, int layerId, QgsFeatureId offlineFid, QgsFeatureId remoteFid ) { QString sql = QString( "INSERT INTO 'log_fids' VALUES ( %1, %2, %3 )" ).arg( layerId ).arg( offlineFid ).arg( remoteFid ); sqlExec( db, sql ); } -int QgsOfflineEditing::remoteFid( sqlite3* db, int layerId, int offlineFid ) +QgsFeatureId QgsOfflineEditing::remoteFid( sqlite3* db, int layerId, QgsFeatureId offlineFid ) { QString sql = QString( "SELECT \"remote_fid\" FROM 'log_fids' WHERE \"layer_id\" = %1 AND \"offline_fid\" = %2" ).arg( layerId ).arg( offlineFid ); return sqlQueryInt( db, sql, -1 ); } -int QgsOfflineEditing::offlineFid( sqlite3* db, int layerId, int remoteFid ) +QgsFeatureId QgsOfflineEditing::offlineFid( sqlite3* db, int layerId, QgsFeatureId remoteFid ) { QString sql = QString( "SELECT \"offline_fid\" FROM 'log_fids' WHERE \"layer_id\" = %1 AND \"remote_fid\" = %2" ).arg( layerId ).arg( remoteFid ); return sqlQueryInt( db, sql, -1 ); } -bool QgsOfflineEditing::isAddedFeature( sqlite3* db, int layerId, int fid ) +bool QgsOfflineEditing::isAddedFeature( sqlite3* db, int layerId, QgsFeatureId fid ) { QString sql = QString( "SELECT COUNT(\"fid\") FROM 'log_added_features' WHERE \"layer_id\" = %1 AND \"fid\" = %2" ).arg( layerId ).arg( fid ); return ( sqlQueryInt( db, sql, 0 ) > 0 ); @@ -1145,7 +1146,7 @@ void QgsOfflineEditing::committedAttributeValuesChanges( const QString& qgisLaye for ( QgsChangedAttributesMap::const_iterator cit = changedAttrsMap.begin(); cit != changedAttrsMap.end(); ++cit ) { - int fid = cit.key(); + QgsFeatureId fid = cit.key(); if ( isAddedFeature( db, layerId, fid ) ) { // skip added features @@ -1182,7 +1183,7 @@ void QgsOfflineEditing::committedGeometriesChanges( const QString& qgisLayerId, for ( QgsGeometryMap::const_iterator it = changedGeometries.begin(); it != changedGeometries.end(); ++it ) { - int fid = it.key(); + QgsFeatureId fid = it.key(); if ( isAddedFeature( db, layerId, fid ) ) { // skip added features diff --git a/src/plugins/offline_editing/offline_editing.h b/src/plugins/offline_editing/offline_editing.h index b8b1ecdfde9..18f7439938f 100644 --- a/src/plugins/offline_editing/offline_editing.h +++ b/src/plugins/offline_editing/offline_editing.h @@ -64,10 +64,10 @@ class QgsOfflineEditing : public QObject int getOrCreateLayerId( sqlite3* db, const QString& qgisLayerId ); int getCommitNo( sqlite3* db ); void increaseCommitNo( sqlite3* db ); - void addFidLookup( sqlite3* db, int layerId, int offlineFid, int remoteFid ); - int remoteFid( sqlite3* db, int layerId, int offlineFid ); - int offlineFid( sqlite3* db, int layerId, int remoteFid ); - bool isAddedFeature( sqlite3* db, int layerId, int fid ); + void addFidLookup( sqlite3* db, int layerId, QgsFeatureId offlineFid, QgsFeatureId remoteFid ); + QgsFeatureId remoteFid( sqlite3* db, int layerId, QgsFeatureId offlineFid ); + QgsFeatureId offlineFid( sqlite3* db, int layerId, QgsFeatureId remoteFid ); + bool isAddedFeature( sqlite3* db, int layerId, QgsFeatureId fid ); int sqlExec( sqlite3* db, const QString& sql ); int sqlQueryInt( sqlite3* db, const QString& sql, int defaultValue ); @@ -78,7 +78,7 @@ class QgsOfflineEditing : public QObject struct AttributeValueChange { - int fid; + QgsFeatureId fid; int attr; QString value; }; @@ -87,7 +87,7 @@ class QgsOfflineEditing : public QObject struct GeometryChange { - int fid; + QgsFeatureId fid; QString geom_wkt; }; typedef QList GeometryChanges; diff --git a/src/plugins/offline_editing/offline_editing_plugin_gui.cpp b/src/plugins/offline_editing/offline_editing_plugin_gui.cpp index 10674384b02..bb499514240 100644 --- a/src/plugins/offline_editing/offline_editing_plugin_gui.cpp +++ b/src/plugins/offline_editing/offline_editing_plugin_gui.cpp @@ -111,6 +111,7 @@ void QgsOfflineEditingPluginGui::on_butBrowse_clicked() void QgsOfflineEditingPluginGui::on_checkboxShowEditableLayers_stateChanged( int state ) { + Q_UNUSED( state ); updateLayerList( checkboxShowEditableLayers->checkState() == Qt::Checked ); } diff --git a/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp b/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp index dd4055b0384..674d4756ab0 100644 --- a/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp +++ b/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp @@ -291,6 +291,7 @@ void QgsOracleSelectGeoraster::showSelection( const QString & line ) void QgsOracleSelectGeoraster::on_listWidget_clicked( QModelIndex Index ) { + Q_UNUSED( Index ); if ( lineEdit->text() == listWidget->currentItem()->text() ) { showSelection( lineEdit->text() ); diff --git a/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp b/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp index 186ea32086d..91f31fead30 100644 --- a/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp +++ b/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp @@ -69,6 +69,7 @@ QgsFeatureRendererV2* QgsPointDisplacementRenderer::clone() void QgsPointDisplacementRenderer::renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer, bool selected, bool drawVertexMarker ) { + Q_UNUSED( drawVertexMarker ); //point position in screen coords QgsGeometry* geom = feature.geometry(); QGis::WkbType geomType = geom->wkbType(); @@ -88,13 +89,13 @@ void QgsPointDisplacementRenderer::renderFeature( QgsFeature& feature, QgsRender if ( mDisplacementIds.contains( feature.id() ) ) { //create the symbol for the whole display group if the id is the first entry in a display group - QList >::iterator it = mDisplacementGroups.begin(); + QList >::iterator it = mDisplacementGroups.begin(); for ( ; it != mDisplacementGroups.end(); ++it ) { //create the symbol for the whole display group if the id is the first entry in a display group if ( feature.id() == it->begin().key() ) { - QMap::iterator attIt = it->begin(); + QMap::iterator attIt = it->begin(); for ( ; attIt != it->end(); ++attIt ) { if ( mDrawLabels ) @@ -186,6 +187,7 @@ void QgsPointDisplacementRenderer::setEmbeddedRenderer( QgsFeatureRendererV2* r QgsSymbolV2* QgsPointDisplacementRenderer::symbolForFeature( QgsFeature& feature ) { + Q_UNUSED( feature ); return 0; //not used any more } @@ -357,7 +359,7 @@ void QgsPointDisplacementRenderer::createDisplacementGroups( QgsVectorLayer* vla } QgsFeature f; - QList intersectList; + QList intersectList; vlayer->select( attList, viewExtent, true, false ); while ( vlayer->nextFeature( f ) ) @@ -375,9 +377,9 @@ void QgsPointDisplacementRenderer::createDisplacementGroups( QgsVectorLayer* vla else { //go through all the displacement group maps and search an entry where the id equals the result of the spatial search - int existingEntry = intersectList.at( 0 ); + QgsFeatureId existingEntry = intersectList.at( 0 ); bool found = false; - QList >::iterator it = mDisplacementGroups.begin(); + QList< QMap >::iterator it = mDisplacementGroups.begin(); for ( ; it != mDisplacementGroups.end(); ++it ) { if ( it->size() > 0 && it->contains( existingEntry ) ) @@ -392,7 +394,7 @@ void QgsPointDisplacementRenderer::createDisplacementGroups( QgsVectorLayer* vla if ( !found )//insert the already existing feature and the new one into a map { - QMap newMap; + QMap newMap; QgsFeature existingFeature; vlayer->featureAtId( existingEntry, existingFeature ); newMap.insert( existingEntry, existingFeature ); @@ -420,29 +422,29 @@ void QgsPointDisplacementRenderer::printInfoDisplacementGroups() for ( int i = 0; i < nGroups; ++i ) { QgsDebugMsg( "***************displacement group " + QString::number( i ) ); - QMap::const_iterator it = mDisplacementGroups.at( i ).constBegin(); + QMap::const_iterator it = mDisplacementGroups.at( i ).constBegin(); for ( ; it != mDisplacementGroups.at( i ).constEnd(); ++it ) { - QgsDebugMsg( QString::number( it.key() ) ); + QgsDebugMsg( FID_TO_STRING( it.key() ) ); } } QgsDebugMsg( "********all displacement ids*********" ); - QSet::const_iterator iIt = mDisplacementIds.constBegin(); + QSet::const_iterator iIt = mDisplacementIds.constBegin(); for ( ; iIt != mDisplacementIds.constEnd(); ++iIt ) { - QgsDebugMsg( QString::number( *iIt ) ); + QgsDebugMsg( FID_TO_STRING( *iIt ) ); } } -void QgsPointDisplacementRenderer::setDisplacementGroups( const QList >& list ) +void QgsPointDisplacementRenderer::setDisplacementGroups( const QList< QMap >& list ) { mDisplacementGroups = list; mDisplacementIds.clear(); - QList >::const_iterator list_it = mDisplacementGroups.constBegin(); + QList >::const_iterator list_it = mDisplacementGroups.constBegin(); for ( ; list_it != mDisplacementGroups.constEnd(); ++list_it ) { - QMap::const_iterator map_it = list_it->constBegin(); + QMap::const_iterator map_it = list_it->constBegin(); for ( ; map_it != list_it->constEnd(); ++map_it ) { mDisplacementIds.insert( map_it.key() ); diff --git a/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.h b/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.h index 7c62b6d3bb6..43b4198469f 100644 --- a/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.h +++ b/src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.h @@ -63,7 +63,7 @@ class QgsPointDisplacementRenderer: public QgsFeatureRendererV2 void setEmbeddedRenderer( QgsFeatureRendererV2* r ); QgsFeatureRendererV2* embeddedRenderer() { return mRenderer;} - void setDisplacementGroups( const QList >& list ); + void setDisplacementGroups( const QList >& list ); void setLabelFont( const QFont& f ) { mLabelFont = f; } QFont labelFont() const { return mLabelFont;} @@ -122,9 +122,9 @@ class QgsPointDisplacementRenderer: public QgsFeatureRendererV2 double mMaxLabelScaleDenominator; /**Groups of features that have the same position*/ - QList > mDisplacementGroups; + QList > mDisplacementGroups; /**Set that contains all the ids the display groups (for quicker lookup)*/ - QSet mDisplacementIds; + QSet mDisplacementIds; /**Create the displacement groups efficiently using a spatial index*/ void createDisplacementGroups( QgsVectorLayer *vlayer, const QgsRectangle& viewExtent ); diff --git a/src/plugins/roadgraph/graphbuilder.h b/src/plugins/roadgraph/graphbuilder.h index e9430018005..16b0c843874 100644 --- a/src/plugins/roadgraph/graphbuilder.h +++ b/src/plugins/roadgraph/graphbuilder.h @@ -61,7 +61,7 @@ class RgGraphBuilder /** * add arc */ - virtual void addArc( const QgsPoint& pt1, const QgsPoint& pt2, double cost, double speed, int featureId ) = 0; + virtual void addArc( const QgsPoint& pt1, const QgsPoint& pt2, double cost, double speed, QgsFeatureId featureId ) = 0; private: QgsCoordinateReferenceSystem mCrs; diff --git a/src/plugins/roadgraph/simplegraphbuilder.cpp b/src/plugins/roadgraph/simplegraphbuilder.cpp index 584ff1104fe..4e557c5fbd9 100644 --- a/src/plugins/roadgraph/simplegraphbuilder.cpp +++ b/src/plugins/roadgraph/simplegraphbuilder.cpp @@ -32,16 +32,16 @@ QgsPoint RgSimpleGraphBuilder::addVertex( const QgsPoint& pt ) if ( f > 0 ) { QgsRectangle r( pt.x() - f, pt.y() - f, pt.x() + f, pt.y() + f ); - QList< int > searchResult = mPointIndex.intersects( r ); + QList< QgsFeatureId > searchResult = mPointIndex.intersects( r ); if ( !searchResult.empty() ) { - int i = searchResult.front(); + QgsFeatureId i = searchResult.front(); if ( mPointMap[ i ].sqrDist( pt ) < topologyTolerance() ) { return mPointMap[ i ]; } } - int newId = mPointMap.size() + 1; + QgsFeatureId newId = mPointMap.size() + 1; QgsFeature f( newId ); f.setGeometry( QgsGeometry::fromPoint( pt ) ); @@ -53,7 +53,7 @@ QgsPoint RgSimpleGraphBuilder::addVertex( const QgsPoint& pt ) return pt; } -void RgSimpleGraphBuilder::addArc( const QgsPoint& pt1, const QgsPoint& pt2, double cost, double speed, int featureId ) +void RgSimpleGraphBuilder::addArc( const QgsPoint& pt1, const QgsPoint& pt2, double cost, double speed, QgsFeatureId featureId ) { mMatrix[ pt1 ][ pt2 ] = ArcAttributes( cost, cost / speed, featureId ); } diff --git a/src/plugins/roadgraph/simplegraphbuilder.h b/src/plugins/roadgraph/simplegraphbuilder.h index a2ca2bdc986..17305c3250b 100644 --- a/src/plugins/roadgraph/simplegraphbuilder.h +++ b/src/plugins/roadgraph/simplegraphbuilder.h @@ -44,7 +44,7 @@ class RgSimpleGraphBuilder : public RgGraphBuilder * MANDATORY BUILDER PROPERTY DECLARATION */ QgsPoint addVertex( const QgsPoint& pt ); - void addArc( const QgsPoint& pt1, const QgsPoint& pt2, double cost, double speed, int featureId ); + void addArc( const QgsPoint& pt1, const QgsPoint& pt2, double cost, double speed, QgsFeatureId featureId ); /** * return Adjacecncy matrix; @@ -55,6 +55,6 @@ class RgSimpleGraphBuilder : public RgGraphBuilder QgsSpatialIndex mPointIndex; - QMap< int, QgsPoint> mPointMap; + QMap< QgsFeatureId, QgsPoint> mPointMap; }; #endif //SIMPLEGRAPHBUILDER diff --git a/src/plugins/roadgraph/utils.cpp b/src/plugins/roadgraph/utils.cpp index 751d943bc33..2f3e64dc484 100644 --- a/src/plugins/roadgraph/utils.cpp +++ b/src/plugins/roadgraph/utils.cpp @@ -77,10 +77,10 @@ ArcAttributes::ArcAttributes() mCost = infinity(); mTime = infinity(); } -ArcAttributes::ArcAttributes( double cost, double time, int featureId ) : + +ArcAttributes::ArcAttributes( double cost, double time, QgsFeatureId featureId ) : mCost( cost ), mTime( time ), mFeatureId( featureId ) { - } diff --git a/src/plugins/roadgraph/utils.h b/src/plugins/roadgraph/utils.h index 0f4d87d0ae4..1fec36335a2 100644 --- a/src/plugins/roadgraph/utils.h +++ b/src/plugins/roadgraph/utils.h @@ -17,6 +17,7 @@ // Qgis includes #include "qgspoint.h" +#include "qgsfeature.h" // standard includes #include @@ -58,11 +59,11 @@ class ArcAttributes { public: ArcAttributes(); - ArcAttributes( double cost, double time, int mFeatureId ); + ArcAttributes( double cost, double time, QgsFeatureId mFeatureId ); public: double mCost; double mTime; - int mFeatureId; + QgsFeatureId mFeatureId; }; typedef std::map< QgsPoint, ArcAttributes, QgsPointCompare > AdjacencyMatrixString; diff --git a/src/plugins/scale_bar/plugin.cpp b/src/plugins/scale_bar/plugin.cpp index 2cb50b89f80..22ed7f574fe 100644 --- a/src/plugins/scale_bar/plugin.cpp +++ b/src/plugins/scale_bar/plugin.cpp @@ -608,6 +608,7 @@ void QgsScaleBarPlugin::setColor( QColor theQColor ) //! Set icons to the current theme void QgsScaleBarPlugin::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/scale_bar.png"; QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/scale_bar.png"; QString myQrcPath = ":/scale_bar.png"; diff --git a/src/plugins/spatialquery/qgsgeometrycoordinatetransform.h b/src/plugins/spatialquery/qgsgeometrycoordinatetransform.h index f47c7c3d163..4a9844a4a94 100644 --- a/src/plugins/spatialquery/qgsgeometrycoordinatetransform.h +++ b/src/plugins/spatialquery/qgsgeometrycoordinatetransform.h @@ -62,7 +62,8 @@ class QgsGeometryCoordinateTransform * \brief None transform the coordinates reference system of the geometry (use by transform) * \param geom Geometry */ - void setNoneGeomTransform( QgsGeometry *geom ) {}; + void setNoneGeomTransform( QgsGeometry *geom ) + { Q_UNUSED( geom ); } QgsCoordinateTransform * mCoordTransform; void ( QgsGeometryCoordinateTransform::* mFuncTransform )( QgsGeometry * ); diff --git a/src/plugins/spatialquery/qgsrubberselectid.cpp b/src/plugins/spatialquery/qgsrubberselectid.cpp index 466be1c2e21..2f15a39c4b1 100644 --- a/src/plugins/spatialquery/qgsrubberselectid.cpp +++ b/src/plugins/spatialquery/qgsrubberselectid.cpp @@ -54,7 +54,7 @@ void QgsRubberSelectId::setStyle( int colorRed, int colorGreen, int colorBlue, i setStyle(); } // void QgsRubberSelectId::setColor(int colorRed, int colorGreen, int colorBlue, float alfa, width) -void QgsRubberSelectId::addFeature( QgsVectorLayer* lyr, int fid ) +void QgsRubberSelectId::addFeature( QgsVectorLayer* lyr, QgsFeatureId fid ) { bool isPolygon = ( lyr->geometryType() == QGis::Polygon ); if ( mIsPolygon != isPolygon ) diff --git a/src/plugins/spatialquery/qgsrubberselectid.h b/src/plugins/spatialquery/qgsrubberselectid.h index d0d45a0f81d..a8e8f386fd5 100644 --- a/src/plugins/spatialquery/qgsrubberselectid.h +++ b/src/plugins/spatialquery/qgsrubberselectid.h @@ -58,7 +58,7 @@ class QgsRubberSelectId * \param mLayer pointer to QgsVectorLayer * \param fid integer for ID for feature */ - void addFeature( QgsVectorLayer* lyr, int fid ); + void addFeature( QgsVectorLayer* lyr, QgsFeatureId fid ); /** * \brief Show rubber band diff --git a/src/plugins/spatialquery/qgsspatialquery.cpp b/src/plugins/spatialquery/qgsspatialquery.cpp index 9f21d3365b8..ecd9e699a5a 100644 --- a/src/plugins/spatialquery/qgsspatialquery.cpp +++ b/src/plugins/spatialquery/qgsspatialquery.cpp @@ -48,7 +48,9 @@ void QgsSpatialQuery::setSelectedFeaturesReference( bool useSelected ) } // void QgsSpatialQuery::setSelectedFeaturesReference(bool useSelected) -void QgsSpatialQuery::runQuery( QSet & qsetIndexResult, QSet & qsetIndexInvalidTarget, QSet & qsetIndexInvalidReference, +void QgsSpatialQuery::runQuery( QgsFeatureIds &qsetIndexResult, + QgsFeatureIds &qsetIndexInvalidTarget, + QgsFeatureIds &qsetIndexInvalidReference, int relation, QgsVectorLayer* lyrTarget, QgsVectorLayer* lyrReference ) { setQuery( lyrTarget, lyrReference ); @@ -189,7 +191,7 @@ bool QgsSpatialQuery::hasValidGeometry( QgsFeature &feature ) } // bool QgsSpatialQuery::hasValidGeometry(QgsFeature &feature) -void QgsSpatialQuery::setSpatialIndexReference( QSet & qsetIndexInvalidReference ) +void QgsSpatialQuery::setSpatialIndexReference( QgsFeatureIds &qsetIndexInvalidReference ) { QgsReaderFeatures * readerFeaturesReference = new QgsReaderFeatures( mLayerReference, mUseReferenceSelection ); QgsFeature feature; @@ -210,7 +212,7 @@ void QgsSpatialQuery::setSpatialIndexReference( QSet & qsetIndexInvalidRefe } // void QgsSpatialQuery::setSpatialIndexReference() -void QgsSpatialQuery::execQuery( QSet & qsetIndexResult, QSet & qsetIndexInvalidTarget, int relation ) +void QgsSpatialQuery::execQuery( QgsFeatureIds &qsetIndexResult, QgsFeatureIds &qsetIndexInvalidTarget, int relation ) { bool ( QgsGeometry::* operation )( QgsGeometry * ); switch ( relation ) @@ -249,7 +251,7 @@ void QgsSpatialQuery::execQuery( QSet & qsetIndexResult, QSet & qsetIn coordinateTransform->setCoordinateTransform( mLayerTarget, mLayerReference ); // Set function for populate result - void ( QgsSpatialQuery::* funcPopulateIndexResult )( QSet &, int, QgsGeometry *, bool ( QgsGeometry::* )( QgsGeometry * ) ); + void ( QgsSpatialQuery::* funcPopulateIndexResult )( QgsFeatureIds&, QgsFeatureId, QgsGeometry *, bool ( QgsGeometry::* )( QgsGeometry * ) ); funcPopulateIndexResult = ( relation == Disjoint ) ? &QgsSpatialQuery::populateIndexResultDisjoint : &QgsSpatialQuery::populateIndexResult; @@ -277,10 +279,10 @@ void QgsSpatialQuery::execQuery( QSet & qsetIndexResult, QSet & qsetIn } // QSet QgsSpatialQuery::execQuery( QSet & qsetIndexResult, int relation) void QgsSpatialQuery::populateIndexResult( - QSet &qsetIndexResult, int idTarget, QgsGeometry * geomTarget, + QgsFeatureIds &qsetIndexResult, QgsFeatureId idTarget, QgsGeometry * geomTarget, bool ( QgsGeometry::* op )( QgsGeometry * ) ) { - QList listIdReference; + QList listIdReference; listIdReference = mIndexReference.intersects( geomTarget->boundingBox() ); if ( listIdReference.count() == 0 ) { @@ -288,7 +290,7 @@ void QgsSpatialQuery::populateIndexResult( } QgsFeature featureReference; QgsGeometry * geomReference; - QList::iterator iterIdReference = listIdReference.begin(); + QList::iterator iterIdReference = listIdReference.begin(); for ( ; iterIdReference != listIdReference.end(); iterIdReference++ ) { mLayerReference->featureAtId( *iterIdReference, featureReference ); @@ -303,10 +305,10 @@ void QgsSpatialQuery::populateIndexResult( } // void QgsSpatialQuery::populateIndexResult(... void QgsSpatialQuery::populateIndexResultDisjoint( - QSet &qsetIndexResult, int idTarget, QgsGeometry * geomTarget, + QgsFeatureIds &qsetIndexResult, QgsFeatureId idTarget, QgsGeometry * geomTarget, bool ( QgsGeometry::* op )( QgsGeometry * ) ) { - QList listIdReference; + QList listIdReference; listIdReference = mIndexReference.intersects( geomTarget->boundingBox() ); if ( listIdReference.count() == 0 ) { @@ -315,7 +317,7 @@ void QgsSpatialQuery::populateIndexResultDisjoint( } QgsFeature featureReference; QgsGeometry * geomReference; - QList::iterator iterIdReference = listIdReference.begin(); + QList::iterator iterIdReference = listIdReference.begin(); bool addIndex = true; for ( ; iterIdReference != listIdReference.end(); iterIdReference++ ) { diff --git a/src/plugins/spatialquery/qgsspatialquery.h b/src/plugins/spatialquery/qgsspatialquery.h index e5f43899987..c5b66121a47 100644 --- a/src/plugins/spatialquery/qgsspatialquery.h +++ b/src/plugins/spatialquery/qgsspatialquery.h @@ -81,7 +81,9 @@ class QgsSpatialQuery * \param lyrTarget Pointer to Target Layer * \param lyrReference Pointer to Reference Layer */ - void runQuery( QSet & qsetIndexResult, QSet & qsetIndexInvalidTarget, QSet & qsetIndexInvalidReference, + void runQuery( QgsFeatureIds &qsetIndexResult, + QgsFeatureIds &qsetIndexInvalidTarget, + QgsFeatureIds &qsetIndexInvalidReference, int relation, QgsVectorLayer* lyrTarget, QgsVectorLayer* lyrReference ); /** @@ -117,14 +119,14 @@ class QgsSpatialQuery /** * \brief Build the Spatial Index */ - void setSpatialIndexReference( QSet & qsetIndexInvalidReference ); + void setSpatialIndexReference( QgsFeatureIds &qsetIndexInvalidReference ); /** * \brief Execute query * \param qsetIndexResult Reference to QSet contains the result query * \param relation Enum Topologic Relation */ - void execQuery( QSet & qsetIndexResult, QSet & qsetIndexInvalidTarget, int relation ); + void execQuery( QgsFeatureIds &qsetIndexResult, QgsFeatureIds &qsetIndexInvalidTarget, int relation ); /** * \brief Populate index Result @@ -134,7 +136,7 @@ class QgsSpatialQuery * \param operation Pointer to function of GEOS operation */ void populateIndexResult( - QSet & qsetIndexResult, int idTarget, QgsGeometry * geomTarget, + QgsFeatureIds &qsetIndexResult, QgsFeatureId idTarget, QgsGeometry *geomTarget, bool ( QgsGeometry::* operation )( QgsGeometry * ) ); /** * \brief Populate index Result Disjoint @@ -144,7 +146,7 @@ class QgsSpatialQuery * \param operation Pointer to function of GEOS operation */ void populateIndexResultDisjoint( - QSet & qsetIndexResult, int idTarget, QgsGeometry * geomTarget, + QgsFeatureIds &qsetIndexResult, QgsFeatureId idTarget, QgsGeometry *geomTarget, bool ( QgsGeometry::* operation )( QgsGeometry * ) ); MngProgressBar *mPb; diff --git a/src/plugins/spatialquery/qgsspatialquerydialog.cpp b/src/plugins/spatialquery/qgsspatialquerydialog.cpp index 5e335f101b7..b2361d5cb80 100644 --- a/src/plugins/spatialquery/qgsspatialquerydialog.cpp +++ b/src/plugins/spatialquery/qgsspatialquerydialog.cpp @@ -251,17 +251,17 @@ void QgsSpatialQueryDialog::showResultQuery( QDateTime *datetimeStart, QDateTime } } // void QgsSpatialQueryDialog::showResultQuery(QDateTime *datetimeStart, QDateTime *datetimeEnd) -QString QgsSpatialQueryDialog::getSubsetFIDs( const QSet< int > *fids, QString fieldFID ) +QString QgsSpatialQueryDialog::getSubsetFIDs( const QgsFeatureIds *fids, QString fieldFID ) { if ( fids->size() == 0 ) { return QString( "" ); } - QSetIterator item( *fids ); + QSetIterator item( *fids ); QStringList lstFID; while ( item.hasNext() ) { - lstFID.append( QString::number( item.next() ) ); + lstFID.append( FID_TO_STRING( item.next() ) ); } QString qFormat( "%1 in (%2)" ); QString qReturn = qFormat.arg( fieldFID ).arg( lstFID.join( "," ) ); @@ -658,7 +658,7 @@ void QgsSpatialQueryDialog::setSelectedGui() pbCreateLayerSelected->setEnabled( selectedFeat > 0 ); } // void QgsSpatialQueryDialog::setSelectedGui() -void QgsSpatialQueryDialog::changeLwFeature( QgsVectorLayer* lyr, int fid ) +void QgsSpatialQueryDialog::changeLwFeature( QgsVectorLayer* lyr, QgsFeatureId fid ) { lwFeatures->setEnabled( false ); // The showRubberFeature can be slow showRubberFeature( lyr, fid ); @@ -671,7 +671,7 @@ void QgsSpatialQueryDialog::changeLwFeature( QgsVectorLayer* lyr, int fid ) lwFeatures->setFocus(); } // void QgsSpatialQueryDialog::changeLwFeature( QListWidget *listWidget, QgsVectorLayer* lyr, int fid ) -void QgsSpatialQueryDialog::zoomFeature( QgsVectorLayer* lyr, int fid ) +void QgsSpatialQueryDialog::zoomFeature( QgsVectorLayer* lyr, QgsFeatureId fid ) { static QgsVectorLayer* lyrCheck = NULL; static bool hasMsg = false; @@ -726,7 +726,7 @@ void QgsSpatialQueryDialog::zoomFeature( QgsVectorLayer* lyr, int fid ) mIface->mapCanvas()->refresh(); } // void QgsSpatialQueryDialog::zoomFeatureTarget(QgsVectorLayer* lyr, int fid) -void QgsSpatialQueryDialog::showRubberFeature( QgsVectorLayer* lyr, int id ) +void QgsSpatialQueryDialog::showRubberFeature( QgsVectorLayer* lyr, QgsFeatureId id ) { mRubberSelectId->reset(); @@ -808,7 +808,7 @@ void QgsSpatialQueryDialog::on_bbMain_clicked( QAbstractButton * button ) void QgsSpatialQueryDialog::on_pbCreateLayerItems_clicked() { TypeItems typeItem = ( TypeItems ) cbTypeItems->itemData( cbTypeItems->currentIndex() ).toInt(); - QSet * fids = 0; + QgsFeatureIds *fids = 0; switch ( typeItem ) { case itemsResult: @@ -848,7 +848,7 @@ void QgsSpatialQueryDialog::on_pbCreateLayerItems_clicked() void QgsSpatialQueryDialog::on_pbCreateLayerSelected_clicked() { - const QSet < int > *fids = & ( mLayerTarget->selectedFeaturesIds() ); + const QgsFeatureIds *fids = & ( mLayerTarget->selectedFeaturesIds() ); QString title = tr( "Create new layer from selected" ); QString msg; QString fieldFID; @@ -912,7 +912,7 @@ void QgsSpatialQueryDialog::on_cbTypeItems_currentIndexChanged( int index ) QVariant qtypItem = cbTypeItems->itemData( index ); TypeItems typeItem = ( TypeItems ) qtypItem.toInt(); - QSet * setItems = 0; + QgsFeatureIds *setItems = 0; int totalFeat = mLayerTarget->featureCount(); switch ( typeItem ) { @@ -936,7 +936,7 @@ void QgsSpatialQueryDialog::on_cbTypeItems_currentIndexChanged( int index ) if ( totalItens > 0 ) { // Populate lwFeatures - QSetIterator item( *setItems ); + QSetIterator item( *setItems ); QListWidgetItem *lwItem = NULL; while ( item.hasNext() ) { @@ -981,10 +981,8 @@ void QgsSpatialQueryDialog::on_cbOperation_currentIndexChanged() void QgsSpatialQueryDialog::on_lwFeatures_currentItemChanged( QListWidgetItem * item ) { TypeItems typeItem = ( TypeItems )( cbTypeItems->itemData( cbTypeItems->currentIndex() ).toInt() ); - QgsVectorLayer *lyr = typeItem == itemsInvalidReference - ? mLayerReference : mLayerTarget; - int fid = item->data( Qt::UserRole ).toInt(); - changeLwFeature( lyr, fid ); + QgsVectorLayer *lyr = typeItem == itemsInvalidReference ? mLayerReference : mLayerTarget; + changeLwFeature( lyr, STRING_TO_FID( item->data( Qt::UserRole ).toString() ) ); } // void QgsSpatialQueryDialog::on_lwFeatures_currentItemChanged( QListWidgetItem * item ) void QgsSpatialQueryDialog::on_ckbUsingSelectedTarget_toggled() @@ -1004,10 +1002,9 @@ void QgsSpatialQueryDialog::on_ckbZoomItem_clicked( bool checked ) { if ( lwFeatures->count() > 0 ) { - int fid = lwFeatures->currentItem()->data( Qt::UserRole ).toInt(); + QgsFeatureId fid = STRING_TO_FID( lwFeatures->currentItem()->data( Qt::UserRole ).toString() ); TypeItems typeItem = ( TypeItems )( cbTypeItems->itemData( cbTypeItems->currentIndex() ).toInt() ); - QgsVectorLayer *lyr = typeItem == itemsInvalidReference - ? mLayerReference : mLayerTarget; + QgsVectorLayer *lyr = typeItem == itemsInvalidReference ? mLayerReference : mLayerTarget; zoomFeature( lyr, fid ); } } diff --git a/src/plugins/spatialquery/qgsspatialquerydialog.h b/src/plugins/spatialquery/qgsspatialquerydialog.h index c7efc721dcd..f5b9f207850 100644 --- a/src/plugins/spatialquery/qgsspatialquerydialog.h +++ b/src/plugins/spatialquery/qgsspatialquerydialog.h @@ -92,7 +92,7 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB //! Show result of query void showResultQuery( QDateTime *datetimeStart, QDateTime *datetimeEnd ); //! Get string subset with selected FID - QString getSubsetFIDs( const QSet< int > *fids, QString fieldFID ); + QString getSubsetFIDs( const QgsFeatureIds *fids, QString fieldFID ); //! Verify can create layer subset TypeVerifyCreateSubset verifyCreateSubset( QString &msg, QString &fieldFID ); //! Add layer target with subset @@ -130,11 +130,11 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB //! Set selected GUI (lbStatusSelected and pbCreateLayerSelected) void setSelectedGui(); //! Make action when change item in List feature - void changeLwFeature( QgsVectorLayer* lyr, int fid ); + void changeLwFeature( QgsVectorLayer *lyr, QgsFeatureId fid ); //! Zoom mapcanvas to current feature in listbox target - void zoomFeature( QgsVectorLayer* lyr, int fid ); + void zoomFeature( QgsVectorLayer *lyr, QgsFeatureId fid ); //! Show rubber from feature - void showRubberFeature( QgsVectorLayer* lyr, int id ); + void showRubberFeature( QgsVectorLayer *lyr, QgsFeatureId id ); //! Pointer to Interface QGIS QgisInterface* mIface; @@ -143,11 +143,11 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB //! Reference Layer, the query will be based on it QgsVectorLayer* mLayerReference; //! Stores ID's from spatial query - QSet mFeatureResult; + QgsFeatureIds mFeatureResult; //! Stores ID's invalid of target layer - QSet mFeatureInvalidTarget; + QgsFeatureIds mFeatureInvalidTarget; //! Stores ID's invalid of reference layer - QSet mFeatureInvalidReference; + QgsFeatureIds mFeatureInvalidReference; //! Map for Id name of vector layers (use in signal_qgis_layerWillBeRemoved) QMap mMapIdVectorLayers; //! Rubber band for features result diff --git a/src/plugins/spit/qgsshapefile.cpp b/src/plugins/spit/qgsshapefile.cpp index 0603f438396..cf9e978694b 100644 --- a/src/plugins/spit/qgsshapefile.cpp +++ b/src/plugins/spit/qgsshapefile.cpp @@ -256,6 +256,7 @@ bool QgsShapeFile::insertLayer( QString dbname, QString schema, QString primary_ QString srid, PGconn * conn, QProgressDialog& pro, bool &fin, QString& errorText ) { + Q_UNUSED( dbname ); connect( &pro, SIGNAL( canceled() ), this, SLOT( cancelImport() ) ); import_canceled = false; bool result = true; diff --git a/src/plugins/spit/qgsspit.h b/src/plugins/spit/qgsspit.h index 25bf81b94ae..86ab716dd01 100644 --- a/src/plugins/spit/qgsspit.h +++ b/src/plugins/spit/qgsspit.h @@ -127,7 +127,8 @@ class ShapefileTableDelegate : public QItemDelegate public: ShapefileTableDelegate( QObject *parent, QStringList& schema_list ) : - mSchemaList( schema_list ) {} + mSchemaList( schema_list ) + { Q_UNUSED( parent ); } QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const; diff --git a/src/plugins/spit/qgsspitplugin.cpp b/src/plugins/spit/qgsspitplugin.cpp index 08bdc110034..1f25fabcb6b 100644 --- a/src/plugins/spit/qgsspitplugin.cpp +++ b/src/plugins/spit/qgsspitplugin.cpp @@ -97,6 +97,7 @@ void QgsSpitPlugin::unload() //! Set icons to the current theme void QgsSpitPlugin::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/spit.png"; QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/spit.png"; QString myQrcPath = ":/spit.png"; diff --git a/src/plugins/sqlanywhere/sasourceselect.cpp b/src/plugins/sqlanywhere/sasourceselect.cpp index 1f983056703..768ec00f181 100644 --- a/src/plugins/sqlanywhere/sasourceselect.cpp +++ b/src/plugins/sqlanywhere/sasourceselect.cpp @@ -237,6 +237,7 @@ void SaSourceSelect::on_mSearchColumnComboBox_currentIndexChanged( const QString void SaSourceSelect::on_mSearchModeComboBox_currentIndexChanged( const QString & text ) { + Q_UNUSED( text ); on_mSearchTableEdit_textChanged( mSearchTableEdit->text() ); } @@ -618,6 +619,7 @@ void SaSourceSelect::setConnectionListPosition() void SaSourceSelect::setSearchExpression( const QString& regexp ) { + Q_UNUSED( regexp ); } void SaGeomColTypeThread::setConnInfo( QString conninfo, bool estMeta, bool otherSchemas ) diff --git a/src/plugins/sqlanywhere/sasourceselect.h b/src/plugins/sqlanywhere/sasourceselect.h index 2a8b96ab919..b0a63e33784 100644 --- a/src/plugins/sqlanywhere/sasourceselect.h +++ b/src/plugins/sqlanywhere/sasourceselect.h @@ -63,6 +63,7 @@ class SaSourceSelectDelegate : public QItemDelegate const QStyleOptionViewItem &option, const QModelIndex &index ) const { + Q_UNUSED( option ); if ( index.column() == SaDbTableModel::dbtmSql ) { QLineEdit *le = new QLineEdit( parent ); diff --git a/src/plugins/wfs/qgswfsplugin.cpp b/src/plugins/wfs/qgswfsplugin.cpp index abdd8f364dd..ab2a08546bf 100644 --- a/src/plugins/wfs/qgswfsplugin.cpp +++ b/src/plugins/wfs/qgswfsplugin.cpp @@ -77,6 +77,7 @@ void QgsWFSPlugin::showSourceDialog() //! Set icons to the current theme void QgsWFSPlugin::setCurrentTheme( QString theThemeName ) { + Q_UNUSED( theThemeName ); QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/wfs.png"; QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/wfs.png"; QString myQrcPath = ":/wfs.png"; diff --git a/src/plugins/wfs/qgswfssourceselect.cpp b/src/plugins/wfs/qgswfssourceselect.cpp index ce78cc5a36c..5db732fb1a2 100644 --- a/src/plugins/wfs/qgswfssourceselect.cpp +++ b/src/plugins/wfs/qgswfssourceselect.cpp @@ -461,6 +461,7 @@ void QgsWFSSourceSelect::changeCRSFilter() void QgsWFSSourceSelect::on_cmbConnections_activated( int index ) { + Q_UNUSED( index ); QSettings s; s.setValue( "/Qgis/connections-wfs/selected", cmbConnections->currentText() ); } diff --git a/src/providers/gdal/qgsgdalprovider.cpp b/src/providers/gdal/qgsgdalprovider.cpp index b1cc91b901f..924ab3a7787 100644 --- a/src/providers/gdal/qgsgdalprovider.cpp +++ b/src/providers/gdal/qgsgdalprovider.cpp @@ -523,6 +523,7 @@ QString QgsGdalProvider::metadata() // Not supported by GDAL QImage* QgsGdalProvider::draw( QgsRectangle const & viewExtent, int pixelWidth, int pixelHeight ) { + Q_UNUSED( viewExtent ); QgsDebugMsg( "pixelWidth = " + QString::number( pixelWidth ) ); QgsDebugMsg( "pixelHeight = " + QString::number( pixelHeight ) ); QgsDebugMsg( "viewExtent: " + viewExtent.toString() ); @@ -1229,11 +1230,13 @@ bool QgsGdalProvider::isValid() QString QgsGdalProvider::identifyAsText( const QgsPoint& point ) { + Q_UNUSED( point ); return QString( "Not implemented" ); } QString QgsGdalProvider::identifyAsHtml( const QgsPoint& point ) { + Q_UNUSED( point ); return QString( "Not implemented" ); } diff --git a/src/providers/gdal/qgsgdalprovider.h b/src/providers/gdal/qgsgdalprovider.h index fa5e1454fd6..9d5a24ecd35 100644 --- a/src/providers/gdal/qgsgdalprovider.h +++ b/src/providers/gdal/qgsgdalprovider.h @@ -208,11 +208,14 @@ class QgsGdalProvider : public QgsRasterDataProvider QString metadata(); // Following methods specific for WMS are not used at all in this provider and should be removed IMO from qgsdataprovider.h - void addLayers( QStringList const & layers, QStringList const & styles = QStringList() ) {} - QStringList supportedImageEncodings() { return QStringList();} + void addLayers( QStringList const &layers, QStringList const &styles = QStringList() ) + { Q_UNUSED( layers ); Q_UNUSED( styles ); } + QStringList supportedImageEncodings() { return QStringList(); } QString imageEncoding() const { return QString(); } - void setImageEncoding( QString const & mimeType ) {} - void setImageCrs( QString const & crs ) {} + void setImageEncoding( QString const &mimeType ) + { Q_UNUSED( mimeType ); } + void setImageCrs( QString const &crs ) + { Q_UNUSED( crs ); } /** \brief ensures that GDAL drivers are registered, but only once */ static void registerGdalDrivers(); diff --git a/src/providers/gpx/gpsdata.cpp b/src/providers/gpx/gpsdata.cpp index 962552ba600..a64cd567bd3 100644 --- a/src/providers/gpx/gpsdata.cpp +++ b/src/providers/gpx/gpsdata.cpp @@ -274,7 +274,7 @@ QgsGPSData::TrackIterator QgsGPSData::addTrack( QString name ) } -QgsGPSData::TrackIterator QgsGPSData::addTrack( const QgsTrack& trk ) +QgsGPSData::TrackIterator QgsGPSData::addTrack( const QgsTrack &trk ) { xMax = xMax > trk.xMax ? xMax : trk.xMax; xMin = xMin < trk.xMin ? xMin : trk.xMin; @@ -286,11 +286,11 @@ QgsGPSData::TrackIterator QgsGPSData::addTrack( const QgsTrack& trk ) } -void QgsGPSData::removeWaypoints( const QgsFeatureIds & ids ) +void QgsGPSData::removeWaypoints( const QgsFeatureIds &ids ) { - QList ids2 = ids.toList(); + QList ids2 = ids.toList(); qSort( ids2 ); - QList::const_iterator iter = ids2.begin(); + QList::const_iterator iter = ids2.begin(); WaypointIterator wIter; for ( wIter = waypoints.begin(); wIter != waypoints.end() && iter != ids2.end(); ) @@ -307,11 +307,11 @@ void QgsGPSData::removeWaypoints( const QgsFeatureIds & ids ) } -void QgsGPSData::removeRoutes( const QgsFeatureIds & ids ) +void QgsGPSData::removeRoutes( const QgsFeatureIds &ids ) { - QList ids2 = ids.toList(); + QList ids2 = ids.toList(); qSort( ids2 ); - QList::const_iterator iter = ids2.begin(); + QList::const_iterator iter = ids2.begin(); RouteIterator rIter; for ( rIter = routes.begin(); rIter != routes.end() && iter != ids2.end(); ) { @@ -327,11 +327,11 @@ void QgsGPSData::removeRoutes( const QgsFeatureIds & ids ) } -void QgsGPSData::removeTracks( const QgsFeatureIds & ids ) +void QgsGPSData::removeTracks( const QgsFeatureIds &ids ) { - QList ids2 = ids.toList(); + QList ids2 = ids.toList(); qSort( ids2 ); - QList::const_iterator iter = ids2.begin(); + QList::const_iterator iter = ids2.begin(); TrackIterator tIter; for ( tIter = tracks.begin(); tIter != tracks.end() && iter != ids2.end(); ) { @@ -412,7 +412,9 @@ QgsGPSData* QgsGPSData::getData( const QString& fileName ) dataObjects[fileName] = std::pair( data, 0 ); } else + { QgsDebugMsg( fileName + " is already loaded" ); + } // return a pointer and increase the reference count for that file name DataMap::iterator iter = dataObjects.find( fileName ); @@ -674,6 +676,8 @@ void QgsGPXHandler::characters( const XML_Char* chars, int len ) bool QgsGPXHandler::endElement( const std::string& qName ) { + Q_UNUSED( qName ); + if ( parseModes.top() == ParsingWaypoint ) { mData.addWaypoint( mWpt ); diff --git a/src/providers/gpx/gpsdata.h b/src/providers/gpx/gpsdata.h index c3b6441f480..3657d398228 100644 --- a/src/providers/gpx/gpsdata.h +++ b/src/providers/gpx/gpsdata.h @@ -18,18 +18,14 @@ #ifndef GPSDATA_H #define GPSDATA_H -#include #include -#include -#include -#include -#include -#include #include #include #include +#include +#include "qgsfeature.h" #include "qgsrectangle.h" // workaround for MSVC compiler which already has defined macro max @@ -40,8 +36,6 @@ # endif #endif -typedef QSet QgsFeatureIds; - /** This is the parent class for all GPS data classes (except tracksegment). It contains the variables that all GPS objects can have. */ @@ -91,7 +85,7 @@ class QgsWaypoint : public QgsGPSPoint { public: virtual void writeXML( QTextStream& stream ); - int id; + QgsFeatureId id; }; @@ -102,7 +96,7 @@ class QgsRoute : public QgsGPSExtended public: virtual void writeXML( QTextStream& stream ); std::vector points; - int id; + QgsFeatureId id; }; @@ -124,7 +118,7 @@ class QgsTrack : public QgsGPSExtended public: virtual void writeXML( QTextStream& stream ); std::vector segments; - int id; + QgsFeatureId id; }; @@ -310,7 +304,7 @@ class QgsGPXHandler }; /** This is used to keep track of what kind of data we are parsing. */ - std::stack parseModes; + QStack parseModes; QgsGPSData& mData; QgsWaypoint mWpt; diff --git a/src/providers/gpx/qgsgpxprovider.cpp b/src/providers/gpx/qgsgpxprovider.cpp index ecd695058e4..91b42bcbf00 100644 --- a/src/providers/gpx/qgsgpxprovider.cpp +++ b/src/providers/gpx/qgsgpxprovider.cpp @@ -415,6 +415,7 @@ void QgsGPXProvider::select( QgsAttributeList fetchAttributes, bool fetchGeometry, bool useIntersect ) { + Q_UNUSED( useIntersect ); delete mSelectionRectangle; mSelectionRectangle = 0; @@ -715,7 +716,7 @@ bool QgsGPXProvider::deleteFeatures( const QgsFeatureIds & id ) } -bool QgsGPXProvider::changeAttributeValues( const QgsChangedAttributesMap & attr_map ) +bool QgsGPXProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_map ) { QgsChangedAttributesMap::const_iterator aIter = attr_map.begin(); if ( mFeatureType == WaypointType ) diff --git a/src/providers/grass/qgsgrassrasterprovider.cpp b/src/providers/grass/qgsgrassrasterprovider.cpp index ea9321342df..5e4a797b57e 100644 --- a/src/providers/grass/qgsgrassrasterprovider.cpp +++ b/src/providers/grass/qgsgrassrasterprovider.cpp @@ -152,6 +152,7 @@ QImage* QgsGrassRasterProvider::draw( QgsRectangle const & viewExtent, int pixe void QgsGrassRasterProvider::readBlock( int bandNo, int xBlock, int yBlock, void *block ) { + Q_UNUSED( xBlock ); QgsDebugMsg( "Entered" ); // TODO: optimize, see extent() @@ -270,15 +271,18 @@ double QgsGrassRasterProvider::noDataValue() const double QgsGrassRasterProvider::minimumValue( int bandNo ) const { + Q_UNUSED( bandNo ); return mInfo["MIN_VALUE"].toDouble(); } double QgsGrassRasterProvider::maximumValue( int bandNo ) const { + Q_UNUSED( bandNo ); return mInfo["MAX_VALUE"].toDouble(); } QList QgsGrassRasterProvider::colorTable( int bandNo )const { + Q_UNUSED( bandNo ); QgsDebugMsg( "Entered" ); QList ct; @@ -376,6 +380,7 @@ int QgsGrassRasterProvider::dataType( int bandNo ) const int QgsGrassRasterProvider::srcDataType( int bandNo ) const { + Q_UNUSED( bandNo ); switch ( mGrassDataType ) { case CELL_TYPE: @@ -434,6 +439,7 @@ void QgsGrassRasterProvider::populateHistogram( int theBandNoInt, bool theIgnoreOutOfRangeFlag, bool theHistogramEstimatedFlag ) { + Q_UNUSED( theBandNoInt ); // TODO: we could either implement it in QgsRasterDataProvider::populateHistogram // or use r.stats (see d.histogram) if ( theBandStats.histogramVector->size() != theBinCount || @@ -461,11 +467,13 @@ bool QgsGrassRasterProvider::isValid() QString QgsGrassRasterProvider::identifyAsText( const QgsPoint& point ) { + Q_UNUSED( point ); return QString( "Not implemented" ); } QString QgsGrassRasterProvider::identifyAsHtml( const QgsPoint& point ) { + Q_UNUSED( point ); return QString( "Not implemented" ); } diff --git a/src/providers/grass/qgsgrassrasterprovider.h b/src/providers/grass/qgsgrassrasterprovider.h index 31f5f003458..f4787969a37 100644 --- a/src/providers/grass/qgsgrassrasterprovider.h +++ b/src/providers/grass/qgsgrassrasterprovider.h @@ -221,11 +221,14 @@ class QgsGrassRasterProvider : public QgsRasterDataProvider QString metadata(); // Following methods specific for are not used at all in this provider and should be removed IMO from qgsdataprovider.h - void addLayers( QStringList const & layers, QStringList const & styles = QStringList() ) {} + void addLayers( QStringList const &layers, QStringList const &styles = QStringList() ) + { Q_UNUSED( layers ); Q_UNUSED( styles ); } QStringList supportedImageEncodings() { return QStringList();} QString imageEncoding() const { return QString(); } - void setImageEncoding( QString const & mimeType ) {} - void setImageCrs( QString const & crs ) {} + void setImageEncoding( QString const &mimeType ) + { Q_UNUSED( mimeType ); } + void setImageCrs( QString const &crs ) + { Q_UNUSED( crs ); } void populateHistogram( int theBandNoInt, QgsRasterBandStats & theBandStats, diff --git a/src/providers/memory/qgsmemoryprovider.cpp b/src/providers/memory/qgsmemoryprovider.cpp index b10e984a431..84ad5f31e6a 100644 --- a/src/providers/memory/qgsmemoryprovider.cpp +++ b/src/providers/memory/qgsmemoryprovider.cpp @@ -293,11 +293,13 @@ bool QgsMemoryProvider::nextFeature( QgsFeature& feature ) } -bool QgsMemoryProvider::featureAtId( int featureId, +bool QgsMemoryProvider::featureAtId( QgsFeatureId featureId, QgsFeature& feature, bool fetchGeometry, QgsAttributeList fetchAttributes ) { + Q_UNUSED( fetchGeometry ); + Q_UNUSED( fetchAttributes ); feature.setValid( false ); QgsFeatureMap::iterator it = mFeatures.find( featureId ); @@ -402,7 +404,6 @@ bool QgsMemoryProvider::addFeatures( QgsFeatureList & flist ) mNextFeatureId++; } - updateExtent(); return true; diff --git a/src/providers/memory/qgsmemoryprovider.h b/src/providers/memory/qgsmemoryprovider.h index bed4a03b16c..91ae922ed15 100644 --- a/src/providers/memory/qgsmemoryprovider.h +++ b/src/providers/memory/qgsmemoryprovider.h @@ -17,7 +17,7 @@ #include "qgscoordinatereferencesystem.h" -typedef QMap QgsFeatureMap; +typedef QMap QgsFeatureMap; class QgsSpatialIndex; @@ -73,7 +73,7 @@ class QgsMemoryProvider : public QgsVectorDataProvider * @param fetchAttributes a list containing the indexes of the attribute fields to copy * @return True when feature was found, otherwise false */ - virtual bool featureAtId( int featureId, + virtual bool featureAtId( QgsFeatureId featureId, QgsFeature& feature, bool fetchGeometry = true, QgsAttributeList fetchAttributes = QgsAttributeList() ); @@ -202,7 +202,7 @@ class QgsMemoryProvider : public QgsVectorDataProvider // features QgsFeatureMap mFeatures; - int mNextFeatureId; + QgsFeatureId mNextFeatureId; // selection QgsAttributeList mSelectAttrs; @@ -211,8 +211,8 @@ class QgsMemoryProvider : public QgsVectorDataProvider bool mSelectGeometry, mSelectUseIntersect; QgsFeatureMap::iterator mSelectIterator; bool mSelectUsingSpatialIndex; - QList mSelectSI_Features; - QList::iterator mSelectSI_Iterator; + QList mSelectSI_Features; + QList::iterator mSelectSI_Iterator; // indexing QgsSpatialIndex* mSpatialIndex; diff --git a/src/providers/ogr/qgsogrprovider.cpp b/src/providers/ogr/qgsogrprovider.cpp index 6170918e204..0401547c726 100644 --- a/src/providers/ogr/qgsogrprovider.cpp +++ b/src/providers/ogr/qgsogrprovider.cpp @@ -960,14 +960,20 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap & attr for ( QgsChangedAttributesMap::const_iterator it = attr_map.begin(); it != attr_map.end(); ++it ) { - long fid = ( long ) it.key(); + QgsFeatureId fid = it.key(); - OGRFeatureH of = OGR_L_GetFeature( ogrLayer, fid ); + if ( FID_TO_NUMBER( fid ) > std::numeric_limits::max() ) + { + QgsLogger::warning( "QgsOgrProvider::changeAttributeValues, feature id too large for OGR" ); + continue; + } + + OGRFeatureH of = OGR_L_GetFeature( ogrLayer, static_cast( FID_TO_NUMBER( fid ) ) ); if ( !of ) { QgsLogger::warning( "QgsOgrProvider::changeAttributeValues, Cannot read feature, cannot change attributes" ); - return false; + continue; } const QgsAttributeMap& attr = it.value(); @@ -1031,7 +1037,13 @@ bool QgsOgrProvider::changeGeometryValues( QgsGeometryMap & geometry_map ) for ( QgsGeometryMap::iterator it = geometry_map.begin(); it != geometry_map.end(); ++it ) { - theOGRFeature = OGR_L_GetFeature( ogrLayer, it.key() ); + if ( FID_TO_NUMBER( it.key() ) > std::numeric_limits::max() ) + { + QgsLogger::warning( "QgsOgrProvider::changeGeometryValues, fid too large for OGR" ); + continue; + } + + theOGRFeature = OGR_L_GetFeature( ogrLayer, static_cast( FID_TO_NUMBER( it.key() ) ) ); if ( !theOGRFeature ) { QgsLogger::warning( "QgsOgrProvider::changeGeometryValues, cannot find feature" ); @@ -1146,9 +1158,15 @@ bool QgsOgrProvider::deleteFeatures( const QgsFeatureIds & id ) return returnvalue; } -bool QgsOgrProvider::deleteFeature( int id ) +bool QgsOgrProvider::deleteFeature( QgsFeatureId id ) { - return OGR_L_DeleteFeature( ogrLayer, id ) == OGRERR_NONE; + if ( FID_TO_NUMBER( id ) > std::numeric_limits::max() ) + { + QgsDebugMsg( "id too large for OGR" ); + return false; + } + + return OGR_L_DeleteFeature( ogrLayer, FID_TO_NUMBER( id ) ) == OGRERR_NONE; } int QgsOgrProvider::capabilities() const diff --git a/src/providers/ogr/qgsogrprovider.h b/src/providers/ogr/qgsogrprovider.h index 92000374f82..d3d0e5817b3 100644 --- a/src/providers/ogr/qgsogrprovider.h +++ b/src/providers/ogr/qgsogrprovider.h @@ -296,7 +296,7 @@ class QgsOgrProvider : public QgsVectorDataProvider /**Adds one feature*/ bool addFeature( QgsFeature& f ); /**Deletes one feature*/ - bool deleteFeature( int id ); + bool deleteFeature( QgsFeatureId id ); QString quotedIdentifier( QString field ); diff --git a/src/providers/osm/osmhandler.cpp b/src/providers/osm/osmhandler.cpp index b15fcafbae4..c6bff25b8f8 100644 --- a/src/providers/osm/osmhandler.cpp +++ b/src/providers/osm/osmhandler.cpp @@ -35,6 +35,7 @@ // object construction OsmHandler::OsmHandler( QFile *f, sqlite3 *database ) { + Q_UNUSED( f ); mDatabase = database; mCnt = 0; mPointCnt = mLineCnt = mPolygonCnt = 0; @@ -114,6 +115,8 @@ QString OsmHandler::errorString() bool OsmHandler::startElement( const QString & pUri, const QString & pLocalName, const QString & pName, const QXmlAttributes & pAttrs ) { + Q_UNUSED( pUri ); + Q_UNUSED( pName ); QString name = pLocalName; if ( name == "osm" ) @@ -309,6 +312,8 @@ bool OsmHandler::startElement( const QString & pUri, const QString & pLocalName, bool OsmHandler::endElement( const QString & pURI, const QString & pLocalName, const QString & pName ) { + Q_UNUSED( pURI ); + Q_UNUSED( pName ); QString name = pLocalName; if ( name == "way" ) { diff --git a/src/providers/osm/osmprovider.cpp b/src/providers/osm/osmprovider.cpp index 2ad5f93ef33..ed9fc18bb9e 100644 --- a/src/providers/osm/osmprovider.cpp +++ b/src/providers/osm/osmprovider.cpp @@ -84,13 +84,21 @@ QgsOSMDataProvider::QgsOSMDataProvider( QString uri ) if ( propName == "type" ) { if ( propValue == "line" ) + { mFeatureType = LineType; + } else if ( propValue == "point" ) + { mFeatureType = PointType; + } else if ( propValue == "polygon" ) + { mFeatureType = PolygonType; + } else + { QgsDebugMsg( "Unknown feature type: " + propValue ); + } } if ( propName == "observer" ) { diff --git a/src/providers/osm/osmrenderer.cpp b/src/providers/osm/osmrenderer.cpp index d4b3c550eab..611a3d3c6dc 100644 --- a/src/providers/osm/osmrenderer.cpp +++ b/src/providers/osm/osmrenderer.cpp @@ -85,12 +85,14 @@ QMap OsmRenderer::parse_tags( QString tags ) bool OsmRenderer::willRenderFeature( QgsFeature *f ) { + Q_UNUSED( f ); return true; } void OsmRenderer::renderFeature( QgsRenderContext &renderContext, QgsFeature& f, QImage* pic, bool selected, double opacity ) { + Q_UNUSED( selected ); QPainter* p = renderContext.painter(); QgsAttributeMap attr_map = f.attributeMap(); QMap tags = parse_tags( attr_map[2].toString() ); @@ -119,12 +121,17 @@ void OsmRenderer::renderFeature( QgsRenderContext &renderContext, QgsFeature& f, int OsmRenderer::readXML( const QDomNode &rnode, QgsVectorLayer &vl ) { + Q_UNUSED( rnode ); + Q_UNUSED( vl ); return 0; } bool OsmRenderer::writeXML( QDomNode &layer_node, QDomDocument &document, const QgsVectorLayer &vl ) const { + Q_UNUSED( layer_node ); + Q_UNUSED( document ); + Q_UNUSED( vl ); return true; } diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp index 1cfe268caed..65296e8648c 100644 --- a/src/providers/postgres/qgspostgresprovider.cpp +++ b/src/providers/postgres/qgspostgresprovider.cpp @@ -452,25 +452,31 @@ bool QgsPostgresProvider::declareCursor( return true; } -bool QgsPostgresProvider::getFeature( PGresult *queryResult, int row, bool fetchGeometry, - QgsFeature &feature, - const QgsAttributeList &fetchAttributes ) +qint64 QgsPostgresProvider::getBinaryInt( PGresult *queryResult, int row, int col ) { - try - { - int oid; + qint64 oid; + char *p = PQgetvalue( queryResult, row, col ); + size_t s = PQgetlength( queryResult, row, col ); - if ( primaryKeyType != "tid" ) - { - oid = *( int * )PQgetvalue( queryResult, row, 0 ); + QString buf = ""; + for ( size_t i = 0; i < s; i++ ) + { + buf += QString( "%1 " ).arg( *( char * )( p + i ), 0, 16, QLatin1Char( ' ' ) ); + } + QgsDebugMsg( QString( "int in hex:%1" ).arg( buf ) ); + + switch ( s ) + { + case 2: + oid = *( qint16 * )p; if ( swapEndian ) - oid = ntohl( oid ); // convert oid to opposite endian - } - else if ( PQgetlength( queryResult, row, 0 ) == 6 ) + oid = ntohs( oid ); + break; + + case 6: { - char *data = PQgetvalue( queryResult, row, 0 ); - int block = *( int * )data; - int offset = *( short * )( data + sizeof( int ) ); + qint64 block = *( qint32 * ) p; + qint64 offset = *( qint16 * )( p + sizeof( qint32 ) ); if ( swapEndian ) { @@ -478,19 +484,53 @@ bool QgsPostgresProvider::getFeature( PGresult *queryResult, int row, bool fetch offset = ntohs( offset ); } - if ( block > 0xffff ) - { - QgsDebugMsg( QString( "block number %1 exceeds 16 bit" ).arg( block ) ); - return false; - } - oid = ( block << 16 ) + offset; } - else + break; + + case 8: { - QgsDebugMsg( QString( "expecting 6 bytes for tid (found %1 bytes)" ).arg( PQgetlength( queryResult, row, 0 ) ) ); - return false; + qint32 oid0 = htonl( *( qint32 * ) p ); + qint32 oid1 = htonl( *( qint32 * )( p + sizeof( qint32 ) ) ); + + if ( swapEndian ) + { + QgsDebugMsg( QString( "swap oid0:%1 oid1:%2" ).arg( oid0 ).arg( oid1 ) ); + oid0 = ntohl( oid0 ); + oid1 = ntohl( oid1 ); + } + + QgsDebugMsg( QString( "oid0:%1 oid1:%2" ).arg( oid0 ).arg( oid1 ) ); + oid = oid0; + QgsDebugMsg( QString( "oid:%1" ).arg( oid ) ); + oid <<= 32; + QgsDebugMsg( QString( "oid:%1" ).arg( oid ) ); + oid |= oid1; + QgsDebugMsg( QString( "oid:%1" ).arg( oid ) ); } + break; + + default: + QgsDebugMsg( QString( "unexpected size %d" ).arg( s ) ); + + case 4: + oid = *( qint32 * )p; + if ( swapEndian ) + oid = ntohl( oid ); + break; + } + + return oid; +} + +bool QgsPostgresProvider::getFeature( PGresult *queryResult, int row, bool fetchGeometry, + QgsFeature &feature, + const QgsAttributeList &fetchAttributes ) +{ + try + { + QgsFeatureId oid = getBinaryInt( queryResult, row, 0 ); + QgsDebugMsg( QString( "oid=%1" ).arg( oid ) ); feature.setFeatureId( oid ); feature.clearAttributeMap(); @@ -528,7 +568,7 @@ bool QgsPostgresProvider::getFeature( PGresult *queryResult, int row, bool fetch if ( fld.name() == primaryKey ) { // primary key was already processed - feature.addAttribute( *it, convertValue( fld.type(), QString::number( oid ) ) ); + feature.addAttribute( *it, convertValue( fld.type(), FID_TO_STRING( oid ) ) ); continue; } @@ -692,7 +732,7 @@ bool QgsPostgresProvider::nextFeature( QgsFeature& feature ) return true; } -QString QgsPostgresProvider::whereClause( int featureId ) const +QString QgsPostgresProvider::whereClause( QgsFeatureId featureId ) const { QString whereClause; @@ -702,7 +742,10 @@ QString QgsPostgresProvider::whereClause( int featureId ) const } else { - whereClause = QString( "%1='(%2,%3)'" ).arg( quotedIdentifier( primaryKey ) ).arg( featureId >> 16 ).arg( featureId & 0xffff ); + whereClause = QString( "%1='(%2,%3)'" ) + .arg( quotedIdentifier( primaryKey ) ) + .arg( FID_TO_NUMBER( featureId ) >> 16 ) + .arg( FID_TO_NUMBER( featureId ) & 0xffff ); } if ( !sqlWhereClause.isEmpty() ) @@ -1246,9 +1289,9 @@ QString QgsPostgresProvider::getPrimaryKey() showMessageBox( tr( "No suitable key column in table" ), tr( "The table has no column suitable for use as a key.\n\n" "Quantum GIS requires that the table either has a column of type\n" - "int4 with a unique constraint on it (which includes the\n" + "integer with an unique constraint on it (which includes the\n" "primary key), has a PostgreSQL oid column or has a ctid\n" - "column with a 16bit block number.\n" ) ); + "column.\n" ) ); } else { @@ -1284,7 +1327,7 @@ QString QgsPostgresProvider::getPrimaryKey() // mPrimaryKeyDefault stays null and is retrieved later on demand // if mUseEstimatedMetadata is on assume that the already keyfield is still unique - if (( type != "int4" && type != "oid" ) || + if (( type != "int2" && type != "int4" && type != "int8" && type != "oid" ) || ( !mUseEstimatedMetadata && !uniqueData( mQuery, primaryKey ) ) ) { primaryKey = ""; @@ -1297,7 +1340,9 @@ QString QgsPostgresProvider::getPrimaryKey() } } else + { QgsDebugMsg( "Unexpected relation type of '" + type + "'." ); + } } else // have some unique indices on the table. Now choose one... { @@ -1319,9 +1364,9 @@ QString QgsPostgresProvider::getPrimaryKey() QString columnName = QString::fromUtf8( PQgetvalue( types, 0, 0 ) ); QString columnType = QString::fromUtf8( PQgetvalue( types, 0, 1 ) ); - if ( columnType != "int4" ) + if ( columnType != "int2" && columnType != "int4" && columnType != "int8" ) log.append( tr( "The unique index on column '%1' is unsuitable because Quantum GIS does not currently " - "support non-int4 type columns as a key into the table.\n" ).arg( columnName ) ); + "support non-integer typed columns as a key into the table.\n" ).arg( columnName ) ); else { mIsDbPrimaryKey = true; @@ -1383,7 +1428,7 @@ QString QgsPostgresProvider::getPrimaryKey() { log.prepend( "There were no columns in the table that were suitable " "as a qgis key into the table (either a column with a " - "unique index and type int4 or a PostgreSQL oid column.\n" ); + "unique index and type integer or a PostgreSQL oid column.\n" ); } } @@ -1518,7 +1563,7 @@ QString QgsPostgresProvider::chooseViewColumn( const tableCols &cols ) // This sql returns one or more rows if the column 'tableCol' in // table 'tableName' and schema 'schemaName' has one or more // columns that satisfy the following conditions: - // 1) the column has data type of int4. + // 1) the column has data type of integer. // 2) the column has a unique constraint or primary key constraint // on it. // 3) the constraint applies just to the column of interest (i.e., @@ -1529,12 +1574,14 @@ QString QgsPostgresProvider::chooseViewColumn( const tableCols &cols ) "and array_dims(conkey)='[1:1]'" ).arg( quotedValue( tableCol ) ).arg( rel_oid ); result = connectionRO->PQexec( sql ); - if ( PQntuples( result ) == 1 && colType == "int4" ) + if ( PQntuples( result ) == 1 && + ( colType == "int2" || colType == "int4" || colType == "int8" ) ) suitable[viewCol] = iter->second; QString details = tr( "'%1' derives from '%2.%3.%4' " ).arg( viewCol ).arg( schemaName ).arg( tableName ).arg( tableCol ); - if ( PQntuples( result ) == 1 && colType == "int4" ) + if ( PQntuples( result ) == 1 && + ( colType == "int2" || colType == "int4" || colType == "int8" ) ) { details += tr( "and is suitable." ); } @@ -1642,7 +1689,7 @@ QString QgsPostgresProvider::chooseViewColumn( const tableCols &cols ) log.prepend( tr( "The view '%1.%2' has no column suitable for use as a unique key.\n" "Quantum GIS requires that the view has a column that can be used " "as a unique key. Such a column should be derived from " - "a table column of type int4 and be a primary key, " + "a table column of type integer and be a primary key, " "have a unique constraint on it, or be a PostgreSQL " "oid column. To improve performance the column should also be indexed.\n" "The view you selected has the following columns, none " @@ -1655,6 +1702,7 @@ QString QgsPostgresProvider::chooseViewColumn( const tableCols &cols ) bool QgsPostgresProvider::uniqueData( QString query, QString colName ) { + Q_UNUSED( query ); // Check to see if the given column contains unique data QString sql = QString( "select count(distinct %1)=count(%1) from %2" ) .arg( quotedIdentifier( colName ) ) @@ -1679,6 +1727,9 @@ bool QgsPostgresProvider::uniqueData( QString query, QString colName ) int QgsPostgresProvider::SRCFromViewColumn( const QString& ns, const QString& relname, const QString& attname_table, const QString& attname_view, const QString& viewDefinition, SRC& result ) const { + Q_UNUSED( attname_table ); + Q_UNUSED( attname_view ); + Q_UNUSED( viewDefinition ); QString newViewDefSql = QString( "SELECT definition FROM pg_views WHERE schemaname=%1 AND viewname=%2" ) .arg( quotedValue( ns ) ).arg( quotedValue( relname ) ); Result newViewDefResult = connectionRO->PQexec( newViewDefSql ); @@ -2657,10 +2708,10 @@ bool QgsPostgresProvider::changeAttributeValues( const QgsChangedAttributesMap & // cycle through the features for ( QgsChangedAttributesMap::const_iterator iter = attr_map.begin(); iter != attr_map.end(); ++iter ) { - int fid = iter.key(); + QgsFeatureId fid = iter.key(); // skip added features - if ( fid < 0 ) + if ( FID_IS_NEW( fid ) ) continue; QString sql = QString( "UPDATE %1 SET " ).arg( mQuery ); @@ -2777,7 +2828,7 @@ bool QgsPostgresProvider::changeGeometryValues( QgsGeometryMap & geometry_map ) if ( iter->asWkb() ) { - QgsDebugMsg( "iterating over feature id " + QString::number( iter.key() ) ); + QgsDebugMsg( "iterating over feature id " + FID_TO_STRING( iter.key() ) ); QString geomParam; appendGeomString( &*iter, geomParam ); @@ -2786,11 +2837,11 @@ bool QgsPostgresProvider::changeGeometryValues( QgsGeometryMap & geometry_map ) params << geomParam; if ( primaryKeyType != "tid" ) { - params << QString( "%1" ).arg( iter.key() ); + params << FID_TO_STRING( iter.key() ); } else { - params << QString( "(%1,%2)" ).arg( iter.key() >> 16 ).arg( iter.key() & 0xffff ); + params << QString( "(%1,%2)" ).arg( FID_TO_NUMBER( iter.key() ) >> 16 ).arg( FID_TO_NUMBER( iter.key() ) & 0xffff ); } PGresult *result = connectionRW->PQexecPrepared( "updatefeatures", params ); @@ -2893,7 +2944,7 @@ long QgsPostgresProvider::featureCount() const // use estimated metadata even when there is a where clause, // although we get an incorrect feature count for the subset // - but make huge dataset usable. - if ( !isQuery && mUseEstimatedMetadata ) + if ( !isQuery && mUseEstimatedMetadata ) { sql = QString( "select reltuples::int from pg_catalog.pg_class where oid=regclass(%1)::oid" ).arg( quotedValue( mQuery ) ); } @@ -3088,14 +3139,13 @@ bool QgsPostgresProvider::deduceEndian() if ( PQntuples( fResult ) > 0 ) { // get the oid value from the binary cursor - int oid = *( int * )PQgetvalue( fResult, 0, 0 ); + qint64 oid = getBinaryInt( fResult, 0, 0 ); - //--std::cout << "Got oid of " << oid << " from the binary cursor" << std::endl; - - //--std::cout << "First oid is " << oidValue << std::endl; + QgsDebugMsg( QString( "Got oid of %1 from the binary cursor" ).arg( oid ) ); + QgsDebugMsg( QString( "First oid is %1" ).arg( oidValue ) ); // compare the two oid values to determine if we need to do an endian swap - if ( oid == oidValue.toInt() ) + if ( oid == oidValue.toLongLong() ) swapEndian = false; } connectionRO->closeCursor( "oidcursor" ); diff --git a/src/providers/postgres/qgspostgresprovider.h b/src/providers/postgres/qgspostgresprovider.h index 41ff5ebd8f2..b21fd94ca84 100644 --- a/src/providers/postgres/qgspostgresprovider.h +++ b/src/providers/postgres/qgspostgresprovider.h @@ -161,7 +161,7 @@ class QgsPostgresProvider : public QgsVectorDataProvider * Get the field information for the layer * @return vector of QgsField objects */ - const QgsFieldMap & fields() const; + const QgsFieldMap &fields() const; /** * Return a short comment for the data that this provider is @@ -327,10 +327,12 @@ class QgsPostgresProvider : public QgsVectorDataProvider QgsFeature &feature, const QgsAttributeList &fetchAttributes ); - QString whereClause( int featureId ) const; + QString whereClause( QgsFeatureId featureId ) const; bool hasSufficientPermsAndCapabilities(); + qint64 getBinaryInt( PGresult *queryResult, int row, int col ); + const QgsField &field( int index ) const; /** Double quote a PostgreSQL identifier for placement in a SQL string. diff --git a/src/providers/spatialite/qgsspatialiteprovider.cpp b/src/providers/spatialite/qgsspatialiteprovider.cpp index 577ae19b888..838e2ba84a7 100644 --- a/src/providers/spatialite/qgsspatialiteprovider.cpp +++ b/src/providers/spatialite/qgsspatialiteprovider.cpp @@ -568,6 +568,7 @@ int QgsSpatiaLiteProvider::computeSizeFromGeosWKB2D( const unsigned char *blob, size_t size, int type, int nDims, int little_endian, int endian_arch ) { + Q_UNUSED( size ); // calculating the size required to store this WKB int rings; int points; @@ -740,6 +741,7 @@ int QgsSpatiaLiteProvider::computeSizeFromGeosWKB3D( const unsigned char *blob, size_t size, int type, int nDims, int little_endian, int endian_arch ) { + Q_UNUSED( size ); // calculating the size required to store this WKB int rings; int points; @@ -984,6 +986,8 @@ void QgsSpatiaLiteProvider::convertFromGeosWKB2D( const unsigned char *blob, int little_endian, int endian_arch ) { + Q_UNUSED( blob_size ); + Q_UNUSED( geom_size ); // attempting to convert from 2D GEOS own WKB int type; int entities; @@ -1527,6 +1531,8 @@ void QgsSpatiaLiteProvider::convertFromGeosWKB3D( const unsigned char *blob, int little_endian, int endian_arch ) { + Q_UNUSED( blob_size ); + Q_UNUSED( geom_size ); // attempting to convert from 3D GEOS own WKB int type; int entities; @@ -3420,7 +3426,7 @@ abort: return false; } -bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds & id ) +bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds &id ) { sqlite3_stmt *stmt = NULL; char *errMsg = NULL; @@ -3452,7 +3458,8 @@ bool QgsSpatiaLiteProvider::deleteFeatures( const QgsFeatureIds & id ) sqlite3_reset( stmt ); sqlite3_clear_bindings( stmt ); - sqlite3_bind_int( stmt, 1, *it ); + qint64 fid = FID_TO_NUMBER( *it ); + sqlite3_bind_int64( stmt, 1, fid ); // performing actual row deletion ret = sqlite3_step( stmt ); @@ -3569,10 +3576,10 @@ bool QgsSpatiaLiteProvider::changeAttributeValues( const QgsChangedAttributesMap for ( QgsChangedAttributesMap::const_iterator iter = attr_map.begin(); iter != attr_map.end(); ++iter ) { - int fid = iter.key(); + QgsFeatureId fid = iter.key(); // skip added features - if ( fid < 0 ) + if ( FID_IS_NEW( fid ) ) continue; QString sql = QString( "UPDATE %1 SET " ).arg( quotedIdentifier( mTableName ) ); @@ -3696,7 +3703,7 @@ bool QgsSpatiaLiteProvider::changeGeometryValues( QgsGeometryMap & geometry_map sqlite3_bind_null( stmt, 1 ); else sqlite3_bind_blob( stmt, 1, wkb, wkb_size, free ); - sqlite3_bind_int( stmt, 2, iter.key() ); + sqlite3_bind_int64( stmt, 2, FID_TO_NUMBER( iter.key() ) ); // performing actual row update ret = sqlite3_step( stmt ); diff --git a/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp b/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp index 3148d89000a..59f241ab0f9 100644 --- a/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp +++ b/src/providers/sqlanywhere/qgssqlanywhereprovider.cpp @@ -1521,7 +1521,7 @@ QgsSqlAnywhereProvider::changeGeometryValues( QgsGeometryMap & gmap ) ; ok && it != gmap.constEnd() ; it++ ) { - int key = it.key(); + QgsFeatureId key = it.key(); QgsGeometry geom = *it; QString wkt = geom.exportToWkt(); QByteArray wktBa = wkt.toUtf8(); diff --git a/src/providers/sqlanywhere/sqlanyconnection/sqlanyconnection.cpp b/src/providers/sqlanywhere/sqlanyconnection/sqlanyconnection.cpp index 45ef973b0ab..ef36dc886d6 100644 --- a/src/providers/sqlanywhere/sqlanyconnection/sqlanyconnection.cpp +++ b/src/providers/sqlanywhere/sqlanyconnection/sqlanyconnection.cpp @@ -93,6 +93,7 @@ SqlAnyConnection::~SqlAnyConnection() */ void unload_dbcapi( SQLAnywhereInterface *theApi ) { + Q_UNUSED( theApi ); // For some reason, the code below causes crashes on Windows. // Therefore, leave the library loaded until the application terminates. diff --git a/src/providers/wfs/qgswfsdata.cpp b/src/providers/wfs/qgswfsdata.cpp index a728b023058..9a196ac4417 100644 --- a/src/providers/wfs/qgswfsdata.cpp +++ b/src/providers/wfs/qgswfsdata.cpp @@ -33,8 +33,8 @@ const QString GML_NAMESPACE = "http://www.opengis.net/gml"; QgsWFSData::QgsWFSData( const QString& uri, QgsRectangle* extent, - QMap &features, - QMap &idMap, + QMap &features, + QMap &idMap, const QString& geometryAttribute, const QMap >& thematicAttributes, QGis::WkbType* wkbType ) diff --git a/src/providers/wfs/qgswfsdata.h b/src/providers/wfs/qgswfsdata.h index 4a569c046e0..c119e7cdcf9 100644 --- a/src/providers/wfs/qgswfsdata.h +++ b/src/providers/wfs/qgswfsdata.h @@ -38,8 +38,8 @@ class QgsWFSData: public QObject QgsWFSData( const QString& uri, QgsRectangle* extent, - QMap &features, - QMap &idMap, + QMap &features, + QMap &idMap, const QString& geometryAttribute, const QMap >& thematicAttributes, QGis::WkbType* wkbType ); @@ -144,9 +144,9 @@ class QgsWFSData: public QObject /**Bounding box of the layer*/ QgsRectangle* mExtent; /**The features of the layer*/ - QMap &mFeatures; + QMap &mFeatures; /**Stores the relation between provider ids and WFS server ids*/ - QMap &mIdMap; + QMap &mIdMap; /**Name of geometry attribute*/ QString mGeometryAttribute; const QMap > &mThematicAttributes; diff --git a/src/providers/wfs/qgswfsprovider.cpp b/src/providers/wfs/qgswfsprovider.cpp index 2df3ac984f6..e1f86308de1 100644 --- a/src/providers/wfs/qgswfsprovider.cpp +++ b/src/providers/wfs/qgswfsprovider.cpp @@ -86,6 +86,8 @@ void QgsWFSProvider::deleteData() void QgsWFSProvider::copyFeature( QgsFeature* f, QgsFeature& feature, bool fetchGeometry, QgsAttributeList fetchAttributes ) { + Q_UNUSED( fetchGeometry ); + if ( !f ) { return; @@ -111,12 +113,12 @@ void QgsWFSProvider::copyFeature( QgsFeature* f, QgsFeature& feature, bool fetch feature.setFeatureId( f->id() ); } -bool QgsWFSProvider::featureAtId( int featureId, +bool QgsWFSProvider::featureAtId( QgsFeatureId featureId, QgsFeature& feature, bool fetchGeometry, QgsAttributeList fetchAttributes ) { - QMap::iterator it = mFeatures.find( featureId ); + QMap::iterator it = mFeatures.find( featureId ); if ( it == mFeatures.end() ) { return false; @@ -351,7 +353,7 @@ bool QgsWFSProvider::addFeatures( QgsFeatureList &flist ) for ( ; idIt != idList.constEnd() && featureIt != flist.end(); ++idIt, ++featureIt ) { - int newId = findNewKey(); + QgsFeatureId newId = findNewKey(); featureIt->setFeatureId( newId ); mFeatures.insert( newId, new QgsFeature( *featureIt ) ); mIdMap.insert( newId, *idIt ); @@ -396,7 +398,7 @@ bool QgsWFSProvider::deleteFeatures( const QgsFeatureIds &id ) for ( ; idIt != id.constEnd(); ++idIt ) { //find out feature id - QMap< int, QString >::const_iterator fidIt = mIdMap.find( *idIt ); + QMap< QgsFeatureId, QString >::const_iterator fidIt = mIdMap.find( *idIt ); if ( fidIt == mIdMap.constEnd() ) { continue; @@ -421,7 +423,7 @@ bool QgsWFSProvider::deleteFeatures( const QgsFeatureIds &id ) idIt = id.constBegin(); for ( ; idIt != id.constEnd(); ++idIt ) { - QMap::iterator fIt = mFeatures.find( *idIt ); + QMap::iterator fIt = mFeatures.find( *idIt ); if ( fIt != mFeatures.end() ) { if ( mSpatialIndex ) @@ -459,7 +461,7 @@ bool QgsWFSProvider::changeGeometryValues( QgsGeometryMap & geometry_map ) for ( ; geomIt != geometry_map.end(); ++geomIt ) { //find out feature id - QMap< int, QString >::const_iterator fidIt = mIdMap.find( geomIt.key() ); + QMap< QgsFeatureId, QString >::const_iterator fidIt = mIdMap.find( geomIt.key() ); if ( fidIt == mIdMap.constEnd() ) { continue; @@ -501,7 +503,7 @@ bool QgsWFSProvider::changeGeometryValues( QgsGeometryMap & geometry_map ) geomIt = geometry_map.begin(); for ( ; geomIt != geometry_map.end(); ++geomIt ) { - QMap::iterator fIt = mFeatures.find( geomIt.key() ); + QMap::iterator fIt = mFeatures.find( geomIt.key() ); if ( fIt == mFeatures.end() ) { continue; @@ -548,7 +550,7 @@ bool QgsWFSProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_ for ( ; attIt != attr_map.constEnd(); ++attIt ) { //find out wfs server feature id - QMap< int, QString >::const_iterator fidIt = mIdMap.find( attIt.key() ); + QMap< QgsFeatureId, QString >::const_iterator fidIt = mIdMap.find( attIt.key() ); if ( fidIt == mIdMap.constEnd() ) { continue; @@ -606,7 +608,7 @@ bool QgsWFSProvider::changeAttributeValues( const QgsChangedAttributesMap &attr_ attIt = attr_map.constBegin(); for ( ; attIt != attr_map.constEnd(); ++attIt ) { - QMap::iterator fIt = mFeatures.find( attIt.key() ); + QMap::iterator fIt = mFeatures.find( attIt.key() ); if ( fIt == mFeatures.end() ) { continue; @@ -694,9 +696,9 @@ int QgsWFSProvider::getFeatureGET( const QString& uri, const QString& geometryAt QgsDebugMsg( QString( "feature count after request is: %1" ).arg( mFeatures.size() ) ); QgsDebugMsg( QString( "mExtent after request is: %1" ).arg( mExtent.toString() ) ); - for ( QMap::iterator it = mFeatures.begin(); it != mFeatures.end(); ++it ) + for ( QMap::iterator it = mFeatures.begin(); it != mFeatures.end(); ++it ) { - QgsDebugMsg( "feature " + QString::number(( *it )->id() ) ); + QgsDebugMsg( "feature " + FID_TO_STRING(( *it )->id() ) ); mSpatialIndex->insertFeature( *( it.value() ) ); } @@ -2159,7 +2161,7 @@ QStringList QgsWFSProvider::insertedFeatureIds( const QDomDocument& serverRespon return ids; } -int QgsWFSProvider::findNewKey() const +QgsFeatureId QgsWFSProvider::findNewKey() const { if ( mFeatures.isEmpty() ) { @@ -2167,9 +2169,10 @@ int QgsWFSProvider::findNewKey() const } //else return highest key + 1 - QMap::const_iterator lastIt = mFeatures.end(); - lastIt --; - return lastIt.key() + 1; + QMap::const_iterator lastIt = mFeatures.end(); + lastIt--; + QgsFeatureId id = lastIt.key(); + return ++id; } void QgsWFSProvider::getLayerCapabilities() diff --git a/src/providers/wfs/qgswfsprovider.h b/src/providers/wfs/qgswfsprovider.h index 062ffe7debc..2453e7b4a2e 100644 --- a/src/providers/wfs/qgswfsprovider.h +++ b/src/providers/wfs/qgswfsprovider.h @@ -67,7 +67,7 @@ class QgsWFSProvider: public QgsVectorDataProvider * Default implementation traverses all features until it finds the one with correct ID. * In case the provider supports reading the feature directly, override this function. */ - virtual bool featureAtId( int featureId, + virtual bool featureAtId( QgsFeatureId featureId, QgsFeature& feature, bool fetchGeometry = true, QgsAttributeList fetchAttributes = QgsAttributeList() ); @@ -170,13 +170,13 @@ class QgsWFSProvider: public QgsVectorDataProvider /**A spatial index for fast access to a feature subset*/ QgsSpatialIndex *mSpatialIndex; /**Vector where the ids of the selected features are inserted*/ - QList mSelectedFeatures; + QList mSelectedFeatures; /**Iterator on the feature vector for use in rewind(), nextFeature(), etc...*/ - QList::iterator mFeatureIterator; + QList::iterator mFeatureIterator; /**Map */ - QMap mFeatures; + QMap mFeatures; /**Stores the relation between provider ids and WFS server ids*/ - QMap mIdMap; + QMap mIdMap; /**Geometry type of the features in this layer*/ mutable QGis::WkbType mWKBType; /**Source CRS*/ @@ -278,7 +278,7 @@ class QgsWFSProvider: public QgsVectorDataProvider /**Returns the inserted ids*/ QStringList insertedFeatureIds( const QDomDocument& serverResponse ) const; /**Returns a key suitable for new items*/ - int findNewKey() const; + QgsFeatureId findNewKey() const; /**Retrieve capabilities for this layer from GetCapabilities document (will be stored in mCapabilites)*/ void getLayerCapabilities(); /**Takes element and updates the capabilities*/ diff --git a/src/providers/wms/qgswmsprovider.cpp b/src/providers/wms/qgswmsprovider.cpp index 556198d749e..d084c01b977 100644 --- a/src/providers/wms/qgswmsprovider.cpp +++ b/src/providers/wms/qgswmsprovider.cpp @@ -702,6 +702,7 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i //void QgsWmsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, int pixelWidth, int pixelHeight, QgsCoordinateReferenceSystem theSrcCRS, QgsCoordinateReferenceSystem theDestCRS, void *block ) void QgsWmsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, int pixelWidth, int pixelHeight, void *block ) { + Q_UNUSED( bandNo ); QgsDebugMsg( "Entered" ); // TODO: optimize to avoid writing to QImage QImage* image = draw( viewExtent, pixelWidth, pixelHeight ); @@ -1063,8 +1064,10 @@ int QgsWmsProvider::dataType( int bandNo ) const { return srcDataType( bandNo ); } + int QgsWmsProvider::srcDataType( int bandNo ) const { + Q_UNUSED( bandNo ); return QgsRasterDataProvider::ARGBDataType; } @@ -1900,6 +1903,7 @@ void QgsWmsProvider::parseLayer( QDomElement const & e, QgsWmsLayerProperty& lay void QgsWmsProvider::parseTileSetProfile( QDomElement const &e, QVector &tileSet ) { + Q_UNUSED( tileSet ); QgsWmsTileSetProfile tsp; QDomNode n1 = e.firstChild(); @@ -3261,8 +3265,8 @@ void QgsWMSRootItem::connectionsChanged() QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem ) { - QgsWMSRootItem * root = new QgsWMSRootItem( parentItem, "WMS", "wms:" ); + Q_UNUSED( thePath ); - return root; + return new QgsWMSRootItem( parentItem, "WMS", "wms:" ); } diff --git a/src/providers/wms/qgswmssourceselect.cpp b/src/providers/wms/qgswmssourceselect.cpp index c0fca7d39d4..a270b3ba148 100644 --- a/src/providers/wms/qgswmssourceselect.cpp +++ b/src/providers/wms/qgswmssourceselect.cpp @@ -776,6 +776,8 @@ void QgsWMSSourceSelect::on_lstLayers_itemSelectionChanged() void QgsWMSSourceSelect::on_lstTilesets_itemClicked( QTableWidgetItem *item ) { + Q_UNUSED( item ); + QTableWidgetItem *rowItem = lstTilesets->item( lstTilesets->currentRow(), 0 ); bool wasSelected = mCurrentTileset == rowItem;