fix most cppcheck warnings and implement suggestions

also update and sync some sip interfaces
This commit is contained in:
Juergen E. Fischer 2014-01-03 23:06:49 +01:00
parent d7237b70eb
commit 190c0511bc
140 changed files with 607 additions and 637 deletions

View File

@ -166,7 +166,7 @@ class QgsMapLayer : QObject
virtual bool isEditable() const;
/** sets state from Dom document
@param layer_node is Dom node corresponding to ``maplayer'' tag
@param layerElement The Dom element corresponding to ``maplayer'' tag
@note
The Dom node corresponds to a Dom document project file XML element read
@ -276,9 +276,9 @@ class QgsMapLayer : QObject
* @return a QString with any status messages
* @see also loadDefaultStyle ();
*/
virtual QString loadNamedStyle( const QString theURI, bool & theResultFlag /Out/ );
virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag /Out/ );
virtual bool loadNamedStyleFromDb( const QString db, const QString theURI, QString &qml /Out/ );
virtual bool loadNamedStyleFromDb( const QString &db, const QString &theURI, QString &qml /Out/ );
//TODO edit infos
/**
@ -321,12 +321,12 @@ class QgsMapLayer : QObject
* @return a QString with any status messages
* @sa saveDefaultStyle()
*/
virtual QString saveNamedStyle( const QString theURI, bool & theResultFlag /Out/ );
virtual QString saveNamedStyle( const QString &theURI, bool &theResultFlag /Out/ );
virtual QString saveSldStyle( const QString theURI, bool & theResultFlag );
virtual QString loadSldStyle( const QString theURI, bool &theResultFlag );
virtual QString saveSldStyle( const QString &theURI, bool &theResultFlag );
virtual QString loadSldStyle( const QString &theURI, bool &theResultFlag );
virtual bool readSld( const QDomNode& node, QString& errorMessage );
virtual bool readSld( const QDomNode &node, QString &errorMessage );
/** Read the symbology for the current layer from the Dom node supplied.
* @param node node that will contain the symbology definition for this layer.
@ -344,7 +344,7 @@ class QgsMapLayer : QObject
virtual bool writeSymbology( QDomNode &node, QDomDocument& doc, QString& errorMessage ) const = 0;
/** Return pointer to layer's undo stack */
QUndoStack* undoStack();
QUndoStack *undoStack();
/** Get the QImage used for caching render operations
* @note This method was added in QGIS 1.4 **/

View File

@ -15,6 +15,7 @@ class QgsAttributeEditorElement : QObject
{
AeTypeContainer,
AeTypeField,
AeTypeRelation,
AeTypeInvalid
};
@ -41,6 +42,7 @@ class QgsAttributeEditorContainer : QgsAttributeEditorElement
virtual QDomElement toDomElement( QDomDocument& doc ) const;
virtual void addChildElement( QgsAttributeEditorElement *widget );
virtual bool isGroupBox() const;
QList<QgsAttributeEditorElement*> children() const;
};
@ -105,19 +107,20 @@ class QgsVectorLayer : QgsMapLayer
Classification,
EditRange,
SliderRange,
CheckBox, /* added in 1.4 */
CheckBox, /**< @note added in 1.4 */
FileName,
Enumeration,
Immutable, /* The attribute value should not be changed in the attribute form */
Hidden, /* The attribute value should not be shown in the attribute form @added in 1.4 */
TextEdit, /* multiline edit @added in 1.4*/
Calendar, /* calendar widget @added in 1.5 */
DialRange, /* dial range @added in 1.5 */
ValueRelation, /* value map from an table @added in 1.8 */
UuidGenerator, /* uuid generator - readonly and automatically intialized @added in 1.9 */
Photo, /* phote widget @added in 1.9 */
WebView, /* webview widget @added in 1.9 */
Color, /* color @added in 1.9 */
Immutable, /**< The attribute value should not be changed in the attribute form */
Hidden, /**< The attribute value should not be shown in the attribute form @note added in 1.4 */
TextEdit, /**< multiline edit @note added in 1.4*/
Calendar, /**< calendar widget @note added in 1.5 */
DialRange, /**< dial range @note added in 1.5 */
ValueRelation, /**< value map from an table @note added in 1.8 */
UuidGenerator, /**< uuid generator - readonly and automatically intialized @note added in 1.9 */
Photo, /**< phote widget @note added in 1.9 */
WebView, /**< webview widget @note added in 1.9 */
Color, /**< color @note added in 1.9 */
EditorWidgetV2, /**< modularized edit widgets @note added in 2.1 */
};
/** Types of feature form suppression after feature creation
@ -418,13 +421,13 @@ class QgsVectorLayer : QgsMapLayer
* @param theResultFlag will be set to true if a named style is correctly loaded
* @param loadFromLocalDb if true forces to load from local db instead of datasource one
*/
virtual QString loadNamedStyle( const QString theURI, bool &theResultFlag, bool loadFromLocalDb );
virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
/**
* Calls loadNamedStyle( theURI, theResultFlag, false );
* Retained for backward compatibility
*/
virtual QString loadNamedStyle( const QString theURI, bool &theResultFlag );
virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
virtual bool applyNamedStyle( QString namedStyle , QString errorMsg );
@ -503,10 +506,12 @@ class QgsVectorLayer : QgsMapLayer
*/
bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
/** Updates an existing feature
@param f feature to update
@return True in case of success and False in case of error
@note added in 1.8
/** Updates an existing feature. This method needs to query the datasource
on every call. Consider using {@link changeAttributeValue()} or
{@link changeGeometry()} instead.
@param f Feature to update
@return True in case of success and False in case of error
@note Added in 1.8
*/
bool updateFeature( QgsFeature &f );
@ -561,6 +566,15 @@ class QgsVectorLayer : QgsMapLayer
@return 0 in case of success*/
int translateFeature( QgsFeatureId featureId, double dx, double dy );
/**Splits parts cut by the given line
* @param splitLine line that splits the layer features
* @param topologicalEditing true if topological editing is enabled
* @return
* 0 in case of success,
* 4 if there is a selection but no feature split
*/
int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
/**Splits features cut by the given line
* @param splitLine line that splits the layer features
* @param topologicalEditing true if topological editing is enabled
@ -688,26 +702,57 @@ class QgsVectorLayer : QgsMapLayer
@note added in version 1.2 */
bool addAttribute( const QgsField &field );
/**Sets an alias (a display name) for attributes to display in dialogs
@note added in version 1.2*/
/**
* Sets an alias (a display name) for attributes to display in dialogs
* @note added in version 1.2
*/
void addAttributeAlias( int attIndex, QString aliasString );
/**Adds a tab (for the attribute editor form) holding groups and fields
@note added in version 1.9*/
/**
* Adds a tab (for the attribute editor form) holding groups and fields
* @note added in version 2.0
*/
void addAttributeEditorWidget( QgsAttributeEditorElement* data );
/**Returns a list of tabs holding groups and fields
@note added in version 1.9*/
/**
* Get the id for the editor widget used to represent the field at the given index
*
* @param fieldIdx The index of the field
*
* @return The id for the editor widget or a NULL string if not applicable
*/
const QString editorWidgetV2( int fieldIdx );
/**
* Get the configuration for the editor widget used to represent the field at the given index
*
* @param fieldIdx The index of the field
*
* @return The id for the editor widget or a NULL string if not configured
*/
const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx );
/**
* Returns a list of tabs holding groups and fields
* @note added in version 2.0
*/
QList< QgsAttributeEditorElement* > &attributeEditorElements();
/**Clears all the tabs for the attribute editor form
@note added in version 1.9*/
/**
* Clears all the tabs for the attribute editor form
* @note added in version 2.0
*/
void clearAttributeEditorWidgets();
/**Returns the alias of an attribute name or an empty string if there is no alias
@note added in version 1.2*/
/**
* Returns the alias of an attribute name or an empty string if there is no alias
* @note added in version 1.2
*/
QString attributeAlias( int attributeIndex ) const;
/**Convenience function that returns the attribute alias if defined or the field name else
@note added in version 1.2*/
/**
* Convenience function that returns the attribute alias if defined or the field name else
* @note added in version 1.2
*/
QString attributeDisplayName( int attributeIndex ) const;
const QMap< QString, QString >& attributeAliases() const;
@ -771,6 +816,10 @@ class QgsVectorLayer : QgsMapLayer
/** set the active layout for the attribute editor for this layer (added in 1.9) */
void setEditorLayout( EditorLayout editorLayout );
void setEditorWidgetV2( int attrIdx, const QString& widgetType );
void setEditorWidgetV2Config( int attrIdx, const QMap<QString, QVariant>& config );
/** set string representing 'true' for a checkbox (added in 1.4) */
void setCheckedState( int idx, QString checked, QString notChecked );
@ -817,6 +866,14 @@ class QgsVectorLayer : QgsMapLayer
**/
ValueRelationData &valueRelation( int idx );
/**
* Get relations, where the foreign key is on this layer
*
* @param idx Only get relations, where idx forms part of the foreign key
* @return A list of relations
*/
QList<QgsRelation> referencingRelations( int idx );
/**access date format
* @note added in 1.9
*/
@ -906,7 +963,7 @@ class QgsVectorLayer : QgsMapLayer
/* Set the blending mode used for rendering each feature
* @note added in 2.0
*/
void setFeatureBlendMode( const QPainter::CompositionMode blendMode );
void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
/* Returns the current blending mode for features
* @note added in 2.0
*/
@ -921,6 +978,11 @@ class QgsVectorLayer : QgsMapLayer
*/
int layerTransparency() const;
QString metadata();
/** @note not available in python bindings */
// inline QgsGeometryCache* cache();
/** Set the Map2pixel simplification threshold for fast rendering of features */
void setSimplifyDrawingTol( float simplifyDrawingTol );
/** Returns the Map2pixel simplification threshold for fast rendering of features */
@ -999,11 +1061,6 @@ class QgsVectorLayer : QgsMapLayer
@note added in 1.7 */
void checkJoinLayerRemove( QString theLayerId );
QString metadata();
/** @note not available in python bindings */
// QgsGeometryCache* cache();
/**
* @brief Is called when the cache image is being deleted. Overwrite and use to clean up.
* @note added in 2.0
@ -1080,6 +1137,8 @@ class QgsVectorLayer : QgsMapLayer
void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
void saveLayerToProject();
/** Emitted when the font family defined for labeling layer is not found on system
* @note added in 1.9
*/
@ -1089,7 +1148,7 @@ class QgsVectorLayer : QgsMapLayer
void rendererChanged();
/** Signal emitted when setFeatureBlendMode() is called */
void featureBlendModeChanged( const QPainter::CompositionMode blendMode );
void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
/** Signal emitted when setLayerTransparency() is called */
void layerTransparencyChanged( int layerTransparency );

View File

@ -98,8 +98,8 @@ class QgsGradientFillSymbolLayerV2 : QgsFillSymbolLayerV2
GradientColorType gradientColorType = SimpleTwoColor,
GradientType gradientType = Linear,
GradientCoordinateMode coordinateMode = Feature,
GradientSpread gradientSpread = Pad );
GradientSpread gradientSpread = Pad
);
// static stuff
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
@ -118,42 +118,55 @@ class QgsGradientFillSymbolLayerV2 : QgsFillSymbolLayerV2
QgsSymbolLayerV2* clone() const /Factory/;
/**Type of gradient, eg linear or radial*/
GradientType gradientType() const;
void setGradientType( GradientType gradientType );
/**Gradient color mode, controls how gradient color stops are created*/
GradientColorType gradientColorType() const;
void setGradientColorType( GradientColorType gradientColorType );
/**Color ramp used for the gradient fill, only used if the gradient color type is set to ColorRamp*/
QgsVectorColorRampV2* colorRamp();
void setColorRamp( QgsVectorColorRampV2* ramp );
/**Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor*/
QColor color2() const;
void setColor2( QColor color2 );
/**Coordinate mode for gradient. Controls how the gradient stops are positioned.*/
GradientCoordinateMode coordinateMode() const;
void setCoordinateMode( GradientCoordinateMode coordinateMode );
/**Gradient spread mode. Controls how the gradient behaves outside of the predefined stops*/
GradientSpread gradientSpread() const;
void setGradientSpread( GradientSpread gradientSpread );
/**Starting point of gradient fill, in the range [0,0] - [1,1]*/
void setReferencePoint1( QPointF referencePoint );
QPointF referencePoint1() const;
/**Sets the starting point of the gradient to be the feature centroid*/
void setReferencePoint1IsCentroid( bool isCentroid );
bool referencePoint1IsCentroid() const;
/**End point of gradient fill, in the range [0,0] - [1,1]*/
void setReferencePoint2( QPointF referencePoint );
QPointF referencePoint2() const;
/**Sets the end point of the gradient to be the feature centroid*/
void setReferencePoint2IsCentroid( bool isCentroid );
bool referencePoint2IsCentroid() const;
/**Rotation angle for gradient fill. Can be used to rotate a gradient around its centre point*/
void setAngle( double angle );
double angle() const;
/**Offset for gradient fill*/
void setOffset( QPointF offset );
QPointF offset() const;
/**Units for gradient fill offset*/
void setOffsetUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit offsetUnit() const;

View File

@ -458,7 +458,6 @@ int DualEdgeTriangulation::baseEdgeOfPoint( int point )
{
mEdgeInside = actedge;
return actedge;
break;
}
else if ( leftofnumber <= 0 )

View File

@ -267,21 +267,8 @@ bool MathUtils::inCircle( Point3D* testp, Point3D* p1, Point3D* p2, Point3D* p3
aValue = aValue - (( bx * bx + by * by ) * triArea( p1, p3, testp ) );
aValue = aValue + (( cx * cx + cy * cy ) * triArea( p1, p2, testp ) );
aValue = aValue - (( px * px + py * py ) * triArea( p1, p2, p3 ) );
//return aValue>0.0;
if ( aValue > tolerance )
{
return true;
}
else if ( aValue < -tolerance )
{
return false;
}
else//point is approximately on the circle
{
//cout << "aValue " << aValue << endl << flush;
//return aValue>0.0;
return false;
}
return aValue > tolerance;
}
else
{

View File

@ -62,15 +62,15 @@ int NormVecDecorator::addPoint( Point3D* p )
while ( it != list->end() )
{
int point;
point = ( *it );
point = *it;
if ( point != -1 )
{
estimateFirstDerivative( point );
}
it++;
it++;
it++;
it++;
++it;
++it;
++it;
++it;
}
delete list;
}
@ -161,7 +161,7 @@ bool NormVecDecorator::calcNormalForPoint( double x, double y, int point, Vector
if ( numberofbreaks > 0 )
{
if ( p1 != -1 && p2 != -1 && p2 != -1 )
if ( p1 != -1 && p2 != -1 && p3 != -1 )
{
if ( MathUtils::pointInsideTriangle( x, y, getPoint( p1 ), getPoint( p2 ), getPoint( p3 ) ) )
{

View File

@ -134,7 +134,7 @@ void QgsCompositionWidget::createPaperEntries()
;
mPaperSizeComboBox->addItem( tr( "Custom" ) );
for ( QList<QgsCompositionPaper>::const_iterator it = formats.begin(); it != formats.end(); it++ )
for ( QList<QgsCompositionPaper>::const_iterator it = formats.begin(); it != formats.end(); ++it )
{
mPaperSizeComboBox->addItem( it->mName );
mPaperMap.insert( it->mName, *it );

View File

@ -48,7 +48,7 @@ void QgsGpsMarker::setCenter( const QgsPoint& point )
{
mCenter = t.transform( point );
}
catch ( QgsCsException e ) //silently ignore transformation exceptions
catch ( QgsCsException &e ) //silently ignore transformation exceptions
{
return;
}

View File

@ -2159,7 +2159,7 @@ QgsLegendGroup* QgsLegend::findLegendGroup( const QString& name, const QString&
void QgsLegend::adjustIconSize()
{
if ( mPixmapWidthValues.size() > 0 && mPixmapHeightValues.size() > 0 )
if ( !mPixmapWidthValues.empty() && !mPixmapHeightValues.empty() )
{
std::multiset<int>::const_reverse_iterator width_it = mPixmapWidthValues.rbegin();
std::multiset<int>::const_reverse_iterator height_it = mPixmapHeightValues.rbegin();

View File

@ -18,13 +18,13 @@
#include "qgslogger.h"
QgsLegendItem::QgsLegendItem( QTreeWidgetItem * theItem, QString theName )
QgsLegendItem::QgsLegendItem( QTreeWidgetItem *theItem, QString theName )
: QTreeWidgetItem( theItem )
{
setText( 0, theName );
}
QgsLegendItem::QgsLegendItem( QTreeWidget* theListView, QString theString )
QgsLegendItem::QgsLegendItem( QTreeWidget *theListView, QString theString )
: QTreeWidgetItem( theListView )
{
setText( 0, theString );

View File

@ -594,7 +594,6 @@ void QgsLegendLayer::updateItemListCountV2( SymbologyList& itemList, QgsVectorLa
QgsLegendSymbolList symbolList = renderer->legendSymbolItems();
QgsLegendSymbolList::const_iterator symbolIt = symbolList.constBegin();
symbolIt = symbolList.constBegin();
for ( ; symbolIt != symbolList.constEnd(); ++symbolIt )
{
itemList.push_back( qMakePair( symbolIt->first + " [" + QString::number( layer->featureCount( symbolIt->second ) ) + "]", itemMap[symbolIt->first] ) );

View File

@ -464,7 +464,7 @@ void QgsPluginManager::reloadModelData()
for ( QMap<QString, QMap<QString, QString> >::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
if ( ! it->value( "id" ).isEmpty() )
{
@ -1244,7 +1244,7 @@ bool QgsPluginManager::hasAvailablePlugins( )
{
for ( QMap<QString, QMap<QString, QString> >::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
if ( it->value( "status" ) == "not installed" || it->value( "status" ) == "new" )
{
@ -1261,7 +1261,7 @@ bool QgsPluginManager::hasReinstallablePlugins( )
{
for ( QMap<QString, QMap<QString, QString> >::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
// plugins marked as "installed" are available for download (otherwise they are marked "orphans")
if ( it->value( "status" ) == "installed" )
@ -1279,7 +1279,7 @@ bool QgsPluginManager::hasUpgradeablePlugins( )
{
for ( QMap<QString, QMap<QString, QString> >::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
if ( it->value( "status" ) == "upgradeable" )
{
@ -1296,7 +1296,7 @@ bool QgsPluginManager::hasNewPlugins( )
{
for ( QMap<QString, QMap<QString, QString> >::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
if ( it->value( "status" ) == "new" )
{
@ -1313,7 +1313,7 @@ bool QgsPluginManager::hasNewerPlugins( )
{
for ( QMap<QString, QMap<QString, QString> >::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
if ( it->value( "status" ) == "newer" )
{
@ -1330,7 +1330,7 @@ bool QgsPluginManager::hasInvalidPlugins( )
{
for ( QMap<QString, QMap<QString, QString> >::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
if ( ! it->value( "error" ).isEmpty() )
{

View File

@ -269,6 +269,11 @@
// Conditional Includes
//
#ifdef HAVE_PGCONFIG
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#include <pg_config.h>
#else
#define PG_VERSION "unknown"
@ -860,7 +865,7 @@ void QgisApp::dropEvent( QDropEvent *event )
// get the file list
QList<QUrl>::iterator i;
QList<QUrl>urls = event->mimeData()->urls();
for ( i = urls.begin(); i != urls.end(); i++ )
for ( i = urls.begin(); i != urls.end(); ++i )
{
QString fileName = i->toLocalFile();
// seems that some drag and drop operations include an empty url
@ -2480,7 +2485,7 @@ void QgisApp::addVectorLayer()
}
bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QString& enc, const QString dataSourceType )
bool QgisApp::addVectorLayers( const QStringList &theLayerQStringList, const QString &enc, const QString &dataSourceType )
{
bool wasfrozen = mMapCanvas->isFrozen();
QList<QgsMapLayer *> myList;
@ -4775,7 +4780,7 @@ void QgisApp::checkForDeprecatedLabelsInProject()
{
bool depLabelsUsed = false;
QMap<QString, QgsMapLayer*> layers = QgsMapLayerRegistry::instance()->mapLayers();
for ( QMap<QString, QgsMapLayer*>::iterator it = layers.begin(); it != layers.end(); it++ )
for ( QMap<QString, QgsMapLayer*>::iterator it = layers.begin(); it != layers.end(); ++it )
{
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( it.value() );
if ( !vl )
@ -4954,8 +4959,12 @@ QgsGeometry* QgisApp::unionGeometries( const QgsVectorLayer* vl, QgsFeatureList&
//convert unionGeom to a multipart geometry in case it is necessary to match the layer type
QGis::WkbType t = vl->wkbType();
bool layerIsMultiType = ( t == QGis::WKBMultiPoint || t == QGis::WKBMultiPoint25D || t == QGis::WKBMultiLineString
|| t == QGis::WKBMultiLineString25D || t == QGis::WKBMultiPolygon || t == QGis::WKBMultiPoint25D );
bool layerIsMultiType = ( t == QGis::WKBMultiPoint ||
t == QGis::WKBMultiPoint25D ||
t == QGis::WKBMultiLineString ||
t == QGis::WKBMultiLineString25D ||
t == QGis::WKBMultiPolygon ||
t == QGis::WKBMultiPolygon25D );
if ( layerIsMultiType && !unionGeom->isMultipart() )
{
unionGeom->convertToMultiType();
@ -5557,7 +5566,7 @@ void QgisApp::deselectAll()
mMapCanvas->setRenderFlag( false );
QMap<QString, QgsMapLayer*> layers = QgsMapLayerRegistry::instance()->mapLayers();
for ( QMap<QString, QgsMapLayer*>::iterator it = layers.begin(); it != layers.end(); it++ )
for ( QMap<QString, QgsMapLayer*>::iterator it = layers.begin(); it != layers.end(); ++it )
{
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( it.value() );
if ( !vl )
@ -7369,7 +7378,7 @@ bool QgisApp::saveDirty()
if ( QgsMapLayerRegistry::instance()->count() > 0 )
{
QMap<QString, QgsMapLayer*> layers = QgsMapLayerRegistry::instance()->mapLayers();
for ( QMap<QString, QgsMapLayer*>::iterator it = layers.begin(); it != layers.end(); it++ )
for ( QMap<QString, QgsMapLayer*>::iterator it = layers.begin(); it != layers.end(); ++it )
{
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( it.value() );
if ( !vl )
@ -8351,7 +8360,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
bool enableMove = false, enableRotate = false, enablePin = false, enableShowHide = false, enableChange = false;
QMap<QString, QgsMapLayer*> layers = QgsMapLayerRegistry::instance()->mapLayers();
for ( QMap<QString, QgsMapLayer*>::iterator it = layers.begin(); it != layers.end(); it++ )
for ( QMap<QString, QgsMapLayer*>::iterator it = layers.begin(); it != layers.end(); ++it )
{
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( it.value() );
if ( !vlayer || !vlayer->isEditable() ||

View File

@ -129,21 +129,21 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
@param dataSourceType type of ogr datasource
@returns true if successfully added layer
*/
bool addVectorLayers( QStringList const & theLayerQStringList, const QString& enc, const QString dataSourceType );
bool addVectorLayers( const QStringList &theLayerQStringList, const QString &enc, const QString &dataSourceType );
/** overloaded vesion of the private addRasterLayer()
Method that takes a list of file names instead of prompting
user with a dialog.
@returns true if successfully added layer(s)
*/
bool addRasterLayers( QStringList const & theLayerQStringList, bool guiWarning = true );
bool addRasterLayers( const QStringList &theLayerQStringList, bool guiWarning = true );
/** open a raster layer for the given file
@returns false if unable to open a raster layer for rasterFile
@note
This is essentially a simplified version of the above
*/
QgsRasterLayer* addRasterLayer( QString const & rasterFile, QString const & baseName, bool guiWarning = true );
QgsRasterLayer *addRasterLayer( const QString &rasterFile, const QString &baseName, bool guiWarning = true );
/** Add a 'pre-made' map layer to the project */
void addMapLayer( QgsMapLayer *theMapLayer );

View File

@ -335,7 +335,7 @@ void QgsAttributeTypeDialog::updateMap( const QMap<QString, QVariant> &map, bool
++row;
}
for ( QMap<QString, QVariant>::const_iterator mit = map.begin(); mit != map.end(); mit++, row++ )
for ( QMap<QString, QVariant>::const_iterator mit = map.begin(); mit != map.end(); ++mit, row++ )
{
tableWidget->insertRow( row );
if ( mit.value().isNull() )
@ -533,7 +533,7 @@ void QgsAttributeTypeDialog::setIndex( int index, QgsVectorLayer::EditType editT
}
int row = 0;
for ( QMap<QString, QVariant>::iterator mit = mValueMap.begin(); mit != mValueMap.end(); mit++, row++ )
for ( QMap<QString, QVariant>::iterator mit = mValueMap.begin(); mit != mValueMap.end(); ++mit, row++ )
{
tableWidget->insertRow( row );
if ( mit.value().isNull() )

View File

@ -97,7 +97,7 @@ void QgsAttributeTypeLoadDialog::fillComboBoxes( int layerIndex )
}
QMap<QString, int> fieldMap = vLayer->dataProvider()->fieldNameMap();
QMap<QString, int>::iterator it = fieldMap.begin();
for ( ; it != fieldMap.end(); it++ )
for ( ; it != fieldMap.end(); ++it )
{
keyComboBox->addItem( it.key(), it.value() );
valueComboBox->addItem( it.key(), it.value() );
@ -148,7 +148,7 @@ void QgsAttributeTypeLoadDialog::createPreview( int fieldIndex, bool full )
break; //just first entries all on button
}
int row = 0;
for ( QMap<QString, QVariant>::iterator mit = valueMap.begin(); mit != valueMap.end(); mit++, row++ )
for ( QMap<QString, QVariant>::iterator mit = valueMap.begin(); mit != valueMap.end(); ++mit, row++ )
{
previewTableWidget->insertRow( row );
previewTableWidget->setItem( row, 0, new QTableWidgetItem( mit.value().toString() ) );

View File

@ -103,23 +103,12 @@ void QgsDecorationNorthArrow::render( QPainter * theQPainter )
//Large IF statement controlled by enable check box
if ( enabled() )
{
if ( theQPainter->isActive() )
{
//QgsDebugMsg("Rendering north arrow on active painter");
}
else
{
//QgsDebugMsg("Rendering north arrow on INactive painter!!!");
}
QPixmap myQPixmap; //to store the north arrow image in
QString myFileNameQString = ":/images/north_arrows/default.png";
//QgsDebugMsg("Trying to load " + myFileNameQString);
if ( myQPixmap.load( myFileNameQString ) )
{
double centerXDouble = myQPixmap.width() / 2;
double centerYDouble = myQPixmap.height() / 2;
//save the current canvas rotation

View File

@ -465,8 +465,6 @@ void QgsDecorationScaleBar::render( QPainter * theQPainter )
//Draw unit label
//
theQPainter->setPen( myBackColor );
myFontWidth = myFontMetrics.width( myScaleBarUnitLabel );
myFontHeight = myFontMetrics.height();
//first the buffer
for ( int i = 0 - myBufferSize; i <= myBufferSize; i++ )
{

View File

@ -412,7 +412,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
derivedItem->setData( 0, Qt::UserRole, "derived" );
featItem->addChild( derivedItem );
for ( QMap< QString, QString>::const_iterator it = derivedAttributes.begin(); it != derivedAttributes.end(); it++ )
for ( QMap< QString, QString>::const_iterator it = derivedAttributes.begin(); it != derivedAttributes.end(); ++it )
{
derivedItem->addChild( new QTreeWidgetItem( QStringList() << it.key() << it.value() ) );
}
@ -541,7 +541,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,
}
else
{
for ( QMap<QString, QString>::const_iterator it = attributes.begin(); it != attributes.end(); it++ )
for ( QMap<QString, QString>::const_iterator it = attributes.begin(); it != attributes.end(); ++it )
{
featItem->addChild( new QTreeWidgetItem( QStringList() << it.key() << it.value() ) );
}
@ -553,7 +553,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,
derivedItem->setData( 0, Qt::UserRole, "derived" );
featItem->addChild( derivedItem );
for ( QMap< QString, QString>::const_iterator it = derivedAttributes.begin(); it != derivedAttributes.end(); it++ )
for ( QMap< QString, QString>::const_iterator it = derivedAttributes.begin(); it != derivedAttributes.end(); ++it )
{
derivedItem->addChild( new QTreeWidgetItem( QStringList() << it.key() << it.value() ) );
}
@ -1186,25 +1186,24 @@ void QgsIdentifyResultsDialog::zoomToFeature()
{
QTreeWidgetItem *item = lstResults->currentItem();
QgsMapLayer *layer;
QgsVectorLayer *vlayer = vectorLayer( item );
QgsRasterLayer *rlayer = rasterLayer( item );
if ( !vlayer && !rlayer )
return;
layer = vlayer ? ( QgsMapLayer * )vlayer : ( QgsMapLayer * )rlayer;
QgsMapLayer *layer;
if ( vlayer )
layer = vlayer;
else
layer = rlayer;
QgsIdentifyResultsFeatureItem *featItem = dynamic_cast<QgsIdentifyResultsFeatureItem *>( featureItem( item ) );
if ( !featItem )
{
return;
}
QgsFeature feat = featItem->feature();
if ( !feat.geometry() )
{
return;
}
// TODO: verify CRS for raster WMS features
QgsRectangle rect = mCanvas->mapRenderer()->layerExtentToOutputExtent( layer, feat.geometry()->boundingBox() );
@ -1332,10 +1331,11 @@ void QgsIdentifyResultsDialog::copyFeatureAttributes()
QgsVectorLayer *vlayer = vectorLayer( lstResults->currentItem() );
QgsRasterLayer *rlayer = rasterLayer( lstResults->currentItem() );
if ( !vlayer & !rlayer )
if ( !vlayer && !rlayer )
{
return;
}
if ( vlayer )
{
int idx;
@ -1344,7 +1344,7 @@ void QgsIdentifyResultsDialog::copyFeatureAttributes()
const QgsFields &fields = vlayer->pendingFields();
for ( QgsAttributeMap::const_iterator it = attributes.begin(); it != attributes.end(); it++ )
for ( QgsAttributeMap::const_iterator it = attributes.begin(); it != attributes.end(); ++it )
{
int attrIdx = it.key();
if ( attrIdx < 0 || attrIdx >= fields.count() )

View File

@ -1585,9 +1585,7 @@ void QgsLabelingGui::on_mPreviewBackgroundBtn_colorChanged( const QColor &color
void QgsLabelingGui::on_mDirectSymbLeftToolBtn_clicked()
{
bool gotChar = false;
QChar dirSymb = QChar();
dirSymb = mCharDlg->selectCharacter( &gotChar, mRefFont, mFontDB.styleString( mRefFont ) );
QChar dirSymb = mCharDlg->selectCharacter( &gotChar, mRefFont, mFontDB.styleString( mRefFont ) );
if ( !gotChar )
return;
@ -1599,9 +1597,7 @@ void QgsLabelingGui::on_mDirectSymbLeftToolBtn_clicked()
void QgsLabelingGui::on_mDirectSymbRightToolBtn_clicked()
{
bool gotChar = false;
QChar dirSymb = QChar();
dirSymb = mCharDlg->selectCharacter( &gotChar, mRefFont, mFontDB.styleString( mRefFont ) );
QChar dirSymb = mCharDlg->selectCharacter( &gotChar, mRefFont, mFontDB.styleString( mRefFont ) );
if ( !gotChar )
return;

View File

@ -409,7 +409,6 @@ bool QgsMapToolLabel::rotationPoint( QgsPoint& pos, bool ignoreUpsideDown, bool
}
else if ( valiString.compare( "Half", Qt::CaseInsensitive ) == 0 )
{
ydiff = labelSizeY * descentRatio;
ydiff = labelSizeY * 0.5 * ( 1 - descentRatio );
}
}

View File

@ -419,10 +419,12 @@ bool QgsMapToolPinLabels::pinUnpinLabel( QgsVectorLayer* vlayer,
vlayer->beginEditCommand( tr( "Pinned label" ) + QString( " '%1'" ).arg( labelText ) );
writeFailed = !vlayer->changeAttributeValue( fid, xCol, labelX, true );
writeFailed = !vlayer->changeAttributeValue( fid, yCol, labelY, true );
if ( !vlayer->changeAttributeValue( fid, yCol, labelY, true ) )
writeFailed = true;
if ( hasRCol && !preserveRot )
{
writeFailed = !vlayer->changeAttributeValue( fid, rCol, labelR, true );
if ( !vlayer->changeAttributeValue( fid, rCol, labelR, true ) )
writeFailed = true;
}
vlayer->endEditCommand();
}
@ -430,10 +432,12 @@ bool QgsMapToolPinLabels::pinUnpinLabel( QgsVectorLayer* vlayer,
{
vlayer->beginEditCommand( tr( "Unpinned label" ) + QString( " '%1'" ).arg( labelText ) );
writeFailed = !vlayer->changeAttributeValue( fid, xCol, QVariant( QString::null ), true );
writeFailed = !vlayer->changeAttributeValue( fid, yCol, QVariant( QString::null ), true );
if ( !vlayer->changeAttributeValue( fid, yCol, QVariant( QString::null ), true ) )
writeFailed = true;
if ( hasRCol && !preserveRot )
{
writeFailed = !vlayer->changeAttributeValue( fid, rCol, QVariant( QString::null ), true );
if ( !vlayer->changeAttributeValue( fid, rCol, QVariant( QString::null ), true ) )
writeFailed = true;
}
vlayer->endEditCommand();
}

View File

@ -64,7 +64,7 @@ void QgsMapToolSelectUtils::setRubberBand( QgsMapCanvas* canvas, QRect& selectRe
void QgsMapToolSelectUtils::expandSelectRectangle( QRect& selectRect,
QgsVectorLayer* vlayer,
QPoint point )
const QPoint &point )
{
int boxSize = 0;
if ( vlayer->geometryType() != QGis::Polygon )

View File

@ -73,7 +73,7 @@ namespace QgsMapToolSelectUtils
@param vlayer The vector layer layer
@param vlayer The point to expand the rectangle around
*/
void expandSelectRectangle( QRect& selectRect, QgsVectorLayer* vlayer, const QPoint point );
void expandSelectRectangle( QRect& selectRect, QgsVectorLayer* vlayer, const QPoint &point );
/**
Sets a QgsRubberband to rectangle in map units using a rectangle defined in device coords

View File

@ -127,7 +127,7 @@ void QgsPluginRegistry::dump()
QgsDebugMsg( "PLUGINS IN REGISTRY: key -> (name, library)" );
for ( QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
QgsDebugMsg( QString( "PLUGIN: %1 -> (%2, %3)" )
.arg( it.key() )
@ -162,7 +162,7 @@ void QgsPluginRegistry::unloadAll()
{
for ( QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
if ( it->plugin() )
{
@ -237,15 +237,6 @@ bool QgsPluginRegistry::checkQgisVersion( QString minVersion, QString maxVersion
// our qgis version - cut release name after version number
QString qgisVersion = QString( QGis::QGIS_VERSION ).section( '-', 0, 0 );
// /////////////////////////////////////////////////////////////////////////////
// TEMPORARY WORKAROUND UNTIL VERSION NUMBER IS GLOBALY SWITCHED TO 2.0 //
// /////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////
qgisVersion = "2.0.0"; //////////////////////////////////
// //////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
QStringList qgisVersionParts = qgisVersion.split( "." );
int qgisMajor = qgisVersionParts.at( 0 ).toInt();

View File

@ -224,7 +224,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
twIdentifyLayers->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
int i = 0;
for ( QMap<QString, QgsMapLayer*>::const_iterator it = mapLayers.constBegin(); it != mapLayers.constEnd(); it++, i++ )
for ( QMap<QString, QgsMapLayer*>::const_iterator it = mapLayers.constBegin(); it != mapLayers.constEnd(); ++it, i++ )
{
currentLayer = it.value();
@ -373,7 +373,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
i = 0;
int j = 0;
for ( QMap<QString, QgsMapLayer*>::const_iterator it = mapLayers.constBegin(); it != mapLayers.constEnd(); it++, i++ )
for ( QMap<QString, QgsMapLayer*>::const_iterator it = mapLayers.constBegin(); it != mapLayers.constEnd(); ++it, i++ )
{
currentLayer = it.value();
if ( currentLayer->type() == QgsMapLayer::VectorLayer )
@ -1044,7 +1044,7 @@ void QgsProjectProperties::on_pbnWMSSetUsedSRS_clicked()
}
const QMap<QString, QgsMapLayer*> &mapLayers = QgsMapLayerRegistry::instance()->mapLayers();
for ( QMap<QString, QgsMapLayer*>::const_iterator it = mapLayers.constBegin(); it != mapLayers.constEnd(); it++ )
for ( QMap<QString, QgsMapLayer*>::const_iterator it = mapLayers.constBegin(); it != mapLayers.constEnd(); ++it )
{
crsList << it.value()->crs().authid();
}

View File

@ -60,7 +60,7 @@ void QgsComposerEffect::draw( QPainter *painter )
}
void QgsComposerEffect::setCompositionMode( const QPainter::CompositionMode compositionMode )
void QgsComposerEffect::setCompositionMode( const QPainter::CompositionMode &compositionMode )
{
mCompositionMode = compositionMode;

View File

@ -29,7 +29,7 @@ class CORE_EXPORT QgsComposerEffect : public QGraphicsEffect
QgsComposerEffect();
~QgsComposerEffect();
void setCompositionMode( const QPainter::CompositionMode compositionMode );
void setCompositionMode( const QPainter::CompositionMode &compositionMode );
protected:
/** Called whenever source needs to be drawn */

View File

@ -767,7 +767,7 @@ QRectF QgsComposerItem::largestRotatedRectWithinBounds( QRectF originalRect, QRe
{
return QRectF(( boundsWidth - rectScaledWidth ) / 2.0, ( boundsHeight - rectScaledHeight ) / 2.0, rectScaledWidth, rectScaledHeight );
}
else if ( rotation == 0 || rotation == 180 )
else
{
return QRectF(( boundsWidth - rectScaledHeight ) / 2.0, ( boundsHeight - rectScaledWidth ) / 2.0, rectScaledHeight, rectScaledWidth );
}

View File

@ -347,12 +347,6 @@ void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* i
QgsRectangle cExtent = *currentMapExtent();
double horizontalVScaleFactor = horizontalViewScaleFactor();
if ( horizontalVScaleFactor < 0 )
{
horizontalVScaleFactor = mLastValidViewScaleFactor;
}
double imagePixelWidth = cExtent.width() / requestRectangle.width() * mCacheImage.width() ; //how many pixels of the image are for the map extent?
double scale = rect().width() / imagePixelWidth;
QgsPoint rotationPoint = QgsPoint(( cExtent.xMaximum() + cExtent.xMinimum() ) / 2.0, ( cExtent.yMaximum() + cExtent.yMinimum() ) / 2.0 );

View File

@ -503,7 +503,7 @@ void QgsDxfExport::writeBlocks()
if ( hasDataDefinedProperties( ml, slIt->second ) )
{
continue;
ml->stopRender( ctx );
// ml->stopRender( ctx );
}
writeGroup( 0, "BLOCK" );
writeGroup( 8, 0 );
@ -513,8 +513,8 @@ void QgsDxfExport::writeBlocks()
//x/y/z coordinates of reference point
//todo: consider anchor point
double size = ml->size();
size *= mapUnitScaleFactor( mSymbologyScaleDenominator, ml->sizeUnit(), mMapUnits );
// double size = ml->size();
// size *= mapUnitScaleFactor( mSymbologyScaleDenominator, ml->sizeUnit(), mMapUnits );
writeGroup( 10, 0 );
writeGroup( 20, 0 );
writeGroup( 30, 0 );
@ -1112,14 +1112,14 @@ double QgsDxfExport::mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::O
{
return 1.0;
}
else if ( symbolUnits == QgsSymbolV2::MM && mapUnits == QGis::Meters )
{
return scaleDenominator / 1000;
}
else
{
if ( symbolUnits == QgsSymbolV2::MM && mapUnits == QGis::Meters )
{
return scaleDenominator / 1000;
}
return 1.0;
}
return 1.0;
}
QList< QPair< QgsSymbolLayerV2*, QgsSymbolV2* > > QgsDxfExport::symbolLayers()

View File

@ -483,7 +483,7 @@ namespace pal
if ( nbp == 1 )
cost = 0.0001;
else
cost = 0.0001 + 0.0020 * double( icost ) / double( nbp - 1 );
cost = 0.0001 + 0.0020 * double( icost ) / double( nbp - 1 );
( *lPos )[i] = new LabelPosition( i, lx, ly, xrm, yrm, angle, cost, this );
@ -892,7 +892,6 @@ namespace pal
{
orientation = -orientation;
delete slp;
slp = NULL;
slp = curvedPlacementAtOffset( path_positions, path_distances, orientation, initial_index, initial_distance );
}
else

View File

@ -125,7 +125,7 @@ namespace pal
Layer *Pal::getLayer( const char *lyrName )
{
lyrsMutex->lock();
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); it++ )
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); ++it )
if ( strcmp(( *it )->name, lyrName ) == 0 )
{
lyrsMutex->unlock();
@ -178,7 +178,7 @@ namespace pal
std::cout << "nbLayers:" << layers->size() << std::endl;
#endif
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); it++ )
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); ++it )
{
if ( strcmp(( *it )->name, lyrName ) == 0 ) // if layer already known
{
@ -408,7 +408,7 @@ namespace pal
lyrsMutex->lock();
for ( i = 0; i < nbLayers; i++ )
{
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); it++ ) // iterate on pal->layers
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); ++it ) // iterate on pal->layers
{
layer = *it;
// Only select those who are active and labellable (with scale constraint) or those who are active and which must be treated as obstaclewhich must be treated as obstacle
@ -643,7 +643,7 @@ namespace pal
double *priorities = new double[nbLayers];
Layer *layer;
i = 0;
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); it++ )
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); ++it )
{
layer = *it;
layersName[i] = layer->name;
@ -808,7 +808,7 @@ namespace pal
double *priorities = new double[nbLayers];
Layer *layer;
int i = 0;
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); it++ )
for ( QList<Layer*>::iterator it = layers->begin(); it != layers->end(); ++it )
{
layer = *it;
layersName[i] = layer->name;

View File

@ -177,7 +177,6 @@ namespace pal
double amin[2];
double amax[2];
LabelPosition *lp;
LabelPosition *lp2;
while ( run )
@ -190,7 +189,7 @@ namespace pal
{
if ( !ok[featStartId[i] + j] )
{
if (( lp = labelpositions[featStartId[i] + j] )->getNumOverlaps() == 0 ) // if candidate has no overlap
if ( labelpositions[featStartId[i] + j]->getNumOverlaps() == 0 ) // if candidate has no overlap
{
run = true;
ok[featStartId[i] + j] = true;
@ -212,7 +211,6 @@ namespace pal
lp2->removeFromIndex( candidates );
}
//lp->removeFromIndex(candidates);
featNbLp[i] = j + 1;
break;
}
@ -455,7 +453,9 @@ namespace pal
SubPart *current = NULL;
#if _VERBOSE_
int subPartTotalSize = 0;
#endif
labelPositionCost = new double[all_nblp];
nbOlap = new int[all_nblp];
@ -472,7 +472,9 @@ namespace pal
for ( i = 0; i < nbft; i++ )
{
parts[i] = subPart( r, i, isIn );
#if _VERBOSE_
subPartTotalSize += parts[i]->subSize;
#endif
ok[i] = false;
}
delete[] isIn;
@ -605,7 +607,9 @@ namespace pal
search_time = clock();
std::cout << " Improved solution: " << ( double )( search_time - start_time ) / ( double ) CLOCKS_PER_SEC << " (solution cost: " << sol->cost << ", nbDisplayed: " << nbActive << " (" << ( double ) nbActive / ( double ) nbft << ")" << std::endl;
#if _VERBOSE_
std::cerr << "\t" << subPartTotalSize;
#endif
if ( searchMethod == POPMUSIC_TABU )
std::cerr << "\tpop_tabu\t";
else if ( searchMethod == POPMUSIC_TABU_CHAIN )
@ -970,8 +974,6 @@ namespace pal
itwImp = probSize * pal->tabuMinIt;
stop_it = itwImp;
max_it = probSize * pal->tabuMaxIt;
cur_cost = 0.0;
nbOverlap = 0;
@ -1983,7 +1985,7 @@ namespace pal
double cur_cost = 0;
double best_cost = 0;
int nbOverlap = 0;
// int nbOverlap = 0;
int seed;
@ -2008,7 +2010,7 @@ namespace pal
for ( i = 0; i < subSize; i++ )
{
cur_cost += compute_feature_cost( part, i, sol[i], &featOv );
nbOverlap += featOv;
// nbOverlap += featOv;
}
initial_cost = cur_cost;
@ -2140,7 +2142,7 @@ namespace pal
double cur_cost = 0;
double best_cost = 0;
int nbOverlap = 0;
// int nbOverlap = 0;
int seed;
@ -2149,9 +2151,6 @@ namespace pal
int lid;
int fid;
int *tmpsol = new int[subSize];
int *tabu_list = new int[subSize];
Chain *retainedChain = NULL;
@ -2176,7 +2175,7 @@ namespace pal
for ( i = 0; i < subSize; i++ )
{
cur_cost += compute_feature_cost( part, i, sol[i], &featOv );
nbOverlap += featOv;
// nbOverlap += featOv;
}
initial_cost = cur_cost;
@ -2375,7 +2374,6 @@ namespace pal
featWrap[sub[i]] = -1;
delete[] best_sol;
delete[] tmpsol;
delete[] tabu_list;
@ -2393,8 +2391,6 @@ namespace pal
void Problem::check_solution()
{
LabelPosition *lp;
int *solution = new int[nbft];
double amin[2];
@ -2427,7 +2423,7 @@ namespace pal
while ( list->size() > 0 )
{
lp = list->pop_front();
LabelPosition *lp = list->pop_front();
int probFeatId = lp->getProblemFeatureId();
if ( solution[probFeatId] >= 0 )
{
@ -2447,6 +2443,8 @@ namespace pal
std::cerr << "Feat " << i << " : " << solution[i] << "<-->" << sol->s[i] << std::endl;
}
}
delete [] solution;
}
typedef struct _nokContext

View File

@ -261,7 +261,7 @@ void QgsApplication::setFileOpenEventReceiver( QObject * receiver )
}
}
void QgsApplication::setPrefixPath( const QString thePrefixPath, bool useDefaultPaths )
void QgsApplication::setPrefixPath( const QString &thePrefixPath, bool useDefaultPaths )
{
ABISYM( mPrefixPath ) = thePrefixPath;
#if defined(_MSC_VER)
@ -279,12 +279,12 @@ void QgsApplication::setPrefixPath( const QString thePrefixPath, bool useDefault
ABISYM( mLibexecPath ) = ABISYM( mPrefixPath ) + "/" + QGIS_LIBEXEC_SUBDIR + "/";
}
void QgsApplication::setPluginPath( const QString thePluginPath )
void QgsApplication::setPluginPath( const QString &thePluginPath )
{
ABISYM( mPluginPath ) = thePluginPath;
}
void QgsApplication::setPkgDataPath( const QString thePkgDataPath )
void QgsApplication::setPkgDataPath( const QString &thePkgDataPath )
{
ABISYM( mPkgDataPath ) = thePkgDataPath;
QString mySvgPath = thePkgDataPath + ( ABISYM( mRunningFromBuildDir ) ? "/images/svg/" : "/svg/" );
@ -336,7 +336,7 @@ QString QgsApplication::iconPath( QString iconFile )
return defaultThemePath() + iconFile;
}
QIcon QgsApplication::getThemeIcon( const QString theName )
QIcon QgsApplication::getThemeIcon( const QString &theName )
{
QString myPreferredPath = activeThemePath() + QDir::separator() + theName;
QString myDefaultPath = defaultThemePath() + QDir::separator() + theName;
@ -357,7 +357,7 @@ QIcon QgsApplication::getThemeIcon( const QString theName )
}
// TODO: add some caching mechanism ?
QPixmap QgsApplication::getThemePixmap( const QString theName )
QPixmap QgsApplication::getThemePixmap( const QString &theName )
{
QString myPreferredPath = activeThemePath() + QDir::separator() + theName;
QString myDefaultPath = defaultThemePath() + QDir::separator() + theName;
@ -376,7 +376,7 @@ QPixmap QgsApplication::getThemePixmap( const QString theName )
/*!
Set the theme path to the specified theme.
*/
void QgsApplication::setThemeName( const QString theThemeName )
void QgsApplication::setThemeName( const QString &theThemeName )
{
QString myPath = ":/images/themes/" + theThemeName + "/";
//check it exists and if not roll back to default theme

View File

@ -64,7 +64,7 @@ class CORE_EXPORT QgsApplication: public QApplication
* based on the supplied theme name exists. If it does not the theme name will
* be reverted to 'default'.
*/
static void setThemeName( const QString theThemeName );
static void setThemeName( const QString &theThemeName );
/** Set the active theme to the specified theme.
* The theme name should be a single word e.g. 'default','classic'.
@ -157,12 +157,12 @@ class CORE_EXPORT QgsApplication: public QApplication
//! Helper to get a theme icon. It will fall back to the
//! default theme if the active theme does not have the required icon.
//! @note Added in 2.0
static QIcon getThemeIcon( const QString theName );
static QIcon getThemeIcon( const QString &theName );
//! Helper to get a theme icon as a pixmap. It will fall back to the
//! default theme if the active theme does not have the required icon.
//! @note Added in 2.0
static QPixmap getThemePixmap( const QString theName );
static QPixmap getThemePixmap( const QString &theName );
//! Returns the path to user's style. Added in QGIS 1.4
static const QString userStyleV2Path();
@ -179,13 +179,13 @@ class CORE_EXPORT QgsApplication: public QApplication
static const QString libexecPath();
//! Alters prefix path - used by 3rd party apps
static void setPrefixPath( const QString thePrefixPath, bool useDefaultPaths = false );
static void setPrefixPath( const QString &thePrefixPath, bool useDefaultPaths = false );
//! Alters plugin path - used by 3rd party apps
static void setPluginPath( const QString thePluginPath );
static void setPluginPath( const QString &thePluginPath );
//! Alters pkg data path - used by 3rd party apps
static void setPkgDataPath( const QString thePkgDataPath );
static void setPkgDataPath( const QString &thePkgDataPath );
//! Alters default svg paths - used by 3rd party apps. Added in QGIS 1.5
static void setDefaultSvgPaths( const QStringList& pathList );

View File

@ -149,7 +149,7 @@ QString QgsAttributeAction::expandAction( QString action, const QgsAttributeMap
for ( int i = 0; i < 4; i++ )
{
for ( QgsAttributeMap::const_iterator it = attributes.begin(); it != attributes.end(); it++ )
for ( QgsAttributeMap::const_iterator it = attributes.begin(); it != attributes.end(); ++it )
{
int attrIdx = it.key();
if ( attrIdx < 0 || attrIdx >= fields.count() )

View File

@ -113,7 +113,7 @@ bool QgsCoordinateReferenceSystem::createFromId( const long theId, CrsType theTy
return result;
}
bool QgsCoordinateReferenceSystem::createFromString( const QString theDefinition )
bool QgsCoordinateReferenceSystem::createFromString( const QString &theDefinition )
{
bool result = false;
QRegExp reCrsId( "^(epsg|postgis|internal)\\:(\\d+)$", Qt::CaseInsensitive );
@ -157,7 +157,7 @@ bool QgsCoordinateReferenceSystem::createFromString( const QString theDefinition
return result;
}
bool QgsCoordinateReferenceSystem::createFromUserInput( const QString theDefinition )
bool QgsCoordinateReferenceSystem::createFromUserInput( const QString &theDefinition )
{
QString theWkt;
char *wkt = NULL;
@ -416,7 +416,7 @@ bool QgsCoordinateReferenceSystem::axisInverted() const
return mAxisInverted != 0;
}
bool QgsCoordinateReferenceSystem::createFromWkt( QString theWkt )
bool QgsCoordinateReferenceSystem::createFromWkt( const QString &theWkt )
{
mIsValidFlag = false;
mWkt.clear();
@ -496,7 +496,7 @@ bool QgsCoordinateReferenceSystem::isValid() const
return mIsValidFlag;
}
bool QgsCoordinateReferenceSystem::createFromProj4( const QString theProj4String )
bool QgsCoordinateReferenceSystem::createFromProj4( const QString &theProj4String )
{
//
// Examples:

View File

@ -116,7 +116,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* @param theWkt The Wkt for the desired spatial reference system.
* @return bool TRUE if success else false
*/
bool createFromWkt( const QString theWkt );
bool createFromWkt( const QString &theWkt );
/*! Set up this srs by fetching the appropriate information from the
* sqlite backend. If the srsid is < 100000, only the system srs.db
@ -154,7 +154,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* @param theProjString A proj4 format string
* @return bool TRUE if success else false
*/
bool createFromProj4( const QString theProjString );
bool createFromProj4( const QString &theProjString );
/*! Set up this srs from a string definition, by default a WKT definition. Otherwise
* the string defines a authority, followed by a colon, followed by the definition.
@ -163,7 +163,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* uses the corresponding createFrom... function.
* @param theDefinition A String containing a coordinate reference system definition.
*/
bool createFromString( const QString theDefinition );
bool createFromString( const QString &theDefinition );
/*! Set up this srs from a various text formats.
*
@ -180,7 +180,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
*
* @note added in 1.8
*/
bool createFromUserInput( const QString theDefinition );
bool createFromUserInput( const QString &theDefinition );
/*! Make sure that ESRI WKT import is done properly.
* This is required for proper shapefile CRS import when using gdal>= 1.9.

View File

@ -276,11 +276,11 @@ QgsPoint QgsCoordinateTransform::transform( const QgsPoint thePoint, TransformDi
{
transformCoords( 1, &x, &y, &z, direction );
}
catch ( QgsCsException &cse )
catch ( const QgsCsException & )
{
// rethrow the exception
QgsDebugMsg( "rethrowing exception" );
throw cse;
throw;
}
return QgsPoint( x, y );
@ -293,11 +293,11 @@ QgsPoint QgsCoordinateTransform::transform( const double theX, const double theY
{
return transform( QgsPoint( theX, theY ), direction );
}
catch ( QgsCsException &cse )
catch ( const QgsCsException & )
{
// rethrow the exception
QgsDebugMsg( "rethrowing exception" );
throw cse;
throw;
}
}
@ -320,11 +320,11 @@ QgsRectangle QgsCoordinateTransform::transform( const QgsRectangle theRect, Tran
transformCoords( 1, &x1, &y1, &z, direction );
transformCoords( 1, &x2, &y2, &z, direction );
}
catch ( QgsCsException &cse )
catch ( const QgsCsException & )
{
// rethrow the exception
QgsDebugMsg( "rethrowing exception" );
throw cse;
throw;
}
#ifdef COORDINATE_TRANSFORM_VERBOSE
@ -354,11 +354,11 @@ void QgsCoordinateTransform::transformInPlace( double& x, double& y, double& z,
{
transformCoords( 1, &x, &y, &z, direction );
}
catch ( QgsCsException &cse )
catch ( const QgsCsException & )
{
// rethrow the exception
QgsDebugMsg( "rethrowing exception" );
throw cse;
throw;
}
}
@ -388,11 +388,11 @@ void QgsCoordinateTransform::transformPolygon( QPolygonF& poly, TransformDirecti
{
transformCoords( nVertices, x.data(), y.data(), z.data(), direction );
}
catch ( QgsCsException &cse )
catch ( const QgsCsException & )
{
// rethrow the exception
QgsDebugMsg( "rethrowing exception" );
throw cse;
throw;
}
for ( int i = 0; i < nVertices; ++i )
@ -421,11 +421,11 @@ void QgsCoordinateTransform::transformInPlace(
{
transformCoords( x.size(), &x[0], &y[0], &z[0], direction );
}
catch ( QgsCsException &cse )
catch ( const QgsCsException & )
{
// rethrow the exception
QgsDebugMsg( "rethrowing exception" );
throw cse;
throw;
}
}
@ -449,11 +449,11 @@ void QgsCoordinateTransform::transformInPlace( float& x, float& y, float& z,
y = yd;
z = zd;
}
catch ( QgsCsException &cse )
catch ( QgsCsException & )
{
// rethrow the exception
QgsDebugMsg( "rethrowing exception" );
throw cse;
throw;
}
}
@ -494,11 +494,11 @@ void QgsCoordinateTransform::transformInPlace(
z[i] = zd[i];
}
}
catch ( QgsCsException &cse )
catch ( QgsCsException & )
{
// rethrow the exception
QgsDebugMsg( "rethrowing exception" );
throw cse;
throw;
}
}
#endif //ANDROID
@ -565,11 +565,11 @@ QgsRectangle QgsCoordinateTransform::transformBoundingBox( const QgsRectangle re
{
transformCoords( numP * numP, x, y, z, direction );
}
catch ( QgsCsException &cse )
catch ( const QgsCsException & )
{
// rethrow the exception
QgsDebugMsg( "rethrowing exception" );
throw cse;
throw;
}
// Calculate the bounding box and use that for the extent

View File

@ -1728,8 +1728,8 @@ void QgsExpression::acceptVisitor( QgsExpression::Visitor& v ) const
mRootNode->accept( v );
}
QString QgsExpression::replaceExpressionText( QString action, const QgsFeature* feat,
QgsVectorLayer* layer,
QString QgsExpression::replaceExpressionText( const QString &action, const QgsFeature *feat,
QgsVectorLayer *layer,
const QMap<QString, QVariant> *substitutionMap )
{
QString expr_action;

View File

@ -174,8 +174,8 @@ class CORE_EXPORT QgsExpression
Additional substitutions can be passed through the substitutionMap
parameter
*/
static QString replaceExpressionText( const QString action, const QgsFeature* feat,
QgsVectorLayer* layer,
static QString replaceExpressionText( const QString &action, const QgsFeature *feat,
QgsVectorLayer *layer,
const QMap<QString, QVariant> *substitutionMap = 0 );
enum UnaryOperator
{

View File

@ -1603,7 +1603,7 @@ bool QgsGeometry::deleteVertex( int atVertex )
int* nPoints = ( int* )ptr;
if (( *nPoints ) < 3 || vertexnr > ( *nPoints ) - 1 || vertexnr < 0 ) //line needs at least 2 vertices
{
delete newbuffer;
delete [] newbuffer;
return false;
}
int newNPoints = ( *nPoints ) - 1; //new number of points
@ -1659,7 +1659,7 @@ bool QgsGeometry::deleteVertex( int atVertex )
{
if ( *nPoints < 3 ) //line needs at least 2 vertices
{
delete newbuffer;
delete [] newbuffer;
return false;
}
newNPoint = ( *nPoints ) - 1;
@ -1717,7 +1717,7 @@ bool QgsGeometry::deleteVertex( int atVertex )
{
if ( *nPoints < 5 ) //a ring has at least 3 points
{
delete newbuffer;
delete [] newbuffer;
return false;
}
newNPoints = *nPoints - 1;
@ -1795,7 +1795,7 @@ bool QgsGeometry::deleteVertex( int atVertex )
{
if ( *nPoints < 5 ) //a ring has at least 3 points
{
delete newbuffer;
delete [] newbuffer;
return false;
}
newNPoints = *nPoints - 1;
@ -1917,7 +1917,7 @@ bool QgsGeometry::insertVertex( double x, double y, int beforeVertex )
case QGis::WKBPoint25D:
case QGis::WKBPoint://cannot insert a vertex before another one on point types
{
delete newbuffer;
delete [] newbuffer;
return false;
}
case QGis::WKBMultiPoint25D:
@ -2167,7 +2167,7 @@ bool QgsGeometry::insertVertex( double x, double y, int beforeVertex )
}
else
{
delete newbuffer;
delete [] newbuffer;
return false;
}
}
@ -4096,10 +4096,6 @@ QString QgsGeometry::exportToWkt() const
{
return QString();
}
int *ringStart; // index of first point for each ring
int *ringNumPoints; // number of points in each ring
ringStart = new int[*numRings];
ringNumPoints = new int[*numRings];
ptr = mGeometry + 1 + 2 * sizeof( int ); // set pointer to the first ring
for ( idx = 0; idx < *numRings; idx++ )
{
@ -4110,7 +4106,6 @@ QString QgsGeometry::exportToWkt() const
mWkt += "(";
// get number of points in the ring
nPoints = ( int * ) ptr;
ringNumPoints[idx] = *nPoints;
ptr += 4;
for ( jdx = 0; jdx < *nPoints; jdx++ )
@ -4134,8 +4129,6 @@ QString QgsGeometry::exportToWkt() const
mWkt += ")";
}
mWkt += ")";
delete [] ringStart;
delete [] ringNumPoints;
return mWkt;
}
@ -4378,10 +4371,6 @@ QString QgsGeometry::exportToGeoJSON() const
{
return QString();
}
int *ringStart; // index of first point for each ring
int *ringNumPoints; // number of points in each ring
ringStart = new int[*numRings];
ringNumPoints = new int[*numRings];
ptr = mGeometry + 1 + 2 * sizeof( int ); // set pointer to the first ring
for ( idx = 0; idx < *numRings; idx++ )
{
@ -4392,7 +4381,6 @@ QString QgsGeometry::exportToGeoJSON() const
mWkt += "[ ";
// get number of points in the ring
nPoints = ( int * ) ptr;
ringNumPoints[idx] = *nPoints;
ptr += 4;
for ( jdx = 0; jdx < *nPoints; jdx++ )
@ -4418,8 +4406,6 @@ QString QgsGeometry::exportToGeoJSON() const
mWkt += " ]";
}
mWkt += " ] }";
delete [] ringStart;
delete [] ringNumPoints;
return mWkt;
}
@ -5274,7 +5260,7 @@ bool QgsGeometry::convertToMultiType()
newMultiType = QGis::WKBMultiPolygon25D;
break;
default:
delete newGeometry;
delete [] newGeometry;
return false;
}
memcpy( &newGeometry[currentWkbPosition], &newMultiType, sizeof( int ) );

View File

@ -134,7 +134,7 @@ QgsRectangle QgsMapLayer::extent()
}
/** Write blend mode for layer */
void QgsMapLayer::setBlendMode( const QPainter::CompositionMode blendMode )
void QgsMapLayer::setBlendMode( const QPainter::CompositionMode &blendMode )
{
mBlendMode = blendMode;
emit blendModeChanged( blendMode );
@ -766,7 +766,7 @@ QString QgsMapLayer::loadDefaultStyle( bool & theResultFlag )
return loadNamedStyle( styleURI(), theResultFlag );
}
bool QgsMapLayer::loadNamedStyleFromDb( const QString db, const QString theURI, QString &qml )
bool QgsMapLayer::loadNamedStyleFromDb( const QString &db, const QString &theURI, QString &qml )
{
QgsDebugMsg( QString( "db = %1 uri = %2" ).arg( db ).arg( theURI ) );
@ -810,7 +810,7 @@ bool QgsMapLayer::loadNamedStyleFromDb( const QString db, const QString theURI,
return theResultFlag;
}
QString QgsMapLayer::loadNamedStyle( const QString theURI, bool &theResultFlag )
QString QgsMapLayer::loadNamedStyle( const QString &theURI, bool &theResultFlag )
{
QgsDebugMsg( QString( "uri = %1 myURI = %2" ).arg( theURI ).arg( publicSource() ) );
@ -948,7 +948,7 @@ QString QgsMapLayer::saveDefaultStyle( bool & theResultFlag )
return saveNamedStyle( styleURI(), theResultFlag );
}
QString QgsMapLayer::saveNamedStyle( const QString theURI, bool & theResultFlag )
QString QgsMapLayer::saveNamedStyle( const QString &theURI, bool &theResultFlag )
{
QString myErrorMessage;
QDomDocument myDocument;
@ -1123,7 +1123,7 @@ void QgsMapLayer::exportSldStyle( QDomDocument &doc, QString &errorMsg )
doc = myDocument;
}
QString QgsMapLayer::saveSldStyle( const QString theURI, bool & theResultFlag )
QString QgsMapLayer::saveSldStyle( const QString &theURI, bool &theResultFlag )
{
QString errorMsg;
QDomDocument myDocument;
@ -1180,7 +1180,7 @@ QString QgsMapLayer::saveSldStyle( const QString theURI, bool & theResultFlag )
return tr( "ERROR: Failed to created SLD style file as %1. Check file permissions and retry." ).arg( filename );
}
QString QgsMapLayer::loadSldStyle( const QString theURI, bool &theResultFlag )
QString QgsMapLayer::loadSldStyle( const QString &theURI, bool &theResultFlag )
{
QgsDebugMsg( "Entered." );

View File

@ -120,7 +120,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
const QString& metadataUrlFormat() const { return mMetadataUrlFormat; }
/* Set the blending mode used for rendering a layer */
void setBlendMode( const QPainter::CompositionMode blendMode );
void setBlendMode( const QPainter::CompositionMode &blendMode );
/* Returns the current blending mode for a layer */
QPainter::CompositionMode blendMode() const;
@ -288,9 +288,9 @@ class CORE_EXPORT QgsMapLayer : public QObject
* @return a QString with any status messages
* @see also loadDefaultStyle ();
*/
virtual QString loadNamedStyle( const QString theURI, bool & theResultFlag );
virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
virtual bool loadNamedStyleFromDb( const QString db, const QString theURI, QString &qml );
virtual bool loadNamedStyleFromDb( const QString &db, const QString &theURI, QString &qml );
//TODO edit infos
/**
@ -333,12 +333,12 @@ class CORE_EXPORT QgsMapLayer : public QObject
* @return a QString with any status messages
* @sa saveDefaultStyle()
*/
virtual QString saveNamedStyle( const QString theURI, bool & theResultFlag );
virtual QString saveNamedStyle( const QString &theURI, bool &theResultFlag );
virtual QString saveSldStyle( const QString theURI, bool & theResultFlag );
virtual QString loadSldStyle( const QString theURI, bool &theResultFlag );
virtual QString saveSldStyle( const QString &theURI, bool &theResultFlag );
virtual QString loadSldStyle( const QString &theURI, bool &theResultFlag );
virtual bool readSld( const QDomNode& node, QString& errorMessage )
virtual bool readSld( const QDomNode &node, QString &errorMessage )
{ Q_UNUSED( node ); errorMessage = QString( "Layer type %1 not supported" ).arg( type() ); return false; }
@ -358,7 +358,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
virtual bool writeSymbology( QDomNode &node, QDomDocument& doc, QString& errorMessage ) const = 0;
/** Return pointer to layer's undo stack */
QUndoStack* undoStack();
QUndoStack *undoStack();
/** Get the QImage used for caching render operations
* @note This method was added in QGIS 1.4 **/
@ -433,7 +433,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
void dataChanged();
/** Signal emitted when the blend mode is changed, through QgsMapLayer::setBlendMode() */
void blendModeChanged( const QPainter::CompositionMode blendMode );
void blendModeChanged( const QPainter::CompositionMode &blendMode );
protected:
/** Set the extent */

View File

@ -1010,7 +1010,7 @@ void QgsMapRenderer::updateFullExtent()
if ( lyr->extent().isEmpty() )
{
it++;
++it;
continue;
}
@ -1022,7 +1022,7 @@ void QgsMapRenderer::updateFullExtent()
mFullExtent.unionRect( extent );
}
it++;
++it;
}
if ( mFullExtent.width() == 0.0 || mFullExtent.height() == 0.0 )
@ -1302,7 +1302,7 @@ const QgsCoordinateTransform *QgsMapRenderer::transformation( const QgsMapLayer
/** Returns a QPainter::CompositionMode corresponding to a QgsMapRenderer::BlendMode
*/
QPainter::CompositionMode QgsMapRenderer::getCompositionMode( const QgsMapRenderer::BlendMode blendMode )
QPainter::CompositionMode QgsMapRenderer::getCompositionMode( const QgsMapRenderer::BlendMode &blendMode )
{
// Map QgsMapRenderer::BlendNormal to QPainter::CompositionMode
switch ( blendMode )
@ -1338,7 +1338,7 @@ QPainter::CompositionMode QgsMapRenderer::getCompositionMode( const QgsMapRender
}
}
QgsMapRenderer::BlendMode QgsMapRenderer::getBlendModeEnum( const QPainter::CompositionMode blendMode )
QgsMapRenderer::BlendMode QgsMapRenderer::getBlendModeEnum( const QPainter::CompositionMode &blendMode )
{
// Map QPainter::CompositionMode to QgsMapRenderer::BlendNormal
switch ( blendMode )

View File

@ -290,10 +290,10 @@ class CORE_EXPORT QgsMapRenderer : public QObject
//! Returns a QPainter::CompositionMode corresponding to a BlendMode
//! Added in 1.9
static QPainter::CompositionMode getCompositionMode( const QgsMapRenderer::BlendMode blendMode );
static QPainter::CompositionMode getCompositionMode( const QgsMapRenderer::BlendMode &blendMode );
//! Returns a BlendMode corresponding to a QPainter::CompositionMode
//! Added in 1.9
static QgsMapRenderer::BlendMode getBlendModeEnum( const QPainter::CompositionMode blendMode );
static QgsMapRenderer::BlendMode getBlendModeEnum( const QPainter::CompositionMode &blendMode );
void addLayerCoordinateTransform( const QString& layerId, const QString& srcAuthId, const QString& destAuthId, int srcDatumTransform = -1, int destDatumTransform = -1 );
void clearLayerCoordinateTransforms();

View File

@ -70,8 +70,6 @@ float QgsMapToPixelSimplifier::calculateViewPixelTolerance( const QgsRectangle&
//! Returns the BBOX of the specified WKB-point stream
inline static QgsRectangle calculateBoundingBox( QGis::WkbType wkbType, unsigned char* wkb, size_t numPoints )
{
unsigned char* wkb2 = wkb;
double xmin = std::numeric_limits<double>::max(), x, y;
double ymin = std::numeric_limits<double>::max();
double xmax = -std::numeric_limits<double>::max();
@ -90,7 +88,6 @@ inline static QgsRectangle calculateBoundingBox( QGis::WkbType wkbType, unsigned
if ( xmax < x ) xmax = x;
if ( ymax < y ) ymax = y;
}
wkb = wkb2;
return QgsRectangle( xmin, ymin, xmax, ymax );
}
@ -167,7 +164,7 @@ inline static bool generalizeWkbGeometry( QGis::WkbType wkbType, unsigned char*
memcpy( targetWkb, &y1, sizeof( double ) ); targetWkb += sizeof( double );
}
targetWkbSize += targetWkb - wkb2;
targetWkb = wkb2;
return true;
}

View File

@ -780,7 +780,7 @@ QgsGeometry* QgsOgcUtils::geometryFromGMLMultiPolygon( const QDomElement& geomet
return g;
}
bool QgsOgcUtils::readGMLCoordinates( QgsPolyline &coords, const QDomElement elem )
bool QgsOgcUtils::readGMLCoordinates( QgsPolyline &coords, const QDomElement &elem )
{
QString coordSeparator = ",";
QString tupelSeparator = " ";
@ -861,7 +861,7 @@ QgsRectangle QgsOgcUtils::rectangleFromGMLBox( const QDomNode& boxNode )
return rect;
}
bool QgsOgcUtils::readGMLPositions( QgsPolyline &coords, const QDomElement elem )
bool QgsOgcUtils::readGMLPositions( QgsPolyline &coords, const QDomElement &elem )
{
//tupel and coord separator are the same
QString coordSeparator = " ";
@ -1243,10 +1243,7 @@ QDomElement QgsOgcUtils::geometryToGML( QgsGeometry* geometry, QDomDocument& doc
{
return QDomElement();
}
int *ringStart; // index of first point for each ring
int *ringNumPoints; // number of points in each ring
ringStart = new int[*numRings];
ringNumPoints = new int[*numRings];
int *ringNumPoints = new int[*numRings]; // number of points in each ring
ptr = wkb + 1 + 2 * sizeof( int ); // set pointer to the first ring
for ( idx = 0; idx < *numRings; idx++ )
{
@ -1287,7 +1284,6 @@ QDomElement QgsOgcUtils::geometryToGML( QgsGeometry* geometry, QDomDocument& doc
boundaryElem.appendChild( ringElem );
polygonElem.appendChild( boundaryElem );
}
delete [] ringStart;
delete [] ringNumPoints;
return polygonElem;
}

View File

@ -95,14 +95,14 @@ class CORE_EXPORT QgsOgcUtils
@param coords list where the found coordinates are appended
@param elem the \verbatim <gml:coordinates> \endverbatim element
@return boolean for success*/
static bool readGMLCoordinates( QgsPolyline &coords, const QDomElement elem );
static bool readGMLCoordinates( QgsPolyline &coords, const QDomElement &elem );
/** Reads the \verbatim <gml:pos> \endverbatim or \verbatim <gml:posList> \endverbatim
and extracts the coordinates as points
@param coords list where the found coordinates are appended
@param elem the \verbatim <gml:pos> \endverbatim or
\verbatim <gml:posList> \endverbatim element
@return boolean for success*/
static bool readGMLPositions( QgsPolyline &coords, const QDomElement elem );
static bool readGMLPositions( QgsPolyline &coords, const QDomElement &elem );
/**Create a GML coordinates element from a point list.

View File

@ -1372,9 +1372,7 @@ void QgsPalLayerSettings::calculateLabelSize( const QFontMetricsF* fm, QString t
}
else // called externally with passed-in feature, evaluate data defined
{
QVariant exprVal = QVariant();
exprVal = dataDefinedValue( QgsPalLayerSettings::MultiLineWrapChar, *f, *mCurFields );
QVariant exprVal = dataDefinedValue( QgsPalLayerSettings::MultiLineWrapChar, *f, *mCurFields );
if ( exprVal.isValid() )
{
wrapchr = exprVal.toString();

View File

@ -809,8 +809,8 @@ void QgsProjectFileTransform::convertRasterProperties( QDomDocument& doc, QDomNo
}
}
int QgsProjectFileTransform::rasterBandNumber( const QDomElement& rasterPropertiesElem, const QString bandName,
QgsRasterLayer* rlayer )
int QgsProjectFileTransform::rasterBandNumber( const QDomElement &rasterPropertiesElem, const QString &bandName,
QgsRasterLayer *rlayer )
{
if ( !rlayer )
{

View File

@ -87,8 +87,8 @@ class CORE_EXPORT QgsProjectFileTransform
void transform1800to1900();
//helper functions
static int rasterBandNumber( const QDomElement& rasterPropertiesElem, const QString bandName, QgsRasterLayer* rlayer );
static void transformContrastEnhancement( QDomDocument& doc, const QDomElement& rasterproperties, QDomElement& rendererElem );
static int rasterBandNumber( const QDomElement &rasterPropertiesElem, const QString &bandName, QgsRasterLayer *rlayer );
static void transformContrastEnhancement( QDomDocument &doc, const QDomElement &rasterproperties, QDomElement &rendererElem );
static void transformRasterTransparency( QDomDocument& doc, const QDomElement& orig, QDomElement& rendererElem );
};

View File

@ -42,7 +42,6 @@ void QgsPropertyValue::dump( int tabs ) const
} // QgsPropertyValue::dump()
bool QgsPropertyValue::readXML( QDomNode & keyNode )
{
// this *should* be a Dom element node
@ -265,9 +264,7 @@ bool QgsPropertyValue::writeXML( QString const & nodeName,
} // QgsPropertyValue::writeXML
QgsPropertyKey::QgsPropertyKey( QString const name )
QgsPropertyKey::QgsPropertyKey( const QString &name )
: mName( name )
{}
@ -330,17 +327,19 @@ void QgsPropertyKey::dump( int tabs ) const
i.value()->dump( tabs + 1 );
}
// qDebug("<%s>", name().toUtf8().constData());
// if ( i.value()->isValue() )
// {
// qDebug(" <%s>", i.key().toUtf8().constData() );
// }
// i.value()->dump();
// if ( i.value()->isValue() )
// {
// qDebug(" </%s>", i.key().toUtf8().constData() );
// }
// qDebug("</%s>", name().toUtf8().constData());
#if 0
qDebug( "<%s>", name().toUtf8().constData() );
if ( i.value()->isValue() )
{
qDebug( " <%s>", i.key().toUtf8().constData() );
}
i.value()->dump();
if ( i.value()->isValue() )
{
qDebug( " </%s>", i.key().toUtf8().constData() );
}
qDebug( "</%s>", name().toUtf8().constData() );
#endif
}
}

View File

@ -198,7 +198,7 @@ class CORE_EXPORT QgsPropertyValue : public QgsProperty
class CORE_EXPORT QgsPropertyKey : public QgsProperty
{
public:
QgsPropertyKey( const QString name = "" );
QgsPropertyKey( const QString &name = "" );
virtual ~ QgsPropertyKey();
/// every key has a name

View File

@ -216,7 +216,7 @@ QgsProviderRegistry::~QgsProviderRegistry()
if ( cleanupFunc )
cleanupFunc();
}
it++;
++it;
}
}
@ -282,7 +282,7 @@ QString QgsProviderRegistry::pluginList( bool asHTML ) const
else
list += "\n";
it++;
++it;
}
if ( asHTML )
@ -462,7 +462,7 @@ QString QgsProviderRegistry::protocolDrivers() const
QStringList QgsProviderRegistry::providerList() const
{
QStringList lst;
for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); it++ )
for ( Providers::const_iterator it = mProviders.begin(); it != mProviders.end(); ++it )
{
lst.append( it->first );
}

View File

@ -1177,7 +1177,7 @@ QgsRectangle QgsVectorLayer::extent()
rect.combineExtentWith( &r );
}
for ( QgsFeatureMap::iterator it = mEditBuffer->mAddedFeatures.begin(); it != mEditBuffer->mAddedFeatures.end(); it++ )
for ( QgsFeatureMap::iterator it = mEditBuffer->mAddedFeatures.begin(); it != mEditBuffer->mAddedFeatures.end(); ++it )
{
if ( it->geometry() )
{
@ -1701,7 +1701,7 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
const QMap<QString, QgsMapLayer*> &layers = QgsMapLayerRegistry::instance()->mapLayers();
QMap<QString, QgsMapLayer*>::const_iterator it;
for ( it = layers.constBegin(); it != layers.constEnd() && ( *it )->name() != lName; it++ )
for ( it = layers.constBegin(); it != layers.constEnd() && ( *it )->name() != lName; ++it )
;
if ( it != layers.constEnd() && stuff.size() > 2 )
@ -2284,7 +2284,7 @@ bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString&
{
const QMap<QString, QVariant> &map = mValueMaps[ it.key()];
for ( QMap<QString, QVariant>::const_iterator vmit = map.begin(); vmit != map.end(); vmit++ )
for ( QMap<QString, QVariant>::const_iterator vmit = map.begin(); vmit != map.end(); ++vmit )
{
QDomElement value = doc.createElement( "valuepair" );
value.setAttribute( "key", vmit.key() );
@ -2448,7 +2448,7 @@ bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString&
{
QDomElement tabsElem = doc.createElement( "attributeEditorForm" );
for ( QList< QgsAttributeEditorElement* >::const_iterator it = mAttributeEditorElements.begin(); it != mAttributeEditorElements.end(); it++ )
for ( QList< QgsAttributeEditorElement* >::const_iterator it = mAttributeEditorElements.begin(); it != mAttributeEditorElements.end(); ++it )
{
QDomElement attributeEditorWidgetElem = ( *it )->toDomElement( doc );
tabsElem.appendChild( attributeEditorWidgetElem );
@ -3023,7 +3023,7 @@ const QString QgsVectorLayer::displayField() const
return mDisplayField;
}
void QgsVectorLayer::setDisplayExpression( const QString displayExpression )
void QgsVectorLayer::setDisplayExpression( const QString &displayExpression )
{
mDisplayExpression = displayExpression;
}
@ -3517,7 +3517,7 @@ QVariant QgsVectorLayer::maximumValue( int index )
}
/** Write blend mode for features */
void QgsVectorLayer::setFeatureBlendMode( const QPainter::CompositionMode featureBlendMode )
void QgsVectorLayer::setFeatureBlendMode( const QPainter::CompositionMode &featureBlendMode )
{
mFeatureBlendMode = featureBlendMode;
emit featureBlendModeChanged( featureBlendMode );
@ -4083,12 +4083,12 @@ void QgsVectorLayer::saveStyleToDatabase( QString name, QString description,
QString QgsVectorLayer::loadNamedStyle( const QString theURI, bool &theResultFlag )
QString QgsVectorLayer::loadNamedStyle( const QString &theURI, bool &theResultFlag )
{
return loadNamedStyle( theURI, theResultFlag, false );
}
QString QgsVectorLayer::loadNamedStyle( const QString theURI, bool &theResultFlag , bool loadFromLocalDB )
QString QgsVectorLayer::loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDB )
{
QgsDataSourceURI dsUri( theURI );
if ( !loadFromLocalDB && !dsUri.database().isEmpty() )

View File

@ -129,11 +129,11 @@ class CORE_EXPORT QgsAttributeEditorField : public QgsAttributeEditorElement
class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorElement
{
public:
QgsAttributeEditorRelation( QString name , const QString relationId, QObject *parent )
QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
: QgsAttributeEditorElement( AeTypeRelation, name, parent )
, mRelationId( relationId ) {}
QgsAttributeEditorRelation( QString name , const QgsRelation& relation, QObject *parent )
QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
: QgsAttributeEditorElement( AeTypeRelation, name, parent )
, mRelationId( relation.id() )
, mRelation( relation ) {}
@ -589,7 +589,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* for this layer
* @note added in 2.0
*/
void setDisplayExpression( const QString displayExpression );
void setDisplayExpression( const QString &displayExpression );
/**
* Get the preview expression, used to create a human readable preview string.
@ -794,13 +794,13 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @param theResultFlag will be set to true if a named style is correctly loaded
* @param loadFromLocalDb if true forces to load from local db instead of datasource one
*/
virtual QString loadNamedStyle( const QString theURI, bool &theResultFlag, bool loadFromLocalDb );
virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
/**
* Calls loadNamedStyle( theURI, theResultFlag, false );
* Retained for backward compatibility
*/
virtual QString loadNamedStyle( const QString theURI, bool &theResultFlag );
virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
virtual bool applyNamedStyle( QString namedStyle , QString errorMsg );
@ -1247,14 +1247,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
*/
QList<QgsRelation> referencingRelations( int idx );
/**
* Get relations, where the foreign key is on another layer, referencing this layer
*
* @param idx Only get relations, where idx forms part of the referenced key
* @return A list of relations
*/
QList<QgsRelation> referencedRelations( int idx );
/**access date format
* @note added in 1.9
*/
@ -1344,7 +1336,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
/* Set the blending mode used for rendering each feature
* @note added in 2.0
*/
void setFeatureBlendMode( const QPainter::CompositionMode blendMode );
void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
/* Returns the current blending mode for features
* @note added in 2.0
*/
@ -1532,7 +1524,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
void rendererChanged();
/** Signal emitted when setFeatureBlendMode() is called */
void featureBlendModeChanged( const QPainter::CompositionMode blendMode );
void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
/** Signal emitted when setLayerTransparency() is called */
void layerTransparencyChanged( int layerTransparency );

View File

@ -85,7 +85,7 @@ void QgsVectorLayerEditBuffer::updateChangedAttributes( QgsFeature &f )
if ( mChangedAttributeValues.contains( f.id() ) )
{
const QgsAttributeMap &map = mChangedAttributeValues[f.id()];
for ( QgsAttributeMap::const_iterator it = map.begin(); it != map.end(); it++ )
for ( QgsAttributeMap::const_iterator it = map.begin(); it != map.end(); ++it )
attrs[it.key()] = it.value();
}
}
@ -377,7 +377,7 @@ bool QgsVectorLayerEditBuffer::commitChanges( QStringList& commitErrors )
{
commitErrors << tr( "SUCCESS: %n feature(s) deleted.", "deleted features count", mDeletedFeatureIds.size() );
// TODO[MD]: we should not need this here
for ( QgsFeatureIds::const_iterator it = mDeletedFeatureIds.begin(); it != mDeletedFeatureIds.end(); it++ )
for ( QgsFeatureIds::const_iterator it = mDeletedFeatureIds.begin(); it != mDeletedFeatureIds.end(); ++it )
{
mChangedAttributeValues.remove( *it );
mChangedGeometries.remove( *it );

View File

@ -579,7 +579,7 @@ void QgsVectorLayerFeatureIterator::updateChangedAttributes( QgsFeature &f )
if ( mChangedAttributeValues.contains( f.id() ) )
{
const QgsAttributeMap &map = mChangedAttributeValues[f.id()];
for ( QgsAttributeMap::const_iterator it = map.begin(); it != map.end(); it++ )
for ( QgsAttributeMap::const_iterator it = map.begin(); it != map.end(); ++it )
attrs[it.key()] = it.value();
}
}

View File

@ -183,8 +183,8 @@ QgsRasterBlock* QgsMultiBandColorRenderer::block( int bandNo, QgsRectangle cons
{
// We should free the alloced mem from block().
QgsDebugMsg( "No input band" );
bandIt--;
for ( ; bandIt != bands.constBegin(); bandIt-- )
--bandIt;
for ( ; bandIt != bands.constBegin(); --bandIt )
{
delete bandBlocks[*bandIt];
}

View File

@ -89,9 +89,8 @@ QgsRasterBlock* QgsSingleBandColorDataRenderer::block( int bandNo, QgsRectangle
for ( qgssize i = 0; i < ( qgssize )width*height; i++ )
{
QRgb pixelColor;
double alpha = 255.0;
QRgb c = inputBlock->color( i );
alpha = qAlpha( c );
double alpha = qAlpha( c );
pixelColor = qRgba( mOpacity * qRed( c ), mOpacity * qGreen( c ), mOpacity * qBlue( c ), mOpacity * alpha );
outputBlock->setColor( i, pixelColor );
}
@ -103,9 +102,7 @@ QgsRasterBlock* QgsSingleBandColorDataRenderer::block( int bandNo, QgsRectangle
void QgsSingleBandColorDataRenderer::writeXML( QDomDocument& doc, QDomElement& parentElem ) const
{
if ( parentElem.isNull() )
{
return;
}
QDomElement rasterRendererElem = doc.createElement( "rasterrenderer" );
_writeXML( doc, rasterRendererElem );

View File

@ -37882,7 +37882,7 @@ fnct_IsClosed (sqlite3_context * context, int argc, sqlite3_value ** argv)
else
{
line = simpleLinestring (geo);
if (!line < 0)
if (!line)
sqlite3_result_int (context, -1);
else
sqlite3_result_int (context, gaiaIsClosed (line));
@ -37957,7 +37957,7 @@ fnct_IsRing (sqlite3_context * context, int argc, sqlite3_value ** argv)
else
{
line = simpleLinestring (geo);
if (!line < 0)
if (!line)
sqlite3_result_int (context, -1);
else
{

View File

@ -468,7 +468,7 @@ void QgsCategorizedSymbolRendererV2::toSld( QDomDocument &doc, QDomElement &elem
props[ "scale" ] = QString( mSizeScaleField ).append( "\"" ).prepend( "\"" );
// create a Rule for each range
for ( QgsCategoryList::const_iterator it = mCategories.constBegin(); it != mCategories.constEnd(); it++ )
for ( QgsCategoryList::const_iterator it = mCategories.constBegin(); it != mCategories.constEnd(); ++it )
{
QgsStringMap catProps( props );
it->toSld( doc, element, catProps );
@ -566,7 +566,7 @@ QDomElement QgsCategorizedSymbolRendererV2::save( QDomDocument& doc )
QgsSymbolV2Map symbols;
QDomElement catsElem = doc.createElement( "categories" );
QgsCategoryList::const_iterator it = mCategories.constBegin();
for ( ; it != mCategories.end(); it++ )
for ( ; it != mCategories.end(); ++it )
{
const QgsRendererCategoryV2& cat = *it;
QString symbolName = QString::number( i );

View File

@ -581,11 +581,11 @@ QPointF QgsGradientFillSymbolLayerV2::rotateReferencePoint( const QPointF & refP
return rotatedReferencePoint;
}
void QgsGradientFillSymbolLayerV2::applyGradient( const QgsSymbolV2RenderContext& context, QBrush& brush,
const QColor& color, const QColor& color2, const GradientColorType gradientColorType,
QgsVectorColorRampV2 * gradientRamp, const GradientType gradientType,
const GradientCoordinateMode coordinateMode, const GradientSpread gradientSpread,
const QPointF referencePoint1, const QPointF referencePoint2, const double angle )
void QgsGradientFillSymbolLayerV2::applyGradient( const QgsSymbolV2RenderContext &context, QBrush &brush,
const QColor &color, const QColor &color2, const GradientColorType &gradientColorType,
QgsVectorColorRampV2 *gradientRamp, const GradientType &gradientType,
const GradientCoordinateMode &coordinateMode, const GradientSpread &gradientSpread,
const QPointF &referencePoint1, const QPointF &referencePoint2, const double angle )
{
//update alpha of gradient colors
QColor fillColor = color;

View File

@ -136,8 +136,10 @@ class CORE_EXPORT QgsGradientFillSymbolLayerV2 : public QgsFillSymbolLayerV2
Repeat
};
QgsGradientFillSymbolLayerV2( QColor color = DEFAULT_SIMPLEFILL_COLOR, QColor color2 = Qt::white,
GradientColorType gradientColorType = SimpleTwoColor, GradientType gradientType = Linear,
QgsGradientFillSymbolLayerV2( QColor color = DEFAULT_SIMPLEFILL_COLOR,
QColor color2 = Qt::white,
GradientColorType gradientColorType = SimpleTwoColor,
GradientType gradientType = Linear,
GradientCoordinateMode coordinateMode = Feature,
GradientSpread gradientSpread = Pad
);
@ -243,9 +245,9 @@ class CORE_EXPORT QgsGradientFillSymbolLayerV2 : public QgsFillSymbolLayerV2
/**Applies the gradient to a brush*/
void applyGradient( const QgsSymbolV2RenderContext& context, QBrush& brush, const QColor& color, const QColor& color2,
const GradientColorType gradientColorType, QgsVectorColorRampV2 * gradientRamp, const GradientType gradientType,
const GradientCoordinateMode coordinateMode, const GradientSpread gradientSpread, const QPointF referencePoint1,
const QPointF referencePoint2, const double angle );
const GradientColorType &gradientColorType, QgsVectorColorRampV2 *gradientRamp, const GradientType &gradientType,
const GradientCoordinateMode &coordinateMode, const GradientSpread &gradientSpread,
const QPointF &referencePoint1, const QPointF &referencePoint2, const double angle );
/**rotates a reference point by a specified angle around the point (0.5, 0.5)*/
QPointF rotateReferencePoint( const QPointF & refPoint, double angle );

View File

@ -377,7 +377,7 @@ void QgsGraduatedSymbolRendererV2::toSld( QDomDocument& doc, QDomElement &elemen
props[ "scale" ] = QString( mSizeScaleField ).append( "\"" ).prepend( "\"" );
// create a Rule for each range
for ( QgsRangeList::const_iterator it = mRanges.constBegin(); it != mRanges.constEnd(); it++ )
for ( QgsRangeList::const_iterator it = mRanges.constBegin(); it != mRanges.constEnd(); ++it )
{
QgsStringMap catProps( props );
it->toSld( doc, element, catProps );
@ -578,11 +578,6 @@ static QList<double> _calcPrettyBreaks( double minimum, double maximum, int clas
start = start - k / 2;
end = end + k / 2 + k % 2;
}
divisions = minimumCount;
}
else
{
divisions = k;
}
double minimumBreak = start * unit;
//double maximumBreak = end * unit;
@ -1009,7 +1004,7 @@ QDomElement QgsGraduatedSymbolRendererV2::save( QDomDocument& doc )
QgsSymbolV2Map symbols;
QDomElement rangesElem = doc.createElement( "ranges" );
QgsRangeList::const_iterator it = mRanges.constBegin();
for ( ; it != mRanges.constEnd(); it++ )
for ( ; it != mRanges.constEnd(); ++it )
{
const QgsRendererRangeV2& range = *it;
QString symbolName = QString::number( i );

View File

@ -105,7 +105,7 @@ QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::takeChildAt( int i )
Rule* rule = mChildren.takeAt( i );
rule->mParent = NULL;
return rule;
updateElseRules();
// updateElseRules();
}
void QgsRuleBasedRendererV2::Rule::updateElseRules()
@ -838,7 +838,7 @@ QgsLegendSymbologyList QgsRuleBasedRendererV2::legendSymbologyItems( QSize iconS
{
QgsLegendSymbologyList lst;
QgsLegendSymbolList items = legendSymbolItems();
for ( QgsLegendSymbolList::iterator it = items.begin(); it != items.end(); it++ )
for ( QgsLegendSymbolList::iterator it = items.begin(); it != items.end(); ++it )
{
QPair<QString, QgsSymbolV2*> pair = *it;
QPixmap pix = QgsSymbolLayerV2Utils::symbolPreviewPixmap( pair.second, iconSize );

View File

@ -1392,7 +1392,7 @@ bool QgsStyleV2::importXML( QString filename )
}
// save the symbols with proper name
for ( QMap<QString, QgsSymbolV2*>::iterator it = symbols.begin(); it != symbols.end(); it++ )
for ( QMap<QString, QgsSymbolV2*>::iterator it = symbols.begin(); it != symbols.end(); ++it )
{
addSymbol( it.key(), it.value() );
}

View File

@ -1069,10 +1069,12 @@ bool QgsSymbolLayerV2Utils::hasExternalGraphic( QDomElement &element )
{
return true;
}
#if 0
else if ( !inlineContentElem.isNull() )
{
return false; // not implemented yet
}
#endif
else
{
return false;
@ -1369,8 +1371,10 @@ bool QgsSymbolLayerV2Utils::convertPolygonSymbolizerToPointMarker( QDomElement &
found = true;
break;
}
#if 0
else if ( !inlineContentElem.isNull() )
continue; // TODO: not implemeneted yet
continue; // TODO: not implemented yet
#endif
else
continue;
}

View File

@ -79,6 +79,7 @@ namespace QgisGui
* provide filters with all available writable image formats.
* @param theParent widget that should act as the parent for the file dialog
* @param theMessage the message to display to the user
* @param defaultFilename default file name (empty by default)
* @return QPair<QString, QString> where first is the file name and second is
* the file type
* @note added in 1.6

View File

@ -312,7 +312,7 @@ QWidget* QgsAttributeEditor::createAttributeEditor( QWidget* parent, QWidget* ed
{
cb->setEditable( false );
for ( QList<QVariant>::iterator it = values.begin(); it != values.end(); it++ )
for ( QList<QVariant>::iterator it = values.begin(); it != values.end(); ++it )
cb->addItem( it->toString(), it->toString() );
myWidget = cb;
@ -347,7 +347,7 @@ QWidget* QgsAttributeEditor::createAttributeEditor( QWidget* parent, QWidget* ed
QComboBox *cb = comboBox( editor, parent );
if ( cb )
{
for ( QMap<QString, QVariant>::const_iterator it = map.begin(); it != map.end(); it++ )
for ( QMap<QString, QVariant>::const_iterator it = map.begin(); it != map.end(); ++it )
{
cb->addItem( it.key(), it.value() );
}
@ -421,7 +421,7 @@ QWidget* QgsAttributeEditor::createAttributeEditor( QWidget* parent, QWidget* ed
cb->addItem( tr( "(no selection)" ), settings.value( "qgis/nullValue", "NULL" ).toString() );
}
for ( QMap< QString, QString >::const_iterator it = map.begin(); it != map.end(); it++ )
for ( QMap< QString, QString >::const_iterator it = map.begin(); it != map.end(); ++it )
{
if ( data.mOrderByValue )
cb->addItem( it.key(), it.value() );
@ -439,7 +439,7 @@ QWidget* QgsAttributeEditor::createAttributeEditor( QWidget* parent, QWidget* ed
{
QStringList checkList = value.toString().remove( QChar( '{' ) ).remove( QChar( '}' ) ).split( "," );
for ( QMap< QString, QString >::const_iterator it = map.begin(); it != map.end(); it++ )
for ( QMap< QString, QString >::const_iterator it = map.begin(); it != map.end(); ++it )
{
QListWidgetItem *item;
if ( data.mOrderByValue )
@ -496,7 +496,7 @@ QWidget* QgsAttributeEditor::createAttributeEditor( QWidget* parent, QWidget* ed
QComboBox *cb = comboBox( editor, parent );
if ( cb )
{
for ( QMap<QString, QString>::const_iterator it = classes.begin(); it != classes.end(); it++ )
for ( QMap<QString, QString>::const_iterator it = classes.begin(); it != classes.end(); ++it )
{
cb->addItem( it.value(), it.key() );
}
@ -644,7 +644,7 @@ QWidget* QgsAttributeEditor::createAttributeEditor( QWidget* parent, QWidget* ed
vl->dataProvider()->uniqueValues( idx, values );
QStringList svalues;
for ( QList<QVariant>::const_iterator it = values.begin(); it != values.end(); it++ )
for ( QList<QVariant>::const_iterator it = values.begin(); it != values.end(); ++it )
svalues << it->toString();
QCompleter *c = new QCompleter( svalues );

View File

@ -233,9 +233,8 @@ void QgsCollapsibleGroupBoxBasic::checkClicked( bool chkd )
void QgsCollapsibleGroupBoxBasic::toggleCollapsed()
{
// verify if sender is this group box's collapse button
bool senderCollBtn = false;
QgsGroupBoxCollapseButton* collBtn = qobject_cast<QgsGroupBoxCollapseButton*>( QObject::sender() );
senderCollBtn = ( collBtn && collBtn == mCollapseButton );
QgsGroupBoxCollapseButton *collBtn = qobject_cast<QgsGroupBoxCollapseButton*>( QObject::sender() );
bool senderCollBtn = ( collBtn && collBtn == mCollapseButton );
mAltDown = ( mAltDown || mCollapseButton->altDown() );
mShiftDown = ( mShiftDown || mCollapseButton->shiftDown() );

View File

@ -162,7 +162,7 @@ QgsMapCanvas::~QgsMapCanvas()
{
QGraphicsItem* item = *it;
delete item;
it++;
++it;
}
mScene->deleteLater(); // crashes in python tests on windows
@ -1094,7 +1094,7 @@ void QgsMapCanvas::updateCanvasItemPositions()
item->updatePosition();
}
it++;
++it;
}
}
@ -1488,7 +1488,7 @@ void QgsMapCanvas::moveCanvasContents( bool reset )
canvasItem->setPanningOffset( pnt );
}
it++;
++it;
}
// show items

View File

@ -107,7 +107,7 @@ QList<QgsMapToolIdentify::IdentifyResult> QgsMapToolIdentify::identify( int x, i
mLayerIdResults.clear();
QList<IdentifyResult> idResult = identify( x, y, TopDownAll );
QList<IdentifyResult>::const_iterator it = idResult.constBegin();
for ( ; it != idResult.constEnd(); it++ )
for ( ; it != idResult.constEnd(); ++it )
{
QgsMapLayer *layer = it->mLayer;
if ( mLayerIdResults.contains( layer ) )

View File

@ -428,7 +428,7 @@ void QgsOWSSourceSelect::populateCRS()
// if not, use one of the available CRS
QString defaultCRS;
QSet<QString>::const_iterator it = mSelectedLayersCRSs.begin();
for ( ; it != mSelectedLayersCRSs.end(); it++ )
for ( ; it != mSelectedLayersCRSs.end(); ++it )
{
if ( it->compare( mSelectedCRS, Qt::CaseInsensitive ) == 0 )
break;

View File

@ -145,8 +145,7 @@ QgsCptCityColorRampV2Dialog::QgsCptCityColorRampV2Dialog( QgsCptCityColorRampV2*
QgsDebugMsg( "looking for ramp " + mRamp->schemeName() );
if ( mRamp->schemeName() != "" )
{
bool found = false;
found = updateRamp();
bool found = updateRamp();
if ( ! found )
{
tabBar->setCurrentIndex( 1 );

View File

@ -357,7 +357,7 @@ int main( int argc, char * argv[] )
{
theServer = new QgsWCSServer( parameterMap );
}
catch ( QgsMapServiceException e ) //admin.sld may be invalid
catch ( const QgsMapServiceException &e ) //admin.sld may be invalid
{
theRequestHandler->sendServiceException( e );
continue;
@ -449,7 +449,7 @@ int main( int argc, char * argv[] )
{
theServer = new QgsWFSServer( parameterMap );
}
catch ( QgsMapServiceException e ) //admin.sld may be invalid
catch ( const QgsMapServiceException &e ) //admin.sld may be invalid
{
theRequestHandler->sendServiceException( e );
continue;
@ -516,26 +516,16 @@ int main( int argc, char * argv[] )
QString outputFormat = parameterMap.value( "OUTPUTFORMAT" );
try
{
if ( theServer->getFeature( *theRequestHandler, outputFormat ) != 0 )
{
delete theRequestHandler;
delete theServer;
continue;
}
else
{
delete theRequestHandler;
delete theServer;
continue;
}
theServer->getFeature( *theRequestHandler, outputFormat );
}
catch ( QgsMapServiceException& ex )
{
theRequestHandler->sendServiceException( ex );
delete theRequestHandler;
delete theServer;
continue;
}
delete theRequestHandler;
delete theServer;
continue;
}
else if ( request.compare( "Transaction", Qt::CaseInsensitive ) == 0 )
{
@ -565,7 +555,7 @@ int main( int argc, char * argv[] )
{
theServer = new QgsWMSServer( parameterMap, theMapRenderer );
}
catch ( QgsMapServiceException e ) //admin.sld may be invalid
catch ( const QgsMapServiceException &e ) //admin.sld may be invalid
{
theRequestHandler->sendServiceException( e );
continue;

View File

@ -169,7 +169,7 @@ void QgsProjectParser::featureTypeList( QDomElement& parentElement, QDomDocument
//We use the layer name even though it might not be unique.
//Because the id sometimes contains user/pw information and the name is more descriptive
QString typeName = layer->name();
typeName = typeName.replace( QString( " " ), QString( "_" ) );
typeName = typeName.replace( " ", "_" );
QDomText nameText = doc.createTextNode( typeName );
nameElem.appendChild( nameText );
layerElem.appendChild( nameElem );
@ -304,7 +304,7 @@ void QgsProjectParser::wcsContentMetadata( QDomElement& parentElement, QDomDocum
//We use the layer name even though it might not be unique.
//Because the id sometimes contains user/pw information and the name is more descriptive
QString typeName = layer->name();
typeName = typeName.replace( QString( " " ), QString( "_" ) );
typeName = typeName.replace( " ", "_" );
QDomText nameText = doc.createTextNode( typeName );
nameElem.appendChild( nameText );
layerElem.appendChild( nameElem );
@ -492,11 +492,13 @@ void QgsProjectParser::describeFeatureType( const QString& aTypeName, QDomElemen
{
QgsMapLayer *mLayer = createLayerFromElement( elem );
QgsVectorLayer* layer = dynamic_cast<QgsVectorLayer*>( mLayer );
if ( !layer )
continue;
QString typeName = layer->name();
typeName = typeName.replace( QString( " " ), QString( "_" ) );
typeName = typeName.replace( " ", "_" );
if ( layer && wfsLayersId.contains( layer->id() ) && ( aTypeName == "" || typeNameList.contains( typeName ) ) )
if ( wfsLayersId.contains( layer->id() ) && ( aTypeName == "" || typeNameList.contains( typeName ) ) )
{
//do a select with searchRect and go through all the features
QgsVectorDataProvider* provider = layer->dataProvider();
@ -657,9 +659,11 @@ void QgsProjectParser::describeCoverage( const QString& aCoveName, QDomElement&
{
//QgsMapLayer *layer = createLayerFromElement( *layerIt );
QgsMapLayer *layer = createLayerFromElement( elem );
if ( !layer )
continue;
QString coveName = layer->name();
coveName = coveName.replace( QString( " " ), QString( "_" ) );
if ( layer && ( aCoveName == "" || coveNameList.contains( coveName ) ) )
coveName = coveName.replace( " ", "_" );
if ( aCoveName == "" || coveNameList.contains( coveName ) )
{
QgsDebugMsg( QString( "add layer %1 to map" ).arg( layer->id() ) );
layerMap.insert( layer->id(), layer );
@ -669,7 +673,7 @@ void QgsProjectParser::describeCoverage( const QString& aCoveName, QDomElement&
//We use the layer name even though it might not be unique.
//Because the id sometimes contains user/pw information and the name is more descriptive
QString typeName = layer->name();
typeName = typeName.replace( QString( " " ), QString( "_" ) );
typeName = typeName.replace( " ", "_" );
QDomText nameText = doc.createTextNode( typeName );
nameElem.appendChild( nameText );
layerElem.appendChild( nameElem );
@ -850,7 +854,7 @@ QList<QgsMapLayer*> QgsProjectParser::mapLayerFromTypeName( const QString& tName
QgsVectorLayer* layer = dynamic_cast<QgsVectorLayer*>( mLayer );
QString typeName = layer->name();
typeName = typeName.replace( QString( " " ), QString( "_" ) );
typeName = typeName.replace( " ", "_" );
if ( tName == typeName )
{
layerList.push_back( mLayer );
@ -879,7 +883,7 @@ QList<QgsMapLayer*> QgsProjectParser::mapLayerFromCoverage( const QString& cName
QgsRasterLayer* layer = dynamic_cast<QgsRasterLayer*>( mLayer );
QString coveName = layer->name();
coveName = coveName.replace( QString( " " ), QString( "_" ) );
coveName = coveName.replace( " ", "_" );
if ( cName == coveName )
{
layerList.push_back( mLayer );
@ -934,9 +938,9 @@ void QgsProjectParser::addLayers( QDomDocument &doc,
QgsDebugMsg( QString( "Project path: %1" ).arg( project ) );
QString embeddedGroupName = currentChildElem.attribute( "name" );
QgsProjectParser* p = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( project ) );
QList<QDomElement> embeddedGroupElements = p->mLegendGroupElements;
if ( p )
{
QList<QDomElement> embeddedGroupElements = p->mLegendGroupElements;
QStringList pIdDisabled = p->identifyDisabledLayers();
QDomElement embeddedGroupElem;
@ -1284,9 +1288,9 @@ void QgsProjectParser::addOWSLayers( QDomDocument &doc,
QgsDebugMsg( QString( "Project path: %1" ).arg( project ) );
QString embeddedGroupName = currentChildElem.attribute( "name" );
QgsProjectParser* p = dynamic_cast<QgsProjectParser*>( QgsConfigCache::instance()->searchConfiguration( project ) );
QList<QDomElement> embeddedGroupElements = p->mLegendGroupElements;
if ( p )
{
QList<QDomElement> embeddedGroupElements = p->mLegendGroupElements;
QStringList pIdDisabled = p->identifyDisabledLayers();
QDomElement embeddedGroupElem;

View File

@ -1176,7 +1176,7 @@ QgsMapLayer* QgsSLDParser::mapLayerFromUserLayer( const QDomElement& userLayerEl
return theMapLayer;
}
QgsVectorLayer* QgsSLDParser::vectorLayerFromGML( const QDomElement gmlRootElement ) const
QgsVectorLayer* QgsSLDParser::vectorLayerFromGML( const QDomElement &gmlRootElement ) const
{
QgsDebugMsg( "Entering." );
@ -1367,7 +1367,7 @@ QgsVectorLayer* QgsSLDParser::contourLayerFromRaster( const QDomElement& userSty
hLayer, 0, nElevField,
GDALTermProgress, NULL );
delete adfFixedLevels;
delete [] adfFixedLevels;
OGR_DS_Destroy( hDS );
GDALClose( hSrcDS );
@ -1474,9 +1474,8 @@ void QgsSLDParser::setOpacityForLayer( const QDomElement& layerElem, QgsMapLayer
QgsDebugMsg( "Setting opacity value: " + QString::number( opacityValue ) );
layer->setTransparency( opacityValue );
}
#endif
void QgsSLDParser::clearRasterSymbology( QgsRasterLayer* rl ) const
void QgsSLDParser::clearRasterSymbology( QgsRasterLayer *rl ) const
{
if ( rl )
{
@ -1487,6 +1486,7 @@ void QgsSLDParser::clearRasterSymbology( QgsRasterLayer* rl ) const
}
}
}
#endif
void QgsSLDParser::setCrsForLayer( const QDomElement& layerElem, QgsMapLayer* ml ) const
{

View File

@ -123,7 +123,7 @@ class QgsSLDParser: public QgsConfigParser
Delegates the work to specific methods for <SendedVDS>, <HostedVDS> or <RemoteOWS>*/
QgsMapLayer* mapLayerFromUserLayer( const QDomElement& userLayerElem, const QString& layerName, bool allowCaching = true ) const;
/**Writes a temporary file and creates a vector layer. The file is removed at destruction time*/
QgsVectorLayer* vectorLayerFromGML( const QDomElement gmlRootElement ) const;
QgsVectorLayer* vectorLayerFromGML( const QDomElement &gmlRootElement ) const;
/**Creates a line layer (including renderer) from contour symboliser
@return the layer or 0 if no layer could be created*/
QgsVectorLayer* contourLayerFromRaster( const QDomElement& userStyleElem, QgsRasterLayer* rasterLayer ) const;
@ -132,10 +132,10 @@ class QgsSLDParser: public QgsConfigParser
#if 0
/**Sets the opacity on layer level if the <Opacity> tag is present*/
void setOpacityForLayer( const QDomElement& layerElem, QgsMapLayer* layer ) const;
#endif
/**Resets the former symbology of a raster layer. This is important for single band layers (e.g. dems)
coming from the cash*/
void clearRasterSymbology( QgsRasterLayer* rl ) const;
void clearRasterSymbology( QgsRasterLayer *rl ) const;
#endif
/**Reads attributes "epsg" or "proj" from layer element and sets specified CRS if present*/
void setCrsForLayer( const QDomElement& layerElem, QgsMapLayer* ml ) const;

View File

@ -145,11 +145,11 @@ QMap<QString, QString> QgsSOAPRequestHandler::parseInput()
{
formatString = "JPG";
}
else if ( formatString == "image/png" || formatString == "PNG" || formatString == "PNG" )
else if ( formatString == "image/png" || formatString == "PNG" || formatString == "png" )
{
formatString = "PNG";
}
else if ( formatString == "image/gif" || formatString == "GIF" || formatString == "GIF" )
else if ( formatString == "image/gif" || formatString == "GIF" || formatString == "gif" )
{
formatString = "GIF";
}

View File

@ -510,12 +510,12 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
else
{
QgsExpression *mFilter = QgsOgcUtils::expressionFromOgcFilter( filterElem );
if ( mFilter->hasParserError() )
{
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->parserErrorString() );
}
if ( mFilter )
{
if ( mFilter->hasParserError() )
{
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->parserErrorString() );
}
while ( fit.nextFeature( feature ) && featureCounter < maxFeat )
{
QVariant res = mFilter->evaluate( &feature, fields );
@ -828,12 +828,12 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
req.setSubsetOfAttributes( attrIndexes );
QgsFeatureIterator fit = layer->getFeatures( req );
QgsExpression *mFilter = new QgsExpression( expFilter );
if ( mFilter->hasParserError() )
{
throw QgsMapServiceException( "RequestNotWellFormed", QString( "Expression filter error message: %1." ).arg( mFilter->parserErrorString() ) );
}
if ( mFilter )
{
if ( mFilter->hasParserError() )
{
throw QgsMapServiceException( "RequestNotWellFormed", QString( "Expression filter error message: %1." ).arg( mFilter->parserErrorString() ) );
}
while ( fit.nextFeature( feature ) && featureCounter < maxFeat )
{
QVariant res = mFilter->evaluate( &feature, fields );
@ -928,12 +928,12 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
else
{
QgsExpression *mFilter = QgsOgcUtils::expressionFromOgcFilter( filterElem );
if ( mFilter->hasParserError() )
{
throw QgsMapServiceException( "RequestNotWellFormed", QString( "OGC expression filter error message: %1." ).arg( mFilter->parserErrorString() ) );
}
if ( mFilter )
{
if ( mFilter->hasParserError() )
{
throw QgsMapServiceException( "RequestNotWellFormed", QString( "OGC expression filter error message: %1." ).arg( mFilter->parserErrorString() ) );
}
QgsFeatureRequest req;
if ( layer->wkbType() != QGis::WKBNoGeometry )
{
@ -1607,12 +1607,12 @@ QgsFeatureIds QgsWFSServer::getFeatureIdsFromFilter( QDomElement filterElem, Qgs
else
{
QgsExpression *mFilter = QgsOgcUtils::expressionFromOgcFilter( filterElem );
if ( mFilter->hasParserError() )
{
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->parserErrorString() );
}
if ( mFilter )
{
if ( mFilter->hasParserError() )
{
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->parserErrorString() );
}
QgsFeature feature;
const QgsFields& fields = provider->fields();
QgsFeatureIterator fit = layer->getFeatures();

View File

@ -703,6 +703,7 @@ QByteArray* QgsWMSServer::getPrint( const QString& formatString )
return ba;
}
#if 0
QImage* QgsWMSServer::printCompositionToImage( QgsComposition* c ) const
{
int width = ( int )( c->paperWidth() * c->printResolution() / 25.4 ); //width in pixel
@ -718,6 +719,7 @@ QImage* QgsWMSServer::printCompositionToImage( QgsComposition* c ) const
p.end();
return image;
}
#endif
QImage* QgsWMSServer::getMap()
{
@ -833,19 +835,15 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
}
//read I,J resp. X,Y
QString iString, jString;
int i = -1;
int j = -1;
iString = mParameterMap.value( "I", mParameterMap.value( "X" ) );
i = iString.toInt( &conversionSuccess );
QString iString = mParameterMap.value( "I", mParameterMap.value( "X" ) );
int i = iString.toInt( &conversionSuccess );
if ( !conversionSuccess )
{
i = -1;
}
jString = mParameterMap.value( "J", mParameterMap.value( "Y" ) );
j = jString.toInt( &conversionSuccess );
QString jString = mParameterMap.value( "J", mParameterMap.value( "Y" ) );
int j = jString.toInt( &conversionSuccess );
if ( !conversionSuccess )
{
j = -1;
@ -1647,9 +1645,9 @@ 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() ) );
if ( theMapLayer )
{
QgsDebugMsg( QString( "Checking layer: %1" ).arg( theMapLayer->name() ) );
//test if layer is visible in requested scale
bool useScaleConstraint = ( scaleDenominator > 0 && theMapLayer->hasScaleBasedVisibility() );
if ( !useScaleConstraint ||

View File

@ -168,7 +168,9 @@ class QgsWMSServer
void legendParameters( double mmToPixelFactor, double fontOversamplingFactor, double& boxSpace, double& layerSpace, double& layerTitleSpace,
double& symbolSpace, double& iconLabelSpace, double& symbolWidth, double& symbolHeight, QFont& layerFont, QFont& itemFont, QColor& layerFontColor, QColor& itemFontColor );
#if 0
QImage* printCompositionToImage( QgsComposition* c ) const;
#endif
/**Apply filter (subset) strings from the request to the layers. Example: '&FILTER=<layer1>:"AND property > 100",<layer2>:"AND bla = 'hallo!'" '
@return a map with the original filters ( layer id / filter string )*/

View File

@ -45,9 +45,9 @@ static const QString sPluginIcon = ":/compass.svn";
* @param qgis Pointer to the QGIS main window
* @param _qI Pointer to the QGIS interface object
*/
QgsCompassPlugin::QgsCompassPlugin( QgisInterface * themQGisIface )
: QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( themQGisIface )
QgsCompassPlugin::QgsCompassPlugin( QgisInterface *themQGisIface )
: QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType )
, mQGisIface( themQGisIface )
{
/** Initialize the plugin */
mDock = NULL;

View File

@ -32,20 +32,20 @@ Builder::Builder( std::string theFname,
double *theGrpXVals, double *theGrpYVals,
std::string *theGrpNames,
int theInsertCount,
bool theConvertText ) :
fname( theFname ),
shapefileType( theShapefileType ),
grpXVals( theGrpXVals ),
grpYVals( theGrpYVals ),
grpNames( theGrpNames ),
insertCount( theInsertCount ),
convertText( theConvertText ),
fetchedprims( 0 ),
fetchedtexts( 0 ),
ignoringBlock( false ),
current_polyline_pointcount( 0 ),
currentBlockX( 0.0 ),
currentBlockY( 0.0 )
bool theConvertText )
: fname( theFname )
, shapefileType( theShapefileType )
, grpXVals( theGrpXVals )
, grpYVals( theGrpYVals )
, grpNames( theGrpNames )
, insertCount( theInsertCount )
, convertText( theConvertText )
, fetchedprims( 0 )
, fetchedtexts( 0 )
, ignoringBlock( false )
, current_polyline_pointcount( 0 )
, currentBlockX( 0.0 )
, currentBlockY( 0.0 )
{
}
@ -529,14 +529,8 @@ void Builder::print_shpObjects()
}
else
{
outputdbf = fname;
outputdbf = outputdbf.append( ".dbf" );
outputshp = fname;
outputshp = outputdbf.append( ".shp" );
outputtdbf = fname;
outputtdbf = outputtdbf.append( ".dbf" );
outputtshp = fname;
outputtshp = outputtdbf.append( ".shp" );
outputdbf = outputtdbf = fname + ".dbf";
outputshp = outputtshp = fname + ".shp";
}
DBFHandle dbffile = DBFCreate( outputdbf.c_str() );

View File

@ -88,20 +88,19 @@ static const QString sIcon = ":/evis/eVisEventBrowser.png";
eVis::eVis( QgisInterface * theQgisInterface ):
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface )
eVis::eVis( QgisInterface * theQgisInterface )
: QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType )
, mQGisIface( theQgisInterface )
{
mIdTool = 0;
}
eVis::~eVis( )
eVis::~eVis()
{
}
void eVis::initGui( )
void eVis::initGui()
{
// Create the action for tool
mDatabaseConnectionActionPointer = new QAction( QIcon( ":/evis/eVisDatabaseConnection.png" ), tr( "eVis Database Connection" ), this );
mEventIdToolActionPointer = new QAction( QIcon( ":/evis/eVisEventIdTool.png" ), tr( "eVis Event Id Tool" ), this );

View File

@ -63,7 +63,7 @@ int QgsGCPList::size() const
{
if (( *it )->isEnabled() )
s++;
it++;
++it;
}
return s;
}

View File

@ -78,10 +78,10 @@ static const QString sPluginIcon = ":/icons/default/mGeorefRun.png";
* @param theQGisApp - Pointer to the QGIS main window
* @param theQGisInterface - Pointer to the QGIS interface object
*/
QgsGeorefPlugin::QgsGeorefPlugin( QgisInterface * theQgisInterface ):
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( theQgisInterface ),
mPluginGui( NULL )
QgsGeorefPlugin::QgsGeorefPlugin( QgisInterface * theQgisInterface )
: QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType )
, mQGisIface( theQgisInterface )
, mPluginGui( NULL )
{
}

View File

@ -734,7 +734,7 @@ void QgsGeorefPluginGui::extentsChangedQGisCanvas()
}
// Canvas info slots (copy/pasted from QGIS :) )
void QgsGeorefPluginGui::showMouseCoords( QgsPoint p )
void QgsGeorefPluginGui::showMouseCoords( const QgsPoint &p )
{
mCoordsLabel->setText( p.toString( mMousePrecisionDecimalPlaces ) );
// Set minimum necessary width

View File

@ -105,7 +105,7 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas
void extentsChangedQGisCanvas();
// canvas info
void showMouseCoords( const QgsPoint pt );
void showMouseCoords( const QgsPoint &pt );
void updateMouseCoordinatePrecision();
// Histogram stretch

View File

@ -35,8 +35,8 @@ using std::pow;
class QgsLinearGeorefTransform : public QgsGeorefTransformInterface
{
public:
QgsLinearGeorefTransform() { }
~QgsLinearGeorefTransform() { }
QgsLinearGeorefTransform() {}
~QgsLinearGeorefTransform() {}
bool getOriginScale( QgsPoint &origin, double &scaleX, double &scaleY ) const;
@ -114,8 +114,8 @@ class QgsGDALGeorefTransform : public QgsGeorefTransformInterface
class QgsProjectiveGeorefTransform : public QgsGeorefTransformInterface
{
public:
QgsProjectiveGeorefTransform() { }
~QgsProjectiveGeorefTransform() { }
QgsProjectiveGeorefTransform() {}
~QgsProjectiveGeorefTransform() {}
bool updateParametersFromGCPs( const std::vector<QgsPoint> &mapCoords, const std::vector<QgsPoint> &pixelCoords );
uint getMinimumGCPCount() const;

View File

@ -282,7 +282,8 @@ void *QgsImageWarper::addGeoToPixelTransform( GDALTransformerFunc GDALTransforme
if ( !GDALInvGeoTransform( chain->adfGeotransform, chain->adfInvGeotransform ) )
{
// Error handling if inversion fails - although the inverse transform is not needed for warp operation
return NULL;
delete chain;
return 0;
}
return ( void* )chain;
}

View File

@ -179,7 +179,7 @@ void QgsLeastSquares::affine( std::vector<QgsPoint> mapCoords,
*
* Also returns 3x3 homogenous matrices which can be used to normalize and de-normalize coordinates.
*/
void normalizeCoordinates( const std::vector<QgsPoint> coords, std::vector<QgsPoint> &normalizedCoords,
void normalizeCoordinates( const std::vector<QgsPoint> &coords, std::vector<QgsPoint> &normalizedCoords,
double normalizeMatrix[9], double denormalizeMatrix[9] )
{
// Calculate center of gravity

View File

@ -21,7 +21,7 @@
#include "qgsgeorefvalidators.h"
#include "qgsmapcoordsdialog.h"
QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas* qgisCanvas, QgsPoint pixelCoords, QWidget* parent )
QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas* qgisCanvas, const QgsPoint &pixelCoords, QWidget* parent )
: QDialog( parent, Qt::Dialog ), mQgisCanvas( qgisCanvas ), mPixelCoords( pixelCoords )
{
setupUi( this );

View File

@ -46,7 +46,7 @@ class QgsMapCoordsDialog : public QDialog, private Ui::QgsMapCoordsDialogBase
Q_OBJECT
public:
QgsMapCoordsDialog( QgsMapCanvas* qgisCanvas, const QgsPoint pixelCoords, QWidget* parent = 0 );
QgsMapCoordsDialog( QgsMapCanvas *qgisCanvas, const QgsPoint &pixelCoords, QWidget *parent = 0 );
~QgsMapCoordsDialog();
private slots:

View File

@ -798,7 +798,7 @@ void GlobePlugin::elevationLayersChanged()
// Remove elevation layers
ElevationLayerVector list;
map->getElevationLayers( list );
for ( ElevationLayerVector::iterator i = list.begin(); i != list.end(); i++ )
for ( ElevationLayerVector::iterator i = list.begin(); i != list.end(); ++i )
{
map->removeElevationLayer( *i );
}

View File

@ -1799,7 +1799,7 @@ ControlNodeBin::draw( const ControlContext& context, bool newContext, int bin )
if ( _sortingEnabled && _sortByDistance )
{
for( ControlNodeCollection::iterator i = _controlNodes.begin(); i != _controlNodes.end(); i++)
for( ControlNodeCollection::iterator i = _controlNodes.begin(); i != _controlNodes.end(); ++i )
{
ControlNode* node = i->second.get();
if ( node->getNumParents() == 0 )

View File

@ -1479,7 +1479,7 @@ void QgsGrassMapcalc::clear()
}
/******************** CANVAS ITEMS ******************************/
QgsGrassMapcalcItem::QgsGrassMapcalcItem(): mSelected( false )
QgsGrassMapcalcItem::QgsGrassMapcalcItem() : mSelected( false )
{
QgsDebugMsg( "entered." );
}
@ -1500,9 +1500,12 @@ bool QgsGrassMapcalcItem::selected()
/**************************** OBJECT ************************/
QgsGrassMapcalcObject::QgsGrassMapcalcObject( int type )
: QGraphicsRectItem( -1000, -1000, 50, 20, 0 ), QgsGrassMapcalcItem(),
mType( type ), mCenter( -1000, -1000 ), mSelectionBoxSize( 5 ),
mOutputConnector( 0 )
: QGraphicsRectItem( -1000, -1000, 50, 20, 0 )
, QgsGrassMapcalcItem()
, mType( type )
, mCenter( -1000, -1000 )
, mSelectionBoxSize( 5 )
, mOutputConnector( 0 )
{
QgsDebugMsg( "entered." );

Some files were not shown because too many files have changed in this diff Show More