17 changes: 2 additions & 15 deletions src/analysis/interpolation/MathUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
12 changes: 6 additions & 6 deletions src/analysis/interpolation/NormVecDecorator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 ) ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscompositionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/app/gps/qgsgpsmarker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/app/legend/qgslegenditem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
1 change: 0 additions & 1 deletion src/app/legend/qgslegendlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] ) );
Expand Down
14 changes: 7 additions & 7 deletions src/app/pluginmanager/qgspluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
{
Expand Down Expand Up @@ -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" )
{
Expand All @@ -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" )
Expand All @@ -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" )
{
Expand All @@ -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" )
{
Expand All @@ -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" )
{
Expand All @@ -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() )
{
Expand Down
25 changes: 17 additions & 8 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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() ||
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsattributetypedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
Expand Down Expand Up @@ -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() )
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsattributetypeloaddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down Expand Up @@ -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() ) );
Expand Down
11 changes: 0 additions & 11 deletions src/app/qgsdecorationnortharrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/app/qgsdecorationscalebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++ )
{
Expand Down
22 changes: 11 additions & 11 deletions src/app/qgsidentifyresultsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) );
}
Expand Down Expand Up @@ -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() ) );
}
Expand All @@ -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() ) );
}
Expand Down Expand Up @@ -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() );
Expand Down Expand Up @@ -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;
Expand All @@ -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() )
Expand Down
8 changes: 2 additions & 6 deletions src/app/qgslabelinggui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsmaptoollabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/app/qgsmaptoolpinlabels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,21 +419,25 @@ 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();
}
else
{
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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolselectutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolselectutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 2 additions & 11 deletions src/app/qgspluginregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
Expand Down Expand Up @@ -162,7 +162,7 @@ void QgsPluginRegistry::unloadAll()
{
for ( QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
++it )
{
if ( it->plugin() )
{
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsprojectproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposereffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposereffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposeritem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
6 changes: 0 additions & 6 deletions src/core/composer/qgscomposermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
16 changes: 8 additions & 8 deletions src/core/dxf/qgsdxfexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions src/core/pal/feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down Expand Up @@ -892,7 +892,6 @@ namespace pal
{
orientation = -orientation;
delete slp;
slp = NULL;
slp = curvedPlacementAtOffset( path_positions, path_distances, orientation, initial_index, initial_distance );
}
else
Expand Down
10 changes: 5 additions & 5 deletions src/core/pal/pal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
30 changes: 14 additions & 16 deletions src/core/pal/problem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ namespace pal

double amin[2];
double amax[2];
LabelPosition *lp;
LabelPosition *lp2;

while ( run )
Expand All @@ -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;
Expand All @@ -212,7 +211,6 @@ namespace pal
lp2->removeFromIndex( candidates );
}

//lp->removeFromIndex(candidates);
featNbLp[i] = j + 1;
break;
}
Expand Down Expand Up @@ -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];
Expand All @@ -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;
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -970,8 +974,6 @@ namespace pal
itwImp = probSize * pal->tabuMinIt;
stop_it = itwImp;

max_it = probSize * pal->tabuMaxIt;

cur_cost = 0.0;
nbOverlap = 0;

Expand Down Expand Up @@ -1983,7 +1985,7 @@ namespace pal
double cur_cost = 0;
double best_cost = 0;

int nbOverlap = 0;
// int nbOverlap = 0;

int seed;

Expand All @@ -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;
Expand Down Expand Up @@ -2140,7 +2142,7 @@ namespace pal
double cur_cost = 0;
double best_cost = 0;

int nbOverlap = 0;
// int nbOverlap = 0;

int seed;

Expand All @@ -2149,9 +2151,6 @@ namespace pal
int lid;
int fid;

int *tmpsol = new int[subSize];


int *tabu_list = new int[subSize];

Chain *retainedChain = NULL;
Expand All @@ -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;
Expand Down Expand Up @@ -2375,7 +2374,6 @@ namespace pal
featWrap[sub[i]] = -1;

delete[] best_sol;
delete[] tmpsol;
delete[] tabu_list;


Expand All @@ -2393,8 +2391,6 @@ namespace pal

void Problem::check_solution()
{

LabelPosition *lp;
int *solution = new int[nbft];

double amin[2];
Expand Down Expand Up @@ -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 )
{
Expand All @@ -2447,6 +2443,8 @@ namespace pal
std::cerr << "Feat " << i << " : " << solution[i] << "<-->" << sol->s[i] << std::endl;
}
}

delete [] solution;
}

typedef struct _nokContext
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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/" );
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down Expand Up @@ -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();
Expand All @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsattributeaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgscoordinatereferencesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -496,7 +496,7 @@ bool QgsCoordinateReferenceSystem::isValid() const
return mIsValidFlag;
}

bool QgsCoordinateReferenceSystem::createFromProj4( const QString theProj4String )
bool QgsCoordinateReferenceSystem::createFromProj4( const QString &theProj4String )
{
//
// Examples:
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgscoordinatereferencesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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.
*
Expand All @@ -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.
Expand Down
36 changes: 18 additions & 18 deletions src/core/qgscoordinatetransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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;
}
}

Expand All @@ -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
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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;
}
}

Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsexpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
28 changes: 7 additions & 21 deletions src/core/qgsgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -2167,7 +2167,7 @@ bool QgsGeometry::insertVertex( double x, double y, int beforeVertex )
}
else
{
delete newbuffer;
delete [] newbuffer;
return false;
}
}
Expand Down Expand Up @@ -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++ )
{
Expand All @@ -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++ )
Expand All @@ -4134,8 +4129,6 @@ QString QgsGeometry::exportToWkt() const
mWkt += ")";
}
mWkt += ")";
delete [] ringStart;
delete [] ringNumPoints;
return mWkt;
}

Expand Down Expand Up @@ -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++ )
{
Expand All @@ -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++ )
Expand All @@ -4418,8 +4406,6 @@ QString QgsGeometry::exportToGeoJSON() const
mWkt += " ]";
}
mWkt += " ] }";
delete [] ringStart;
delete [] ringNumPoints;
return mWkt;
}

Expand Down Expand Up @@ -5274,7 +5260,7 @@ bool QgsGeometry::convertToMultiType()
newMultiType = QGis::WKBMultiPolygon25D;
break;
default:
delete newGeometry;
delete [] newGeometry;
return false;
}
memcpy( &newGeometry[currentWkbPosition], &newMultiType, sizeof( int ) );
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 ) );

Expand Down Expand Up @@ -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() ) );

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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." );

Expand Down
18 changes: 9 additions & 9 deletions src/core/qgsmaplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
/**
Expand Down Expand Up @@ -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; }


Expand All @@ -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 **/
Expand Down Expand Up @@ -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 */
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsmaprenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ void QgsMapRenderer::updateFullExtent()

if ( lyr->extent().isEmpty() )
{
it++;
++it;
continue;
}

Expand All @@ -1022,7 +1022,7 @@ void QgsMapRenderer::updateFullExtent()
mFullExtent.unionRect( extent );

}
it++;
++it;
}

if ( mFullExtent.width() == 0.0 || mFullExtent.height() == 0.0 )
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaprenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 1 addition & 4 deletions src/core/qgsmaptopixelgeometrysimplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 );
}
Expand Down Expand Up @@ -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;
}

Expand Down
10 changes: 3 additions & 7 deletions src/core/qgsogcutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = " ";
Expand Down Expand Up @@ -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 = " ";
Expand Down Expand Up @@ -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++ )
{
Expand Down Expand Up @@ -1287,7 +1284,6 @@ QDomElement QgsOgcUtils::geometryToGML( QgsGeometry* geometry, QDomDocument& doc
boundaryElem.appendChild( ringElem );
polygonElem.appendChild( boundaryElem );
}
delete [] ringStart;
delete [] ringNumPoints;
return polygonElem;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsogcutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions src/core/qgspallabeling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsprojectfiletransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsprojectfiletransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
};

Expand Down
29 changes: 14 additions & 15 deletions src/core/qgsprojectproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void QgsPropertyValue::dump( int tabs ) const
} // QgsPropertyValue::dump()



bool QgsPropertyValue::readXML( QDomNode & keyNode )
{
// this *should* be a Dom element node
Expand Down Expand Up @@ -265,9 +264,7 @@ bool QgsPropertyValue::writeXML( QString const & nodeName,
} // QgsPropertyValue::writeXML




QgsPropertyKey::QgsPropertyKey( QString const name )
QgsPropertyKey::QgsPropertyKey( const QString &name )
: mName( name )
{}

Expand Down Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsprojectproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsproviderregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ QgsProviderRegistry::~QgsProviderRegistry()
if ( cleanupFunc )
cleanupFunc();
}
it++;
++it;
}
}

Expand Down Expand Up @@ -282,7 +282,7 @@ QString QgsProviderRegistry::pluginList( bool asHTML ) const
else
list += "\n";

it++;
++it;
}

if ( asHTML )
Expand Down Expand Up @@ -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 );
}
Expand Down
16 changes: 8 additions & 8 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
{
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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() );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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() )
Expand Down
22 changes: 7 additions & 15 deletions src/core/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 );

Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayereditbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayerfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsmultibandcolorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
5 changes: 1 addition & 4 deletions src/core/raster/qgssinglebandcolordatarenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand All @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/core/spatialite/spatialite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down
10 changes: 5 additions & 5 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 7 additions & 5 deletions src/core/symbology-ng/qgsfillsymbollayerv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -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 );
Expand Down
9 changes: 2 additions & 7 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsstylev2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
Expand Down
6 changes: 5 additions & 1 deletion src/core/symbology-ng/qgssymbollayerv2utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgisgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/gui/qgsattributeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() );
}
Expand Down Expand Up @@ -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() );
Expand All @@ -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 )
Expand Down Expand Up @@ -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() );
}
Expand Down Expand Up @@ -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 );
Expand Down
5 changes: 2 additions & 3 deletions src/gui/qgscollapsiblegroupbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ QgsMapCanvas::~QgsMapCanvas()
{
QGraphicsItem* item = *it;
delete item;
it++;
++it;
}

mScene->deleteLater(); // crashes in python tests on windows
Expand Down Expand Up @@ -1094,7 +1094,7 @@ void QgsMapCanvas::updateCanvasItemPositions()
item->updatePosition();
}

it++;
++it;
}
}

Expand Down Expand Up @@ -1488,7 +1488,7 @@ void QgsMapCanvas::moveCanvasContents( bool reset )
canvasItem->setPanningOffset( pnt );
}

it++;
++it;
}

// show items
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaptoolidentify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsowssourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
26 changes: 8 additions & 18 deletions src/mapserver/qgis_map_serv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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;
Expand Down
26 changes: 15 additions & 11 deletions src/mapserver/qgsprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/mapserver/qgssldparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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." );

Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 )
{
Expand All @@ -1487,6 +1486,7 @@ void QgsSLDParser::clearRasterSymbology( QgsRasterLayer* rl ) const
}
}
}
#endif

void QgsSLDParser::setCrsForLayer( const QDomElement& layerElem, QgsMapLayer* ml ) const
{
Expand Down
6 changes: 3 additions & 3 deletions src/mapserver/qgssldparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/mapserver/qgssoaprequesthandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
32 changes: 16 additions & 16 deletions src/mapserver/qgswfsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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();
Expand Down
Loading