44 changes: 22 additions & 22 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ void QgisApp::dropEvent( QDropEvent *event )
if ( QgsMimeDataUtils::isUriList( event->mimeData() ) )
{
QgsMimeDataUtils::UriList lst = QgsMimeDataUtils::decodeUriList( event->mimeData() );
foreach( const QgsMimeDataUtils::Uri& u, lst )
foreach ( const QgsMimeDataUtils::Uri& u, lst )
{
if ( u.layerType == "vector" )
{
Expand Down Expand Up @@ -1103,7 +1103,7 @@ void QgisApp::setFontSize( int fontSize )
{
setStyleSheet( QString( "font-size: %1pt; " ).arg( fontSize ) );

foreach( QgsComposer *c, mPrintComposers )
foreach ( QgsComposer *c, mPrintComposers )
{
c->setFontSize( fontSize );
}
Expand Down Expand Up @@ -1241,7 +1241,7 @@ void QgisApp::createToolBars()

QList<QAction*> toolbarMenuActions;
// Set action names so that they can be used in customization
foreach( QToolBar *toolBar, toolbarMenuToolBars )
foreach ( QToolBar *toolBar, toolbarMenuToolBars )
{
toolBar->toggleViewAction()->setObjectName( "mActionToggle" + toolBar->objectName().mid( 1 ) );
toolbarMenuActions << toolBar->toggleViewAction();
Expand Down Expand Up @@ -1489,12 +1489,12 @@ void QgisApp::setIconSizes( int size )

//Change all current icon sizes.
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
foreach( QToolBar * toolbar, toolbars )
foreach ( QToolBar * toolbar, toolbars )
{
toolbar->setIconSize( QSize( size, size ) );
}

foreach( QgsComposer *c, mPrintComposers )
foreach ( QgsComposer *c, mPrintComposers )
{
c->setIconSizes( size );
}
Expand Down Expand Up @@ -2065,15 +2065,15 @@ void QgisApp::createDecorations()

void QgisApp::renderDecorationItems( QPainter *p )
{
foreach( QgsDecorationItem* item, mDecorationItems )
foreach ( QgsDecorationItem* item, mDecorationItems )
{
item->render( p );
}
}

void QgisApp::projectReadDecorationItems()
{
foreach( QgsDecorationItem* item, mDecorationItems )
foreach ( QgsDecorationItem* item, mDecorationItems )
{
item->projectRead( );
}
Expand Down Expand Up @@ -2150,7 +2150,7 @@ void QgisApp::updateProjectFromTemplates()
mProjectFromTemplateMenu->clear();

// Add entries
foreach( QString templateFile, templateFiles )
foreach ( QString templateFile, templateFiles )
{
mProjectFromTemplateMenu->addAction( templateFile );
}
Expand Down Expand Up @@ -2306,7 +2306,7 @@ void QgisApp::addVectorLayer()
bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QString& enc, const QString dataSourceType )
{
QList<QgsMapLayer *> myList;
foreach( QString src, theLayerQStringList )
foreach ( QString src, theLayerQStringList )
{
src = src.trimmed();
QString base;
Expand Down Expand Up @@ -2488,15 +2488,15 @@ bool QgisApp::askUserForZipItemLayers( QString path )

if ( chooseSublayersDialog.exec() )
{
foreach( int i, chooseSublayersDialog.getSelectionIndexes() )
foreach ( int i, chooseSublayersDialog.getSelectionIndexes() )
{
childItems << zipItem->children()[i];
}
}
}

// add childItems
foreach( QgsDataItem* item, childItems )
foreach ( QgsDataItem* item, childItems )
{
QgsLayerItem *layerItem = dynamic_cast<QgsLayerItem *>( item );
QgsDebugMsg( QString( "item path=%1 provider=" ).arg( item->path() ).arg( layerItem->providerKey() ) );
Expand Down Expand Up @@ -2573,7 +2573,7 @@ void QgisApp::askUserForGDALSublayers( QgsRasterLayer *layer )

if ( chooseSublayersDialog.exec() )
{
foreach( int i, chooseSublayersDialog.getSelectionIndexes() )
foreach ( int i, chooseSublayersDialog.getSelectionIndexes() )
{
QgsRasterLayer *rlayer = new QgsRasterLayer( sublayers[i], names[i] );
if ( rlayer && rlayer->isValid() )
Expand Down Expand Up @@ -2736,7 +2736,7 @@ void QgisApp::addDatabaseLayers( QStringList const & layerPathList, QString cons

QApplication::setOverrideCursor( Qt::WaitCursor );

foreach( QString layerPath, layerPathList )
foreach ( QString layerPath, layerPathList )
{
// create the layer
QgsDataSourceURI uri( layerPath );
Expand Down Expand Up @@ -4397,7 +4397,7 @@ void QgisApp::mergeAttributesOfSelectedFeatures()

const QgsAttributeMap &merged = d.mergedAttributesMap();

foreach( QgsFeatureId fid, vl->selectedFeaturesIds() )
foreach ( QgsFeatureId fid, vl->selectedFeaturesIds() )
{
for ( QgsAttributeMap::const_iterator it = merged.begin(); it != merged.end(); it++ )
{
Expand Down Expand Up @@ -4713,7 +4713,7 @@ void QgisApp::editPaste( QgsMapLayer *destinationLayer )
const QgsAttributeMap &srcMap = f.attributeMap();
QgsAttributeMap dstMap;

foreach( int src, srcMap.keys() )
foreach ( int src, srcMap.keys() )
{
int dst = remap.value( src, -1 );
if ( dst < 0 )
Expand Down Expand Up @@ -4849,7 +4849,7 @@ void QgisApp::saveEdits()
if ( mMapCanvas && mMapCanvas->isDrawing() )
return;

foreach( QgsMapLayer * layer, mMapLegend->selectedLayers() )
foreach ( QgsMapLayer * layer, mMapLegend->selectedLayers() )
{
saveEdits( layer );
}
Expand Down Expand Up @@ -5131,7 +5131,7 @@ void QgisApp::isInOverview()

void QgisApp::removingLayers( QStringList theLayers )
{
foreach( const QString &layerId, theLayers )
foreach ( const QString &layerId, theLayers )
{
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer*>(
QgsMapLayerRegistry::instance()->mapLayer( layerId ) );
Expand Down Expand Up @@ -5159,7 +5159,7 @@ void QgisApp::removeLayer()
return;
}

foreach( QgsMapLayer * layer, mMapLegend->selectedLayers() )
foreach ( QgsMapLayer * layer, mMapLegend->selectedLayers() )
{
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer*>( layer );
if ( vlayer && vlayer->isEditable() && !toggleEditing( vlayer, true ) )
Expand Down Expand Up @@ -7623,7 +7623,7 @@ void QgisApp::namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors
bool otherError = false;
static QSet<QSslError::SslError> ignoreErrors;

foreach( QSslError error, errors )
foreach ( QSslError error, errors )
{
QgsDebugMsg( QString( "SSL error %1: %2" ).arg( error.error() ).arg( error.errorString() ) );

Expand All @@ -7640,7 +7640,7 @@ void QgisApp::namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors
msg,
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok )
{
foreach( QSslError error, errors )
foreach ( QSslError error, errors )
{
ignoreErrors << error.error();
}
Expand Down Expand Up @@ -7789,13 +7789,13 @@ QMenu* QgisApp::createPopupMenu()
}

qSort( panels.begin(), panels.end(), cmpByText_ );
foreach( QAction* a, panels )
foreach ( QAction* a, panels )
{
menu->addAction( a );
}
menu->addSeparator();
qSort( toolbars.begin(), toolbars.end(), cmpByText_ );
foreach( QAction* a, toolbars )
foreach ( QAction* a, toolbars )
{
menu->addAction( a );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
mpWidgets << myWidget;
}

foreach( QLineEdit *le, mDialog->findChildren<QLineEdit*>() )
foreach ( QLineEdit *le, mDialog->findChildren<QLineEdit*>() )
{
if ( !le->objectName().startsWith( "expr_" ) )
continue;
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsattributetypedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl )
connect( tableWidget, SIGNAL( cellChanged( int, int ) ), this, SLOT( vCellChanged( int, int ) ) );

valueRelationLayer->clear();
foreach( QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() )
foreach ( QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() )
{
QgsVectorLayer *vl = qobject_cast< QgsVectorLayer * >( l );
if ( vl )
Expand Down Expand Up @@ -631,7 +631,7 @@ void QgsAttributeTypeDialog::updateLayerColumns( int idx )
if ( !vl )
return;

foreach( const QgsField &f, vl->pendingFields() )
foreach ( const QgsField &f, vl->pendingFields() )
{
valueRelationKeyColumn->addItem( f.name() );
valueRelationValueColumn->addItem( f.name() );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetypeloaddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void QgsAttributeTypeLoadDialog::previewButtonPushed()
void QgsAttributeTypeLoadDialog::fillLayerList()
{
layerComboBox->clear();
foreach( QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() )
foreach ( QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() )
{
QgsVectorLayer *vl = qobject_cast< QgsVectorLayer * >( l );
if ( vl )
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsbookmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void QgsBookmarks::addClicked()
void QgsBookmarks::deleteClicked()
{
QList<int> rows;
foreach( const QModelIndex &idx, lstBookmarks->selectionModel()->selectedIndexes() )
foreach ( const QModelIndex &idx, lstBookmarks->selectionModel()->selectedIndexes() )
{
if ( idx.column() == 1 )
{
Expand All @@ -185,7 +185,7 @@ void QgsBookmarks::deleteClicked()
return;

int i = 0;
foreach( int row, rows )
foreach ( int row, rows )
{
lstBookmarks->model()->removeRow( row - i );
i++;
Expand Down
22 changes: 11 additions & 11 deletions src/app/qgscustomization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ bool QgsCustomizationDialog::catchOn( )

void QgsCustomization::addTreeItemActions( QTreeWidgetItem* parentItem, const QList<QAction*>& actions )
{
foreach( QAction* action, actions )
foreach ( QAction* action, actions )
{
if ( action->menu() )
{
Expand Down Expand Up @@ -498,7 +498,7 @@ void QgsCustomization::createTreeItemMenus( )
QTreeWidgetItem *topItem = new QTreeWidgetItem( data );

QMenuBar* menubar = QgisApp::instance()->menuBar();
foreach( QObject* obj, menubar->children() )
foreach ( QObject* obj, menubar->children() )
{
if ( obj->inherits( "QMenu" ) )
{
Expand All @@ -518,7 +518,7 @@ void QgsCustomization::createTreeItemToolbars( )
QTreeWidgetItem *topItem = new QTreeWidgetItem( data );

QMainWindow* mw = QgisApp::instance();
foreach( QObject* obj, mw->children() )
foreach ( QObject* obj, mw->children() )
{
if ( obj->inherits( "QToolBar" ) )
{
Expand All @@ -544,7 +544,7 @@ void QgsCustomization::createTreeItemDocks( )
QTreeWidgetItem *topItem = new QTreeWidgetItem( data );

QMainWindow* mw = QgisApp::instance();
foreach( QObject* obj, mw->children() )
foreach ( QObject* obj, mw->children() )
{
if ( obj->inherits( "QDockWidget" ) )
{
Expand All @@ -570,7 +570,7 @@ void QgsCustomization::createTreeItemStatus( )
topItem->setCheckState( 0, Qt::Checked );

QStatusBar* sb = QgisApp::instance()->statusBar();
foreach( QObject* obj, sb->children() )
foreach ( QObject* obj, sb->children() )
{
if ( obj->inherits( "QWidget" ) && !obj->objectName().isEmpty() )
{
Expand Down Expand Up @@ -628,7 +628,7 @@ void QgsCustomization::updateMainWindow( QMenu * theToolBarMenu )

// hide menus and menu actions

foreach( QObject* obj, menubar->children() )
foreach ( QObject* obj, menubar->children() )
{
if ( obj->inherits( "QMenu" ) )
{
Expand All @@ -650,7 +650,7 @@ void QgsCustomization::updateMainWindow( QMenu * theToolBarMenu )
// remove toolbars, toolbar actions

mSettings.beginGroup( "Customization/Toolbars" );
foreach( QObject* obj, mw->children() )
foreach ( QObject* obj, mw->children() )
{
if ( obj->inherits( "QToolBar" ) )
{
Expand All @@ -666,7 +666,7 @@ void QgsCustomization::updateMainWindow( QMenu * theToolBarMenu )
{
mSettings.beginGroup( tb->objectName() );
// hide individual toolbar actions
foreach( QAction* action, tb->actions() )
foreach ( QAction* action, tb->actions() )
{
if ( action->objectName().isEmpty() )
{
Expand All @@ -686,7 +686,7 @@ void QgsCustomization::updateMainWindow( QMenu * theToolBarMenu )
// remove dock widgets

mSettings.beginGroup( "Customization/Docks" );
foreach( QObject* obj, mw->children() )
foreach ( QObject* obj, mw->children() )
{
if ( obj->inherits( "QDockWidget" ) )
{
Expand All @@ -707,7 +707,7 @@ void QgsCustomization::updateMainWindow( QMenu * theToolBarMenu )
mSettings.beginGroup( "Customization/StatusBar" );

QStatusBar* sb = mw->statusBar();
foreach( QObject* obj, sb->children() )
foreach ( QObject* obj, sb->children() )
{
if ( obj->inherits( "QWidget" ) )
{
Expand Down Expand Up @@ -737,7 +737,7 @@ void QgsCustomization::updateMenu( QMenu* menu, QSettings& settings )
{
settings.beginGroup( menu->objectName() );
// hide individual menu actions and call recursively on visible submenus
foreach( QAction* action, menu->actions() )
foreach ( QAction* action, menu->actions() )
{
QString objName = ( action->menu() ? action->menu()->objectName() : action->objectName() );
if ( objName.isEmpty() )
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgshandlebadlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void QgsHandleBadLayers::selectionChanged()

mRows.clear();

foreach( QTableWidgetItem *item, mLayerList->selectedItems() )
foreach ( QTableWidgetItem *item, mLayerList->selectedItems() )
{
if ( item->column() != 0 )
continue;
Expand Down Expand Up @@ -246,7 +246,7 @@ void QgsHandleBadLayers::browseClicked()
return;
}

foreach( int i, mRows )
foreach ( int i, mRows )
{
QTableWidgetItem *fileItem = mLayerList->item( i, 3 );

Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsidentifyresults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ void QgsIdentifyResults::expandColumnsToFit()

void QgsIdentifyResults::clearHighlights()
{
foreach( QgsHighlight *h, mHighlights )
foreach ( QgsHighlight *h, mHighlights )
{
delete h;
}
Expand All @@ -528,7 +528,7 @@ void QgsIdentifyResults::clear()
void QgsIdentifyResults::activate()
{
#if 0
foreach( QgsRubberBand *rb, mRubberBands )
foreach ( QgsRubberBand *rb, mRubberBands )
{
rb->show();
}
Expand All @@ -544,7 +544,7 @@ void QgsIdentifyResults::activate()
void QgsIdentifyResults::deactivate()
{
#if 0
foreach( QgsRubberBand *rb, mRubberBands )
foreach ( QgsRubberBand *rb, mRubberBands )
{
rb->hide();
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolcapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void QgsMapToolCapture::canvasMoveEvent( QMouseEvent * e )
while ( !mSnappingMarkers.isEmpty() )
delete mSnappingMarkers.takeFirst();

foreach( const QgsSnappingResult &r, snapResults )
foreach ( const QgsSnappingResult &r, snapResults )
{
QgsVertexMarker *m = new QgsVertexMarker( mCanvas );
m->setIconType( QgsVertexMarker::ICON_CROSS );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolfeatureaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y )
if ( featList.size() == 0 )
return false;

foreach( QgsFeature feat, featList )
foreach ( QgsFeature feat, featList )
{
int actionIdx = layer->actions()->defaultAction();

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolfreezelabels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void QgsMapToolFreezeLabels::highlightFrozenLabels()
void QgsMapToolFreezeLabels::removeFrozenHighlights()
{
QApplication::setOverrideCursor( Qt::BusyCursor );
foreach( QgsHighlight *h, mHighlights )
foreach ( QgsHighlight *h, mHighlights )
{
delete h;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolmovefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void QgsMapToolMoveFeature::canvasReleaseEvent( QMouseEvent * e )
double dx = stopPointLayerCoords.x() - startPointLayerCoords.x();
double dy = stopPointLayerCoords.y() - startPointLayerCoords.y();
vlayer->beginEditCommand( tr( "Feature moved" ) );
foreach( QgsFeatureId id, mMovedFeatures )
foreach ( QgsFeatureId id, mMovedFeatures )
{
vlayer->translateFeature( id, dx, dy );
}
Expand Down
16 changes: 8 additions & 8 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
connect( this, SIGNAL( accepted() ), this, SLOT( saveOptions() ) );

QStringList styles = QStyleFactory::keys();
foreach( QString style, styles )
foreach ( QString style, styles )
{
cmbStyle->addItem( style );
}
Expand Down Expand Up @@ -458,7 +458,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
lblSystemLocale->setText( tr( "Detected active locale on your system: %1" ).arg( mySystemLocale ) );
QString myUserLocale = settings.value( "locale/userLocale", "" ).toString();
QStringList myI18nList = i18nList();
foreach( QString l, myI18nList )
foreach ( QString l, myI18nList )
{
#if QT_VERSION >= 0x040800
cboLocale->addItem( QIcon( QString( ":/images/flags/%1.png" ).arg( l ) ), QLocale( l ).nativeLanguageName(), l );
Expand Down Expand Up @@ -1460,11 +1460,11 @@ void QgsOptions::loadGdalDriverList()
// myDrivers.sort();
// sort list case insensitive - no existing function for this!
QMap<QString, QString> strMap;
foreach( QString str, myDrivers )
strMap.insert( str.toLower(), str );
foreach ( QString str, myDrivers )
strMap.insert( str.toLower(), str );
myDrivers = strMap.values();

foreach( QString myName, myDrivers )
foreach ( QString myName, myDrivers )
{
QTreeWidgetItem * mypItem = new QTreeWidgetItem( QStringList( myName ) );
if ( mySkippedDrivers.contains( myName ) )
Expand Down Expand Up @@ -1492,13 +1492,13 @@ void QgsOptions::loadGdalDriverList()

// populate cmbEditCreateOptions with gdal write drivers - sorted, GTiff first
strMap.clear();
foreach( QString str, myGdalWriteDrivers )
strMap.insert( str.toLower(), str );
foreach ( QString str, myGdalWriteDrivers )
strMap.insert( str.toLower(), str );
myGdalWriteDrivers = strMap.values();
myGdalWriteDrivers.removeAll( "Gtiff" );
myGdalWriteDrivers.prepend( "GTiff" );
cmbEditCreateOptions->clear();
foreach( QString myName, myGdalWriteDrivers )
foreach ( QString myName, myGdalWriteDrivers )
{
cmbEditCreateOptions->addItem( myName );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgspluginregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void QgsPluginRegistry::dump()
if ( mPythonUtils && mPythonUtils->isEnabled() )
{
QgsDebugMsg( "PYTHON PLUGINS IN REGISTRY:" );
foreach( QString pluginName, mPythonUtils->listActivePlugins() )
foreach ( QString pluginName, mPythonUtils->listActivePlugins() )
{
QgsDebugMsg( pluginName );
}
Expand Down Expand Up @@ -175,7 +175,7 @@ void QgsPluginRegistry::unloadAll()

if ( mPythonUtils && mPythonUtils->isEnabled() )
{
foreach( QString pluginName, mPythonUtils->listActivePlugins() )
foreach ( QString pluginName, mPythonUtils->listActivePlugins() )
{
mPythonUtils->unloadPlugin( pluginName );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsprojectproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
if ( grpWMSList->isChecked() )
{
QStringList list;
foreach( QString value, values )
foreach ( QString value, values )
{
list << QString( "EPSG:%1" ).arg( value );
}
Expand Down Expand Up @@ -689,7 +689,7 @@ void QgsProjectProperties::on_pbnWMSAddSRS_clicked()

void QgsProjectProperties::on_pbnWMSRemoveSRS_clicked()
{
foreach( QListWidgetItem *item, mWMSList->selectedItems() )
foreach ( QListWidgetItem *item, mWMSList->selectedItems() )
{
delete item;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv

//fill available renderers into combo box
QgsRasterRendererRegistryEntry entry;
foreach( QString name, QgsRasterRendererRegistry::instance()->renderersList() )
foreach ( QString name, QgsRasterRendererRegistry::instance()->renderersList() )
{
if ( QgsRasterRendererRegistry::instance()->rendererData( name, entry ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsshortcutsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ QAction* QgsShortcutsManager::actionByName( QString name )

void QgsShortcutsManager::registerAllChildrenActions( QObject* object )
{
foreach( QObject* child, object->children() )
foreach ( QObject* child, object->children() )
{
if ( child->inherits( "QAction" ) )
{
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgssnappingdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void QgsSnappingDialog::show()

void QgsSnappingDialog::addLayers( QList<QgsMapLayer *> layers )
{
foreach( QgsMapLayer* layer, layers )
foreach ( QgsMapLayer* layer, layers )
{
addLayer( layer );
}
Expand Down Expand Up @@ -322,7 +322,7 @@ void QgsSnappingDialog::addLayer( QgsMapLayer * theMapLayer )

void QgsSnappingDialog::layersWillBeRemoved( QStringList thelayers )
{
foreach( QString theLayerId, thelayers )
foreach ( QString theLayerId, thelayers )
{
QTreeWidgetItem *item = 0;

Expand Down
5 changes: 5 additions & 0 deletions src/astyle/ASResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ void ASResource::buildHeaders(vector<const string*> &headers, int fileType, bool
headers.push_back(&AS_ADD);
headers.push_back(&AS_REMOVE);
}

if ( fileType == C_TYPE )
{
headers.push_back(&AS_FOREACH); // Qt macro
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/core/gps/qgsgpsdetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ QList< QPair<QString, QString> > QgsGPSDetector::availablePorts()

#ifdef linux
// look for linux serial devices
foreach( QString linuxDev, QStringList() << "/dev/ttyS%1" << "/dev/ttyUSB%1" << "/dev/rfcomm%1" << "/dev/ttyACM%1" )
foreach ( QString linuxDev, QStringList() << "/dev/ttyS%1" << "/dev/ttyUSB%1" << "/dev/rfcomm%1" << "/dev/ttyACM%1" )
{
for ( int i = 0; i < 10; ++i )
{
Expand All @@ -57,7 +57,7 @@ QList< QPair<QString, QString> > QgsGPSDetector::availablePorts()

#ifdef __FreeBSD__ // freebsd
// and freebsd devices (untested)
foreach( QString freebsdDev, QStringList() << "/dev/cuaa%1" << "/dev/ucom%1" )
foreach ( QString freebsdDev, QStringList() << "/dev/cuaa%1" << "/dev/ucom%1" )
{
for ( int i = 0; i < 10; ++i )
{
Expand All @@ -83,7 +83,7 @@ QList< QPair<QString, QString> > QgsGPSDetector::availablePorts()

#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
QList<QextPortInfo> ports = QextSerialEnumerator::getPorts();
foreach( QextPortInfo port, ports )
foreach ( QextPortInfo port, ports )
{
devs << QPair<QString, QString>( port.portName, port.friendName );
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsbrowsermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void QgsBrowserModel::addRootItems()
}

// add drives
foreach( QFileInfo drive, QDir::drives() )
foreach ( QFileInfo drive, QDir::drives() )
{
QString path = drive.absolutePath();
QgsDirectoryItem *item = new QgsDirectoryItem( NULL, path, path );
Expand All @@ -69,7 +69,7 @@ void QgsBrowserModel::addRootItems()
// Add non file top level items
QStringList providersList = QgsProviderRegistry::instance()->providerList();
providersList.sort();
foreach( QString key, providersList )
foreach ( QString key, providersList )
{
QLibrary *library = QgsProviderRegistry::instance()->providerLibrary( key );
if ( !library )
Expand Down Expand Up @@ -108,7 +108,7 @@ void QgsBrowserModel::addRootItems()

void QgsBrowserModel::removeRootItems()
{
foreach( QgsDataItem* item, mRootItems )
foreach ( QgsDataItem* item, mRootItems )
{
delete item;
}
Expand Down Expand Up @@ -357,7 +357,7 @@ QStringList QgsBrowserModel::mimeTypes() const
QMimeData * QgsBrowserModel::mimeData( const QModelIndexList &indexes ) const
{
QgsMimeDataUtils::UriList lst;
foreach( const QModelIndex &index, indexes )
foreach ( const QModelIndex &index, indexes )
{
if ( index.isValid() )
{
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgscoordinatereferencesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString theProj4String
// split on spaces followed by a plus sign (+) to deal
// also with parameters containing spaces (e.g. +nadgrids)
// make sure result is trimmed (#5598)
foreach( QString param, myProj4String.split( QRegExp( "\\s+(?=\\+)" ), QString::SkipEmptyParts ) )
foreach ( QString param, myProj4String.split( QRegExp( "\\s+(?=\\+)" ), QString::SkipEmptyParts ) )
{
QString arg = QString( "' '||parameters||' ' LIKE %1" ).arg( quotedValue( QString( "% %1 %" ).arg( param.trimmed() ) ) );
if ( param.startsWith( "+datum=" ) )
Expand Down Expand Up @@ -1563,7 +1563,7 @@ bool QgsCoordinateReferenceSystem::loadIDs( QHash<int, QString> &wkts )
{
OGRSpatialReferenceH crs = OSRNewSpatialReference( NULL );

foreach( QString csv, QStringList() << "gcs.csv" << "pcs.csv" << "vertcs.csv" << "compdcs.csv" << "geoccs.csv" )
foreach ( QString csv, QStringList() << "gcs.csv" << "pcs.csv" << "vertcs.csv" << "compdcs.csv" << "geoccs.csv" )
{
QString filename = CPLFindFile( "gdal", csv.toUtf8() );

Expand Down Expand Up @@ -1762,7 +1762,7 @@ int QgsCoordinateReferenceSystem::syncDb()

sql = "DELETE FROM tbl_srs WHERE auth_name='EPSG' AND NOT auth_id IN (";
QString delim;
foreach( int i, wkts.keys() )
foreach ( int i, wkts.keys() )
{
sql += delim + QString::number( i );
delim = ",";
Expand Down
24 changes: 12 additions & 12 deletions src/core/qgsdataitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void QgsDataItem::populate()
QApplication::setOverrideCursor( Qt::WaitCursor );

QVector<QgsDataItem*> children = createChildren( );
foreach( QgsDataItem *child, children )
foreach ( QgsDataItem *child, children )
{
// initialization, do not refresh! That would result in infinite loop (beginInsertItems->rowCount->populate)
addChildItem( child );
Expand Down Expand Up @@ -306,19 +306,19 @@ void QgsDataItem::refresh()

// Remove no more present items
QVector<QgsDataItem*> remove;
foreach( QgsDataItem *child, mChildren )
foreach ( QgsDataItem *child, mChildren )
{
if ( findItem( items, child ) >= 0 )
continue;
remove.append( child );
}
foreach( QgsDataItem *child, remove )
foreach ( QgsDataItem *child, remove )
{
deleteChildItem( child );
}

// Add new items
foreach( QgsDataItem *item, items )
foreach ( QgsDataItem *item, items )
{
// Is it present in childs?
if ( findItem( mChildren, item ) >= 0 )
Expand Down Expand Up @@ -392,7 +392,7 @@ QgsDataCollectionItem::QgsDataCollectionItem( QgsDataItem* parent, QString name,
QgsDataCollectionItem::~QgsDataCollectionItem()
{
QgsDebugMsg( "Entered" );
foreach( QgsDataItem* i, mChildren )
foreach ( QgsDataItem* i, mChildren )
{
QgsDebugMsg( QString( "delete child = 0x%0" ).arg(( qlonglong )i, 8, 16, QLatin1Char( '0' ) ) );
delete i;
Expand Down Expand Up @@ -456,7 +456,7 @@ QVector<QgsDataItem*> QgsDirectoryItem::createChildren( )
QSettings settings;

QStringList entries = dir.entryList( QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name | QDir::IgnoreCase );
foreach( QString subdir, entries )
foreach ( QString subdir, entries )
{
QString subdirPath = dir.absoluteFilePath( subdir );
QgsDebugMsg( QString( "creating subdir: %1" ).arg( subdirPath ) );
Expand All @@ -468,7 +468,7 @@ QVector<QgsDataItem*> QgsDirectoryItem::createChildren( )
}

QStringList fileEntries = dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot | QDir::Files, QDir::Name );
foreach( QString name, fileEntries )
foreach ( QString name, fileEntries )
{
QString path = dir.absoluteFilePath( name );
QFileInfo fileInfo( path );
Expand All @@ -486,7 +486,7 @@ QVector<QgsDataItem*> QgsDirectoryItem::createChildren( )
}
}

foreach( QLibrary *library, mLibraries )
foreach ( QLibrary *library, mLibraries )
{
// we could/should create separate list of providers for each purpose

Expand Down Expand Up @@ -558,7 +558,7 @@ QgsDirectoryParamWidget::QgsDirectoryParamWidget( QString path, QWidget* parent

QDir dir( path );
QStringList entries = dir.entryList( QDir::AllEntries | QDir::NoDotAndDotDot, QDir::Name | QDir::IgnoreCase );
foreach( QString name, entries )
foreach ( QString name, entries )
{
QFileInfo fi( dir.absoluteFilePath( name ) );
QStringList texts;
Expand Down Expand Up @@ -624,7 +624,7 @@ QgsDirectoryParamWidget::QgsDirectoryParamWidget( QString path, QWidget* parent
// hide columns that are not requested
QSettings settings;
QList<QVariant> lst = settings.value( "/dataitem/directoryHiddenColumns" ).toList();
foreach( QVariant colVariant, lst )
foreach ( QVariant colVariant, lst )
{
setColumnHidden( colVariant.toInt(), true );
}
Expand Down Expand Up @@ -703,7 +703,7 @@ QVector<QgsDataItem*> QgsFavouritesItem::createChildren( )
QSettings settings;
QStringList favDirs = settings.value( "/browser/favourites", QVariant() ).toStringList();

foreach( QString favDir, favDirs )
foreach ( QString favDir, favDirs )
{
item = new QgsDirectoryItem( this, favDir, favDir );
if ( item )
Expand Down Expand Up @@ -882,7 +882,7 @@ QVector<QgsDataItem*> QgsZipItem::createChildren( )
getZipFileList();

// loop over files inside zip
foreach( QString fileName, mZipFileList )
foreach ( QString fileName, mZipFileList )
{
QFileInfo info( fileName );
tmpPath = mVsiPrefix + path() + "/" + fileName;
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsdatasourceuri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,9 @@ QString QgsDataSourceURI::uri() const
QByteArray QgsDataSourceURI::encodedUri() const
{
QUrl url;
foreach( QString key, mParams.uniqueKeys() )
foreach ( QString key, mParams.uniqueKeys() )
{
foreach( QString value, mParams.values( key ) )
foreach ( QString value, mParams.values( key ) )
{
url.addQueryItem( key, value );
}
Expand All @@ -607,7 +607,7 @@ void QgsDataSourceURI::setEncodedUri( const QByteArray & uri )
QUrl url;
url.setEncodedQuery( uri );
QPair<QString, QString> item;
foreach( item, url.queryItems() )
foreach ( item, url.queryItems() )
{
mParams.insertMulti( item.first, item.second );
}
Expand Down Expand Up @@ -703,7 +703,7 @@ void QgsDataSourceURI::setParam( const QString &key, const QString &value )

void QgsDataSourceURI::setParam( const QString &key, const QStringList &value )
{
foreach( QString val, value )
foreach ( QString val, value )
{
mParams.insertMulti( key, val );
}
Expand Down
32 changes: 16 additions & 16 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ QgsExpression::Interval QgsExpression::Interval::fromString( QString string )
pos += rx.matchedLength();
}

foreach( QString match, list )
foreach ( QString match, list )
{
QStringList split = match.split( QRegExp( "\\s+" ) );
bool ok;
Expand Down Expand Up @@ -432,7 +432,7 @@ static QVariant fcnToDateTime( const QVariantList& values, QgsFeature* , QgsExpr

static QVariant fcnCoalesce( const QVariantList& values, QgsFeature* , QgsExpression* )
{
foreach( const QVariant &value, values )
foreach ( const QVariant &value, values )
{
if ( value.isNull() )
continue;
Expand Down Expand Up @@ -509,7 +509,7 @@ static QVariant fcnFeatureId( const QVariantList& , QgsFeature* f, QgsExpression
static QVariant fcnConcat( const QVariantList& values, QgsFeature* , QgsExpression *parent )
{
QString concat;
foreach( const QVariant &value, values )
foreach ( const QVariant &value, values )
{
concat += getStringValue( value, parent );
}
Expand Down Expand Up @@ -1135,7 +1135,7 @@ QgsExpression::Node* QgsExpression::Node::createFromOgcFilter( QDomElement &elem
QString QgsExpression::NodeList::dump() const
{
QString msg; bool first = true;
foreach( Node* n, mList )
foreach ( Node* n, mList )
{
if ( !first ) msg += ", "; else first = false;
msg += n->dump();
Expand All @@ -1145,7 +1145,7 @@ QString QgsExpression::NodeList::dump() const

void QgsExpression::NodeList::toOgcFilter( QDomDocument &doc, QDomElement &element ) const
{
foreach( Node* n, mList )
foreach ( Node* n, mList )
{
n->toOgcFilter( doc, element );
}
Expand Down Expand Up @@ -1657,7 +1657,7 @@ QVariant QgsExpression::NodeInOperator::eval( QgsExpression* parent, QgsFeature*

bool listHasNull = false;

foreach( Node* n, mList->list() )
foreach ( Node* n, mList->list() )
{
QVariant v2 = n->eval( parent, f );
ENSURE_NO_EVAL_ERROR;
Expand Down Expand Up @@ -1695,7 +1695,7 @@ QVariant QgsExpression::NodeInOperator::eval( QgsExpression* parent, QgsFeature*
bool QgsExpression::NodeInOperator::prepare( QgsExpression* parent, const QgsFieldMap& fields )
{
bool res = mNode->prepare( parent, fields );
foreach( Node* n, mList->list() )
foreach ( Node* n, mList->list() )
{
res = res && n->prepare( parent, fields );
}
Expand All @@ -1722,7 +1722,7 @@ void QgsExpression::NodeInOperator::toOgcFilter( QDomDocument &doc, QDomElement
parent = &orElem;
}

foreach( Node* n, mList->list() )
foreach ( Node* n, mList->list() )
{
QDomElement eqElem = doc.createElement( "ogc:PropertyIsEqualTo" );
mNode->toOgcFilter( doc, eqElem );
Expand All @@ -1742,7 +1742,7 @@ QVariant QgsExpression::NodeFunction::eval( QgsExpression* parent, QgsFeature* f
QVariantList argValues;
if ( mArgs )
{
foreach( Node* n, mArgs->list() )
foreach ( Node* n, mArgs->list() )
{
QVariant v = n->eval( parent, f );
ENSURE_NO_EVAL_ERROR;
Expand All @@ -1765,7 +1765,7 @@ bool QgsExpression::NodeFunction::prepare( QgsExpression* parent, const QgsField
bool res = true;
if ( mArgs )
{
foreach( Node* n, mArgs->list() )
foreach ( Node* n, mArgs->list() )
{
res = res && n->prepare( parent, fields );
}
Expand Down Expand Up @@ -1956,7 +1956,7 @@ QVariant QgsExpression::NodeColumnRef::eval( QgsExpression* /*parent*/, QgsFeatu

bool QgsExpression::NodeColumnRef::prepare( QgsExpression* parent, const QgsFieldMap& fields )
{
foreach( int i, fields.keys() )
foreach ( int i, fields.keys() )
{
if ( QString::compare( fields[i].name(), mName, Qt::CaseInsensitive ) == 0 )
{
Expand Down Expand Up @@ -1999,7 +1999,7 @@ QgsExpression::Node* QgsExpression::NodeColumnRef::createFromOgcFilter( QDomElem

QVariant QgsExpression::NodeCondition::eval( QgsExpression* parent, QgsFeature* f )
{
foreach( WhenThen* cond, mConditions )
foreach ( WhenThen* cond, mConditions )
{
QVariant vWhen = cond->mWhenExp->eval( parent, f );
TVL tvl = getTVLValue( vWhen, parent );
Expand All @@ -2026,7 +2026,7 @@ QVariant QgsExpression::NodeCondition::eval( QgsExpression* parent, QgsFeature*
bool QgsExpression::NodeCondition::prepare( QgsExpression* parent, const QgsFieldMap& fields )
{
bool res;
foreach( WhenThen* cond, mConditions )
foreach ( WhenThen* cond, mConditions )
{
res = cond->mWhenExp->prepare( parent, fields )
& cond->mThenExp->prepare( parent, fields );
Expand All @@ -2042,7 +2042,7 @@ bool QgsExpression::NodeCondition::prepare( QgsExpression* parent, const QgsFiel
QString QgsExpression::NodeCondition::dump() const
{
QString msg = "CONDITION:\n";
foreach( WhenThen* cond, mConditions )
foreach ( WhenThen* cond, mConditions )
{
msg += QString( "- WHEN %1 THEN %2\n" ).arg( cond->mWhenExp->dump() ).arg( cond->mThenExp->dump() );
}
Expand All @@ -2060,7 +2060,7 @@ void QgsExpression::NodeCondition::toOgcFilter( QDomDocument &doc, QDomElement &
QStringList QgsExpression::NodeCondition::referencedColumns() const
{
QStringList lst;
foreach( WhenThen* cond, mConditions )
foreach ( WhenThen* cond, mConditions )
{
lst += cond->mWhenExp->referencedColumns() + cond->mThenExp->referencedColumns();
}
Expand All @@ -2073,7 +2073,7 @@ QStringList QgsExpression::NodeCondition::referencedColumns() const

bool QgsExpression::NodeCondition::needsGeometry() const
{
foreach( WhenThen* cond, mConditions )
foreach ( WhenThen* cond, mConditions )
{
if ( cond->mWhenExp->needsGeometry() ||
cond->mThenExp->needsGeometry() )
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsexpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class CORE_EXPORT QgsExpression
{
public:
NodeList() {}
virtual ~NodeList() { foreach( Node* n, mList ) delete n; }
virtual ~NodeList() { foreach ( Node* n, mList ) delete n; }
void append( Node* node ) { mList.append( node ); }
int count() { return mList.count(); }
QList<Node*> list() { return mList; }
Expand Down Expand Up @@ -360,8 +360,8 @@ class CORE_EXPORT QgsExpression

virtual void toOgcFilter( QDomDocument &doc, QDomElement &element ) const;

virtual QStringList referencedColumns() const { QStringList lst( mNode->referencedColumns() ); foreach( Node* n, mList->list() ) lst.append( n->referencedColumns() ); return lst; }
virtual bool needsGeometry() const { bool needs = false; foreach( Node* n, mList->list() ) needs |= n->needsGeometry(); return needs; }
virtual QStringList referencedColumns() const { QStringList lst( mNode->referencedColumns() ); foreach ( Node* n, mList->list() ) lst.append( n->referencedColumns() ); return lst; }
virtual bool needsGeometry() const { bool needs = false; foreach ( Node* n, mList->list() ) needs |= n->needsGeometry(); return needs; }
virtual void accept( Visitor& v ) { v.visit( this ); }

protected:
Expand All @@ -387,8 +387,8 @@ class CORE_EXPORT QgsExpression
virtual void toOgcFilter( QDomDocument &doc, QDomElement &element ) const;
static QgsExpression::Node* createFromOgcFilter( QDomElement &element, QString &errorMessage );

virtual QStringList referencedColumns() const { QStringList lst; if ( !mArgs ) return lst; foreach( Node* n, mArgs->list() ) lst.append( n->referencedColumns() ); return lst; }
virtual bool needsGeometry() const { bool needs = BuiltinFunctions()[mFnIndex].mUsesGeometry; if ( mArgs ) { foreach( Node* n, mArgs->list() ) needs |= n->needsGeometry(); } return needs; }
virtual QStringList referencedColumns() const { QStringList lst; if ( !mArgs ) return lst; foreach ( Node* n, mArgs->list() ) lst.append( n->referencedColumns() ); return lst; }
virtual bool needsGeometry() const { bool needs = BuiltinFunctions()[mFnIndex].mUsesGeometry; if ( mArgs ) { foreach ( Node* n, mArgs->list() ) needs |= n->needsGeometry(); } return needs; }
virtual void accept( Visitor& v ) { v.visit( this ); }

protected:
Expand Down Expand Up @@ -458,7 +458,7 @@ class CORE_EXPORT QgsExpression
{
public:
NodeCondition( WhenThenList* conditions, Node* elseExp = NULL ) : mConditions( *conditions ), mElseExp( elseExp ) { delete conditions; }
~NodeCondition() { delete mElseExp; foreach( WhenThen* cond, mConditions ) delete cond; }
~NodeCondition() { delete mElseExp; foreach ( WhenThen* cond, mConditions ) delete cond; }

virtual QVariant eval( QgsExpression* parent, QgsFeature* f );
virtual bool prepare( QgsExpression* parent, const QgsFieldMap& fields );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayerregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void QgsMapLayerRegistry::removeMapLayers( QStringList theLayerIds,
if ( theEmitSignal )
emit layersWillBeRemoved( theLayerIds );

foreach( const QString &myId, theLayerIds )
foreach ( const QString &myId, theLayerIds )
{
if ( theEmitSignal )
emit layerWillBeRemoved( myId );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmimedatautils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ QMimeData* QgsMimeDataUtils::encodeUriList( QgsMimeDataUtils::UriList layers )
QByteArray encodedData;

QDataStream stream( &encodedData, QIODevice::WriteOnly );
foreach( const QgsMimeDataUtils::Uri& u, layers )
foreach ( const QgsMimeDataUtils::Uri& u, layers )
{
stream << u.data();
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsnetworkaccessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class QgsNetworkProxyFactory : public QNetworkProxyFactory
QgsNetworkAccessManager *nam = QgsNetworkAccessManager::instance();

// iterate proxies factories and take first non empty list
foreach( QNetworkProxyFactory *f, nam->proxyFactories() )
foreach ( QNetworkProxyFactory *f, nam->proxyFactories() )
{
QList<QNetworkProxy> proxies = f->queryProxy( query );
if ( proxies.size() > 0 )
Expand All @@ -49,7 +49,7 @@ class QgsNetworkProxyFactory : public QNetworkProxyFactory

QString url = query.url().toString();

foreach( QString exclude, nam->excludeList() )
foreach ( QString exclude, nam->excludeList() )
{
if ( url.startsWith( exclude ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgspallabeling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ int QgsPalLabeling::prepareLayer( QgsVectorLayer* layer, QSet<int>& attrIndices,
if ( lyrTmp.fieldName.isEmpty() )
return 0;
QgsExpression exp( lyrTmp.fieldName );
foreach( QString name, exp.referencedColumns() )
foreach ( QString name, exp.referencedColumns() )
{
QgsDebugMsg( "REFERENCED COLUMN = " + name );
fldIndex = layer->fieldNameIndex( name );
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgspluginlayerregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ QgsPluginLayerRegistry::~QgsPluginLayerRegistry()
if ( !mPluginLayerTypes.isEmpty() )
{
QgsDebugMsg( "QgsPluginLayerRegistry::~QgsPluginLayerRegistry(): creator list not empty" );
foreach( QString typeName, mPluginLayerTypes.keys() )
removePluginLayerType( typeName );
foreach ( QString typeName, mPluginLayerTypes.keys() )
removePluginLayerType( typeName );
}
}

Expand All @@ -93,7 +93,7 @@ bool QgsPluginLayerRegistry::removePluginLayerType( QString typeName )

// remove all remaining layers of this type - to avoid invalid behaviour
QList<QgsMapLayer*> layers = QgsMapLayerRegistry::instance()->mapLayers().values();
foreach( QgsMapLayer* layer, layers )
foreach ( QgsMapLayer* layer, layers )
{
if ( layer->type() == QgsMapLayer::PluginLayer )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsproviderregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ void QgsProviderRegistry::registerGuis( QWidget *parent )
{
typedef void registerGui_function( QWidget * parent );

foreach( const QString &provider, providerList() )
foreach ( const QString &provider, providerList() )
{
registerGui_function *registerGui = ( registerGui_function * ) cast_to_fptr( function( provider, "registerGui" ) );

Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsrasterdataprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ bool QgsRasterDataProvider::hasStatistics( int theBandNo,
QgsRasterBandStats myRasterBandStats;
initStatistics( myRasterBandStats, theBandNo, theStats, theExtent, theSampleSize );

foreach( QgsRasterBandStats stats, mStatistics )
foreach ( QgsRasterBandStats stats, mStatistics )
{
if ( stats.contains( myRasterBandStats ) )
{
Expand All @@ -516,7 +516,7 @@ QgsRasterBandStats QgsRasterDataProvider::bandStatistics( int theBandNo,
QgsRasterBandStats myRasterBandStats;
initStatistics( myRasterBandStats, theBandNo, theStats, theExtent, theSampleSize );

foreach( QgsRasterBandStats stats, mStatistics )
foreach ( QgsRasterBandStats stats, mStatistics )
{
if ( stats.contains( myRasterBandStats ) )
{
Expand Down Expand Up @@ -760,7 +760,7 @@ bool QgsRasterDataProvider::hasHistogram( int theBandNo,
QgsRasterHistogram myHistogram;
initHistogram( myHistogram, theBandNo, theBinCount, theMinimum, theMaximum, theExtent, theSampleSize, theIncludeOutOfRange );

foreach( QgsRasterHistogram histogram, mHistograms )
foreach ( QgsRasterHistogram histogram, mHistograms )
{
if ( histogram == myHistogram )
{
Expand All @@ -784,7 +784,7 @@ QgsRasterHistogram QgsRasterDataProvider::histogram( int theBandNo,
initHistogram( myHistogram, theBandNo, theBinCount, theMinimum, theMaximum, theExtent, theSampleSize, theIncludeOutOfRange );

// Find cached
foreach( QgsRasterHistogram histogram, mHistograms )
foreach ( QgsRasterHistogram histogram, mHistograms )
{
if ( histogram == myHistogram )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectordataprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ const QStringList &QgsVectorDataProvider::availableEncodings()
{
if ( smEncodings.isEmpty() )
{
foreach( QString codec, QTextCodec::availableCodecs() )
foreach ( QString codec, QTextCodec::availableCodecs() )
{
smEncodings << codec;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorfilewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ QgsVectorFileWriter::QgsVectorFileWriter(
{
QStringList allExts = exts.split( " ", QString::SkipEmptyParts );
bool found = false;
foreach( QString ext, allExts )
foreach ( QString ext, allExts )
{
if ( vectorFileName.endsWith( "." + ext, Qt::CaseInsensitive ) )
{
Expand Down Expand Up @@ -744,7 +744,7 @@ bool QgsVectorFileWriter::deleteShapeFile( QString theFileName )
}

bool ok = true;
foreach( QString file, dir.entryList( filter ) )
foreach ( QString file, dir.entryList( filter ) )
{
if ( !QFile::remove( dir.canonicalPath() + "/" + file ) )
{
Expand Down
14 changes: 7 additions & 7 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void QgsVectorLayer::drawLabels( QgsRenderContext& rendererContext )
}
else if ( mRendererV2 )
{
foreach( QString attrName, mRendererV2->usedAttributes() )
foreach ( QString attrName, mRendererV2->usedAttributes() )
{
int attrNum = fieldNameIndex( attrName );
attributes.append( attrNum );
Expand Down Expand Up @@ -973,7 +973,7 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
}

QgsAttributeList attributes;
foreach( QString attrName, mRendererV2->usedAttributes() )
foreach ( QString attrName, mRendererV2->usedAttributes() )
{
int attrNum = fieldNameIndex( attrName );
attributes.append( attrNum );
Expand Down Expand Up @@ -1399,7 +1399,7 @@ QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
QgsFeature fet;
if ( mDataProvider->capabilities() & QgsVectorDataProvider::SelectAtId )
{
foreach( QgsFeatureId fid, mSelectedFeatureIds )
foreach ( QgsFeatureId fid, mSelectedFeatureIds )
{
if ( featureAtId( fid, fet, true, false ) && fet.geometry() )
{
Expand Down Expand Up @@ -1991,7 +1991,7 @@ bool QgsVectorLayer::updateFeature( QgsFeature &f )
const QgsAttributeMap &fa = f.attributeMap();
const QgsAttributeMap &ca = current.attributeMap();

foreach( int attr, fa.keys() )
foreach ( int attr, fa.keys() )
{
if ( fa.contains( attr ) && ca.contains( attr ) && fa[attr] != ca[attr] )
{
Expand Down Expand Up @@ -2415,7 +2415,7 @@ int QgsVectorLayer::splitFeatures( const QList<QgsPoint>& splitLine, bool topolo
//use default value where possible (primary key issue), otherwise the value from the original (splitted) feature
QgsAttributeMap newAttributes = select_it->attributeMap();
QVariant defaultValue;
foreach( int j, newAttributes.keys() )
foreach ( int j, newAttributes.keys() )
{
defaultValue = mDataProvider->defaultValue( j );
if ( !defaultValue.isNull() )
Expand Down Expand Up @@ -3872,7 +3872,7 @@ bool QgsVectorLayer::commitChanges()
if ( cap & QgsVectorDataProvider::AddFeatures )
{
QList<QgsFeatureId> ids;
foreach( const QgsFeature &f, mAddedFeatures )
foreach ( const QgsFeature &f, mAddedFeatures )
{
ids << f.id();
}
Expand Down Expand Up @@ -4047,7 +4047,7 @@ QgsFeatureList QgsVectorLayer::selectedFeatures()
{
QgsFeatureList features;

foreach( QgsFeatureId fid, mSelectedFeatureIds )
foreach ( QgsFeatureId fid, mSelectedFeatureIds )
{
features.push_back( QgsFeature() );
featureAtId( fid, features.back(), geometryType() != QGis::NoGeometry, true );
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@ void QgsRasterLayer::setContrastEnhancementAlgorithm( QgsContrastEnhancement::Co
myBands << myMultiBandRenderer->redBand() << myMultiBandRenderer->greenBand() << myMultiBandRenderer->blueBand();
}

foreach( int myBand, myBands )
foreach ( int myBand, myBands )
{
if ( myBand != -1 )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterpipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ QgsRasterPipe::QgsRasterPipe()

QgsRasterPipe::~QgsRasterPipe()
{
foreach( QgsRasterInterface* interface, mInterfaces )
foreach ( QgsRasterInterface* interface, mInterfaces )
{
delete interface;
}
Expand Down
812 changes: 408 additions & 404 deletions src/core/symbology-ng/qgscolorrampv2data.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ void QgsGraduatedSymbolRendererV2::setSourceColorRamp( QgsVectorColorRampV2* ram
void QgsGraduatedSymbolRendererV2::updateColorRamp( QgsVectorColorRampV2 *ramp )
{
int i = 0;
foreach( QgsRendererRangeV2 range, mRanges )
foreach ( QgsRendererRangeV2 range, mRanges )
{
QgsSymbolV2* symbol = range.symbol()->clone();
double colorValue = ( mRanges.count() > 1 ? ( double ) i / ( mRanges.count() - 1 ) : 0 );
Expand All @@ -1088,7 +1088,7 @@ void QgsGraduatedSymbolRendererV2::updateColorRamp( QgsVectorColorRampV2 *ramp )
void QgsGraduatedSymbolRendererV2::updateSymbols( QgsSymbolV2 *sym )
{
int i = 0;
foreach( QgsRendererRangeV2 range, mRanges )
foreach ( QgsRendererRangeV2 range, mRanges )
{
QgsSymbolV2* symbol = sym->clone();
symbol->setColor( range.symbol()->color() );
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,12 @@ QStringList QgsSvgMarkerSymbolLayerV2::listSvgFiles()
for ( int i = 0; i < svgPaths.size(); i++ )
{
QDir dir( svgPaths[i] );
foreach( QString item, dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
foreach ( QString item, dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
{
svgPaths.insert( i + 1, dir.path() + "/" + item );
}

foreach( QString item, dir.entryList( QStringList( "*.svg" ), QDir::Files ) )
foreach ( QString item, dir.entryList( QStringList( "*.svg" ), QDir::Files ) )
{
// TODO test if it is correct SVG
list.append( dir.path() + "/" + item );
Expand Down
14 changes: 7 additions & 7 deletions src/core/symbology-ng/qgsrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,21 +517,21 @@ void QgsFeatureRendererV2::renderVertexMarker( QPointF& pt, QgsRenderContext& co

void QgsFeatureRendererV2::renderVertexMarkerPolyline( QPolygonF& pts, QgsRenderContext& context )
{
foreach( QPointF pt, pts )
renderVertexMarker( pt, context );
foreach ( QPointF pt, pts )
renderVertexMarker( pt, context );
}

void QgsFeatureRendererV2::renderVertexMarkerPolygon( QPolygonF& pts, QList<QPolygonF>* rings, QgsRenderContext& context )
{
foreach( QPointF pt, pts )
renderVertexMarker( pt, context );
foreach ( QPointF pt, pts )
renderVertexMarker( pt, context );

if ( rings )
{
foreach( QPolygonF ring, *rings )
foreach ( QPolygonF ring, *rings )
{
foreach( QPointF pt, ring )
renderVertexMarker( pt, context );
foreach ( QPointF pt, ring )
renderVertexMarker( pt, context );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsrendererv2registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ QgsRendererV2Registry::QgsRendererV2Registry()

QgsRendererV2Registry::~QgsRendererV2Registry()
{
foreach( QString name, mRenderers.keys() )
foreach ( QString name, mRenderers.keys() )
{
delete mRenderers[name];
}
Expand Down
20 changes: 10 additions & 10 deletions src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ QString QgsRuleBasedRendererV2::Rule::dump( int offset ) const
.arg( mFilterExp ).arg( symbolDump );

QStringList lst;
foreach( Rule* rule, mChildren )
foreach ( Rule* rule, mChildren )
{
lst.append( rule->dump( offset + 2 ) );
}
Expand Down Expand Up @@ -154,8 +154,8 @@ QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::clone() const
QgsSymbolV2* sym = mSymbol ? mSymbol->clone() : NULL;
Rule* newrule = new Rule( sym, mScaleMinDenom, mScaleMaxDenom, mFilterExp, mLabel, mDescription );
// clone children
foreach( Rule* rule, mChildren )
newrule->appendChild( rule->clone() );
foreach ( Rule* rule, mChildren )
newrule->appendChild( rule->clone() );
return newrule;
}

Expand Down Expand Up @@ -353,7 +353,7 @@ bool QgsRuleBasedRendererV2::Rule::renderFeature( QgsRuleBasedRendererV2::Featur
if ( mSymbol )
{
// add job to the queue: each symbol's zLevel must be added
foreach( int normZLevel, mSymbolNormZLevels )
foreach ( int normZLevel, mSymbolNormZLevels )
{
//QgsDebugMsg(QString("add job at level %1").arg(normZLevel));
renderQueue[normZLevel].jobs.append( new RenderJob( featToRender, mSymbol ) );
Expand Down Expand Up @@ -628,7 +628,7 @@ void QgsRuleBasedRendererV2::startRender( QgsRenderContext& context, const QgsVe
// and prepare rendering queue
QMap<int, int> zLevelsToNormLevels;
int maxNormLevel = -1;
foreach( int zLevel, symbolZLevels )
foreach ( int zLevel, symbolZLevels )
{
zLevelsToNormLevels[zLevel] = ++maxNormLevel;
mRenderQueue.append( RenderLevel( zLevel ) );
Expand All @@ -645,11 +645,11 @@ void QgsRuleBasedRendererV2::stopRender( QgsRenderContext& context )
//

// go through all levels
foreach( const RenderLevel& level, mRenderQueue )
foreach ( const RenderLevel& level, mRenderQueue )
{
//QgsDebugMsg(QString("level %1").arg(level.zIndex));
// go through all jobs at the level
foreach( const RenderJob* job, level.jobs )
foreach ( const RenderJob* job, level.jobs )
{
//QgsDebugMsg(QString("job fid %1").arg(job->f->id()));
// render feature - but only with symbol layers with specified zIndex
Expand Down Expand Up @@ -801,7 +801,7 @@ QgsFeatureRendererV2* QgsRuleBasedRendererV2::createFromSld( QDomElement& elemen

void QgsRuleBasedRendererV2::refineRuleCategories( QgsRuleBasedRendererV2::Rule* initialRule, QgsCategorizedSymbolRendererV2* r )
{
foreach( const QgsRendererCategoryV2& cat, r->categories() )
foreach ( const QgsRendererCategoryV2& cat, r->categories() )
{
QString attr = QgsExpression::quotedColumnRef( r->classAttribute() );
QString value;
Expand All @@ -822,7 +822,7 @@ void QgsRuleBasedRendererV2::refineRuleCategories( QgsRuleBasedRendererV2::Rule*

void QgsRuleBasedRendererV2::refineRuleRanges( QgsRuleBasedRendererV2::Rule* initialRule, QgsGraduatedSymbolRendererV2* r )
{
foreach( const QgsRendererRangeV2& rng, r->ranges() )
foreach ( const QgsRendererRangeV2& rng, r->ranges() )
{
// due to the loss of precision in double->string conversion we may miss out values at the limit of the range
// TODO: have a possibility to construct expressions directly as a parse tree to avoid loss of precision
Expand All @@ -841,7 +841,7 @@ void QgsRuleBasedRendererV2::refineRuleScales( QgsRuleBasedRendererV2::Rule* ini
int oldScale = initialRule->scaleMinDenom();
int maxDenom = initialRule->scaleMaxDenom();
QgsSymbolV2* symbol = initialRule->symbol();
foreach( int scale, scales )
foreach ( int scale, scales )
{
if ( initialRule->scaleMinDenom() >= scale )
continue; // jump over the first scales out of the interval
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsrulebasedrendererv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CORE_EXPORT QgsRuleBasedRendererV2 : public QgsFeatureRendererV2
struct RenderLevel
{
RenderLevel( int z ): zIndex( z ) {}
~RenderLevel() { foreach( RenderJob* j, jobs ) delete j; }
~RenderLevel() { foreach ( RenderJob* j, jobs ) delete j; }
int zIndex;
QList<RenderJob*> jobs;
};
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgssymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ void QgsLineSymbolLayerV2::renderPolygonOutline( const QPolygonF& points, QList<
renderPolyline( points, context );
if ( rings )
{
foreach( const QPolygonF& ring, *rings )
renderPolyline( ring, context );
foreach ( const QPolygonF& ring, *rings )
renderPolyline( ring, context );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgssymbollayerv2registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ QgsSymbolLayerV2Registry::QgsSymbolLayerV2Registry()

QgsSymbolLayerV2Registry::~QgsSymbolLayerV2Registry()
{
foreach( QString name, mMetadata.keys() )
foreach ( QString name, mMetadata.keys() )
{
delete mMetadata[name];
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgssymbollayerv2utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@ QDomElement QgsSymbolLayerV2Utils::saveSymbols( QgsSymbolV2Map& symbols, QString

void QgsSymbolLayerV2Utils::clearSymbolMap( QgsSymbolV2Map& symbols )
{
foreach( QString name, symbols.keys() )
foreach ( QString name, symbols.keys() )
{
delete symbols.value( name );
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/symbology-ng/qgssymbologyv2conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void QgsSymbologyV2Conversion::rendererV1toV2( QgsVectorLayer* layer )
}

QgsRangeList ranges;
foreach( const QgsSymbol* sym, gsr->symbols() )
foreach ( const QgsSymbol* sym, gsr->symbols() )
{
double lowerValue = sym->lowerValue().toDouble();
double upperValue = sym->upperValue().toDouble();
Expand Down Expand Up @@ -233,7 +233,7 @@ void QgsSymbologyV2Conversion::rendererV1toV2( QgsVectorLayer* layer )
}

QgsCategoryList cats;
foreach( QgsSymbol* sym, uvr->symbols() )
foreach ( QgsSymbol* sym, uvr->symbols() )
{
QVariant value = QVariant( sym->lowerValue() );
QString label = sym->label();
Expand Down Expand Up @@ -295,7 +295,7 @@ void QgsSymbologyV2Conversion::rendererV2toV1( QgsVectorLayer* layer )

r->setClassificationField( layer->fieldNameIndex( gsr2->classAttribute() ) );

foreach( QgsRendererRangeV2 range, gsr2->ranges() )
foreach ( QgsRendererRangeV2 range, gsr2->ranges() )
{
QgsSymbol* s = symbolV2toV1( range.symbol() );
s->setLowerValue( QString::number( range.lowerValue(), 'f', 5 ) );
Expand All @@ -314,7 +314,7 @@ void QgsSymbologyV2Conversion::rendererV2toV1( QgsVectorLayer* layer )

r->setClassificationField( layer->fieldNameIndex( csr2->classAttribute() ) );

foreach( QgsRendererCategoryV2 cat, csr2->categories() )
foreach ( QgsRendererCategoryV2 cat, csr2->categories() )
{
QgsSymbol* s = symbolV2toV1( cat.symbol() );
QString val = cat.value().toString();
Expand Down
10 changes: 5 additions & 5 deletions src/core/symbology-ng/qgsvectorcolorrampv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ QgsVectorColorRampV2* QgsVectorGradientColorRampV2::create( const QgsStringMap&
StopsMap stops;
if ( props.contains( "stops" ) )
{
foreach( QString stop, props["stops"].split( ':' ) )
foreach ( QString stop, props["stops"].split( ':' ) )
{
int i = stop.indexOf( ';' );
if ( i == -1 )
Expand Down Expand Up @@ -366,7 +366,7 @@ QStringList QgsCptCityColorRampV2::listSchemeCollections( QString collectionName
if ( recursive )
{
QStringList entries2 = entries;
foreach( QString entry, entries2 )
foreach ( QString entry, entries2 )
{
entries.append( listSchemeCollections( entry, true ) );
}
Expand Down Expand Up @@ -396,7 +396,7 @@ QList<int> QgsCptCityColorRampV2::listSchemeVariants( QString schemeName )

QString palette( brewerString );
QStringList list = palette.split( QChar( '\n' ) );
foreach( QString entry, list )
foreach ( QString entry, list )
{
QStringList items = entry.split( QChar( '-' ) );
if ( items.count() != 3 || items[0] != schemeName )
Expand Down Expand Up @@ -585,7 +585,7 @@ bool QgsCptCityColorRampV2::loadSchemes( QString rootDir, bool reset )
mCollections = listSchemeCollections( rootDir, true );
qSort( mCollections.begin(), mCollections.end() );

foreach( QString path, mCollections )
foreach ( QString path, mCollections )
{
// QgsDebugMsg("================================");
// QgsDebugMsg("collection = "+path);
Expand Down Expand Up @@ -720,7 +720,7 @@ bool QgsCptCityColorRampV2::loadSchemes( QString rootDir, bool reset )
}

// populate mCollectionNames
foreach( QString path, mCollections )
foreach ( QString path, mCollections )
{
QString filename = QgsCptCityColorRampV2::getBaseDir() + "/" + path + "/" + "DESC.xml";
QFile f( filename );
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology/qgsmarkercatalogue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ void QgsMarkerCatalogue::refreshList()
for ( int i = 0; i < svgPaths.size(); i++ )
{
QDir dir( svgPaths[i] );
foreach( QString item, dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
foreach ( QString item, dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
{
svgPaths.insert( i + 1, dir.path() + "/" + item );
}

QgsDebugMsg( QString( "Looking for svgs in %1" ).arg( dir.path() ) );

foreach( QString item, dir.entryList( QStringList( "*.svg" ), QDir::Files ) )
foreach ( QString item, dir.entryList( QStringList( "*.svg" ), QDir::Files ) )
{
// TODO test if it is correct SVG
mList.append( "svg:" + dir.path() + "/" + item );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void QgsAttributeTableModel::loadLayer()
if ( behaviour == 1 )
{
beginInsertRows( QModelIndex(), 0, mLayer->selectedFeatureCount() - 1 );
foreach( QgsFeatureId fid, mLayer->selectedFeaturesIds() )
foreach ( QgsFeatureId fid, mLayer->selectedFeaturesIds() )
{
featureAdded( fid, false );

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgisgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace QgisGui
{
// get a list of supported output image types
QMap<QString, QString> filterMap;
foreach( QByteArray format, QImageWriter::supportedImageFormats() )
foreach ( QByteArray format, QImageWriter::supportedImageFormats() )
{
//svg doesnt work so skip it
if ( format == "svg" )
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsexpressionbuilderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )
connect( btnLoadAll, SIGNAL( pressed() ), this, SLOT( loadAllValues() ) );
connect( btnLoadSample, SIGNAL( pressed() ), this, SLOT( loadSampleValues() ) );

foreach( QPushButton* button, mOperatorsGroupBox->findChildren<QPushButton *>() )
foreach ( QPushButton* button, mOperatorsGroupBox->findChildren<QPushButton *>() )
{
connect( button, SIGNAL( pressed() ), this, SLOT( operatorButtonClicked() ) );
}
Expand Down Expand Up @@ -166,7 +166,7 @@ void QgsExpressionBuilderWidget::loadFieldNames( QgsFieldMap fields )
return;

QStringList fieldNames;
foreach( QgsField field, fields )
foreach ( QgsField field, fields )
{
QString fieldName = field.name();
fieldNames << fieldName;
Expand All @@ -189,7 +189,7 @@ void QgsExpressionBuilderWidget::fillFieldValues( int fieldIndex, int countLimit

QList<QVariant> values;
mLayer->uniqueValues( fieldIndex, values, countLimit );
foreach( QVariant value, values )
foreach ( QVariant value, values )
{
if ( value.isNull() )
mValueListWidget->addItem( "NULL" );
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsexpressionhighlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ QgsExpressionHighlighter::QgsExpressionHighlighter( QTextDocument *parent )
keywordPatterns << "\\bCASE\\b" << "\\bWHEN\\b" << "\\bTHEN\\b"
<< "\\bELSE\\b" << "\\bEND\\b";

foreach( const QString &pattern, keywordPatterns )
foreach ( const QString &pattern, keywordPatterns )
{
rule.pattern = QRegExp( pattern, Qt::CaseInsensitive );
rule.format = keywordFormat;
Expand All @@ -48,7 +48,7 @@ void QgsExpressionHighlighter::addFields( QStringList fieldList )
{
columnNameFormat.setForeground( Qt::darkRed );
HighlightingRule rule;
foreach( const QString field, fieldList )
foreach ( const QString field, fieldList )
{
if ( field.isEmpty() ) // this really happened :)
continue;
Expand All @@ -60,7 +60,7 @@ void QgsExpressionHighlighter::addFields( QStringList fieldList )

void QgsExpressionHighlighter::highlightBlock( const QString &text )
{
foreach( const HighlightingRule &rule, highlightingRules )
foreach ( const HighlightingRule &rule, highlightingRules )
{
QRegExp expression( rule.pattern );
int index = expression.indexIn( text );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ int QgsMapCanvas::layerCount() const
QList<QgsMapLayer*> QgsMapCanvas::layers() const
{
QList<QgsMapLayer*> lst;
foreach( QString layerID, mMapRenderer->layerSet() )
foreach ( QString layerID, mMapRenderer->layerSet() )
{
QgsMapLayer* layer = QgsMapLayerRegistry::instance()->mapLayer( layerID );
if ( 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 @@ -386,7 +386,7 @@ void QgsOWSSourceSelect::enableLayersForCrs( QTreeWidgetItem * )
void QgsOWSSourceSelect::on_mChangeCRSButton_clicked()
{
QStringList layers;
foreach( QTreeWidgetItem *item, mLayersTreeWidget->selectedItems() )
foreach ( QTreeWidgetItem *item, mLayersTreeWidget->selectedItems() )
{
QString layer = item->data( 0, Qt::UserRole + 0 ).toString();
if ( !layer.isEmpty() )
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsprojectionselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet<QString> * c

// iterate through all incoming CRSs

foreach( QString auth_id, crsFilter->values() )
foreach ( QString auth_id, crsFilter->values() )
{
QStringList parts = auth_id.split( ":" );

Expand All @@ -201,7 +201,7 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet<QString> * c
if ( authParts.size() > 0 )
{
QString prefix = " AND (";
foreach( QString auth_name, authParts.keys() )
foreach ( QString auth_name, authParts.keys() )
{
sqlExpression += QString( "%1(upper(auth_name)='%2' AND upper(auth_id) IN ('%3'))" )
.arg( prefix )
Expand Down
10 changes: 5 additions & 5 deletions src/gui/qgsrasterformatsaveoptionswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
char** papszFromStringList( const QStringList& list )
{
char **papszRetList = NULL;
foreach( QString elem, list )
foreach ( QString elem, list )
{
papszRetList = CSLAddString( papszRetList, elem.toLocal8Bit().constData() );
}
Expand Down Expand Up @@ -108,12 +108,12 @@ void QgsRasterFormatSaveOptionsWidget::setType( QgsRasterFormatSaveOptionsWidget
if (( type == Table ) || ( type == LineEdit ) )
{
// hide all controls, except stacked widget
foreach( QWidget* widget, widgets )
foreach ( QWidget* widget, widgets )
{
widget->setVisible( false );
}
mOptionsStackedWidget->setVisible( true );
foreach( QWidget* widget, mOptionsStackedWidget->findChildren<QWidget *>() )
foreach ( QWidget* widget, mOptionsStackedWidget->findChildren<QWidget *>() )
{
widget->setVisible( true );
}
Expand All @@ -126,7 +126,7 @@ void QgsRasterFormatSaveOptionsWidget::setType( QgsRasterFormatSaveOptionsWidget
else
{
// show all widgets, except profile buttons (unless Full)
foreach( QWidget* widget, widgets )
foreach ( QWidget* widget, widgets )
{
widget->setVisible( true );
}
Expand Down Expand Up @@ -159,7 +159,7 @@ void QgsRasterFormatSaveOptionsWidget::updateProfiles()
mOptionsMap.clear();
mProfileComboBox->blockSignals( true );
mProfileComboBox->clear();
foreach( QString profileKey, profileKeys )
foreach ( QString profileKey, profileKeys )
{
QString profileName, profileOptions;
profileOptions = createOptions( profileKey );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsrasterlayersaveasdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterDataProvider* s
//only one hardcoded format at the moment
QStringList myFormats;
myFormats << "GTiff";
foreach( QString myFormat, myFormats )
foreach ( QString myFormat, myFormats )
{
mFormatComboBox->addItem( myFormat );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/raster/qgsrasterhistogramwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ void QgsRasterHistogramWidget::histoAction( const QString actionName, bool actio
leHistoMax->blockSignals( true );

// process each band
foreach( int theBandNo, myBands )
foreach ( int theBandNo, myBands )
{
ok = false;
#if 0
Expand Down
2 changes: 1 addition & 1 deletion src/gui/raster/qgsrasterminmaxwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void QgsRasterMinMaxWidget::on_mLoadPushButton_clicked()
{
QgsDebugMsg( "Entered." );

foreach( int myBand, mBands )
foreach ( int myBand, mBands )
{
QgsDebugMsg( QString( "myBand = %1" ).arg( myBand ) );
if ( myBand < 1 || myBand > mLayer->dataProvider()->bandCount() )
Expand Down
6 changes: 3 additions & 3 deletions src/gui/raster/qgsrasterminmaxwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class GUI_EXPORT QgsRasterMinMaxWidget: public QWidget, private Ui::QgsRasterMin
QgsRasterMinMaxWidget( QgsRasterLayer* theLayer, QWidget *parent = 0 );
~QgsRasterMinMaxWidget();

void setExtent ( const QgsRectangle & theExtent ) { mExtent = theExtent; }
void setExtent( const QgsRectangle & theExtent ) { mExtent = theExtent; }

void setBands ( const QList<int> & theBands ) { mBands = theBands; }
void setBands( const QList<int> & theBands ) { mBands = theBands; }

signals:
void load( int theBandNo, double theMin, double theMax );
Expand All @@ -40,7 +40,7 @@ class GUI_EXPORT QgsRasterMinMaxWidget: public QWidget, private Ui::QgsRasterMin
void on_mLoadPushButton_clicked();

private:
QgsRasterLayer* mLayer;
QgsRasterLayer* mLayer;
QList<int> mBands;
QgsRectangle mExtent;
};
Expand Down
14 changes: 7 additions & 7 deletions src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// for color ramps - todo add rasterStyle and refactor raster vs. vector ramps
#include "qgsstylev2.h"
#include "qgsvectorcolorrampv2.h"

#include <QColorDialog>
#include <QFileDialog>
#include <QMessageBox>
Expand All @@ -35,7 +35,7 @@ QgsSingleBandPseudoColorRendererWidget::QgsSingleBandPseudoColorRendererWidget(
setupUi( this );

mColorRampComboBox->populate( QgsStyleV2::defaultStyle() );

if ( !mRasterLayer )
{
return;
Expand Down Expand Up @@ -238,26 +238,26 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()
QgsVectorColorRampV2* colorRamp = mColorRampComboBox->currentColorRamp();
if ( ! colorRamp )
{
//hard code color range from blue -> red (previous default)
//hard code color range from blue -> red (previous default)
int colorDiff = 0;
if ( numberOfEntries != 0 )
{
colorDiff = ( int )( 255 / numberOfEntries );
}

for ( int i = 0; i < numberOfEntries; ++i )
{
QColor currentColor;
currentColor.setRgb( colorDiff*i, 0, 255 - colorDiff * i );
entryColors.push_back( currentColor );
}
}
}
else
{
for ( int i = 0; i < numberOfEntries; ++i )
{
entryColors.push_back( colorRamp->color( ( ( double ) i ) / numberOfEntries ) );
}
entryColors.push_back( colorRamp->color((( double ) i ) / numberOfEntries ) );
}
}

mColormapTreeWidget->clear();
Expand Down
10 changes: 5 additions & 5 deletions src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void QgsCptCityColorRampV2Dialog::populateSchemes( QString view )
{
treeWidget->blockSignals( true );
treeWidget->clear();
foreach( QString collectionName, QgsCptCityColorRampV2::listSchemeCollections() )
foreach ( QString collectionName, QgsCptCityColorRampV2::listSchemeCollections() )
{
item = makeCollectionItem( collectionName );
treeWidget->addTopLevelItem( item );
Expand Down Expand Up @@ -163,7 +163,7 @@ void QgsCptCityColorRampV2Dialog::populateSchemes( QString view )
item->setData( 1, Qt::FontRole, QVariant( font ) );

// add children schemes and collections
foreach( QString childPath, it.value() )
foreach ( QString childPath, it.value() )
{
if ( childPath.endsWith( "/" ) )
{
Expand Down Expand Up @@ -200,7 +200,7 @@ void QgsCptCityColorRampV2Dialog::populateVariants()
QString oldVariant = cboVariantName->currentText();
cboVariantName->clear();

foreach( QString variant, treeWidget->currentItem()->data( 1, Qt::UserRole ).toString().split( " ", QString::SkipEmptyParts ) )
foreach ( QString variant, treeWidget->currentItem()->data( 1, Qt::UserRole ).toString().split( " ", QString::SkipEmptyParts ) )
{
QString variantStr = variant;
if ( variantStr.startsWith( "-" ) || variantStr.startsWith( "_" ) )
Expand Down Expand Up @@ -335,14 +335,14 @@ QTreeWidgetItem * QgsCptCityColorRampV2Dialog::makeCollectionItem( const QString

// add children collections
QTreeWidgetItem *childItem;
foreach( QString childPath, QgsCptCityColorRampV2::listSchemeCollections( path ) )
foreach ( QString childPath, QgsCptCityColorRampV2::listSchemeCollections( path ) )
{
childItem = makeCollectionItem( childPath );
item->addChild( childItem );
}

// add children schemes
foreach( QString schemeName, QgsCptCityColorRampV2::schemeMap().value( path ) )
foreach ( QString schemeName, QgsCptCityColorRampV2::schemeMap().value( path ) )
{
makeSchemeItem( item, path, schemeName );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgscptcitycolorrampv2dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GUI_EXPORT QgsCptCityColorRampV2Dialog : public QDialog, private Ui::QgsCp

void on_treeWidget_currentItemChanged( QTreeWidgetItem * current, QTreeWidgetItem * previous );
void on_treeWidget_itemExpanded( QTreeWidgetItem * item );
void on_buttonGroupView_buttonClicked ( QAbstractButton * button );
void on_buttonGroupView_buttonClicked( QAbstractButton * button );

protected:

Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ QgsRendererV2PropertiesDialog::QgsRendererV2PropertiesDialog( QgsVectorLayer* la
QPixmap pix;
QgsRendererV2Registry* reg = QgsRendererV2Registry::instance();
QStringList renderers = reg->renderersList();
foreach( QString name, renderers )
foreach ( QString name, renderers )
{
QgsRendererV2AbstractMetadata* m = reg->rendererMetadata( name );
cboRenderers->addItem( m->icon(), m->visibleName(), name );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgsrendererv2widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void QgsRendererV2DataDefinedMenus::sizeScaleFieldSelected()

void QgsRendererV2DataDefinedMenus::updateMenu( QMenu* menu, QString fieldName )
{
foreach( QAction* a, menu->actions() )
foreach ( QAction* a, menu->actions() )
{
a->setChecked( a->text() == fieldName );
}
Expand Down
20 changes: 10 additions & 10 deletions src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void QgsRuleBasedRendererV2Widget::removeRule()
{
QItemSelection sel = viewRules->selectionModel()->selection();
QgsDebugMsg( QString( "REMOVE RULES!!! ranges: %1" ).arg( sel.count() ) );
foreach( QItemSelectionRange range, sel )
foreach ( QItemSelectionRange range, sel )
{
QgsDebugMsg( QString( "RANGE: r %1 - %2" ).arg( range.top() ).arg( range.bottom() ) );
if ( range.isValid() )
Expand Down Expand Up @@ -211,8 +211,8 @@ void QgsRuleBasedRendererV2Widget::refineRule( int type )
// TODO: set initial rule's symbol to NULL (?)

// show the newly added rules
foreach( QModelIndex index, indexlist )
viewRules->expand( index );
foreach ( QModelIndex index, indexlist )
viewRules->expand( index );
}

void QgsRuleBasedRendererV2Widget::refineRuleCategories()
Expand Down Expand Up @@ -248,7 +248,7 @@ void QgsRuleBasedRendererV2Widget::refineRuleCategoriesGui( const QModelIndexLis

// create new rules
QgsCategorizedSymbolRendererV2* r = static_cast<QgsCategorizedSymbolRendererV2*>( w->renderer() );
foreach( QModelIndex index, indexList )
foreach ( QModelIndex index, indexList )
{
QgsRuleBasedRendererV2::Rule* initialRule = mModel->ruleForIndex( index );
mModel->willAddRules( index, r->categories().count() );
Expand Down Expand Up @@ -278,7 +278,7 @@ void QgsRuleBasedRendererV2Widget::refineRuleRangesGui( const QModelIndexList& i

// create new rules
QgsGraduatedSymbolRendererV2* r = static_cast<QgsGraduatedSymbolRendererV2*>( w->renderer() );
foreach( QModelIndex index, indexList )
foreach ( QModelIndex index, indexList )
{
QgsRuleBasedRendererV2::Rule* initialRule = mModel->ruleForIndex( index );
mModel->willAddRules( index, r->ranges().count() );
Expand All @@ -289,7 +289,7 @@ void QgsRuleBasedRendererV2Widget::refineRuleRangesGui( const QModelIndexList& i

void QgsRuleBasedRendererV2Widget::refineRuleScalesGui( const QModelIndexList& indexList )
{
foreach( QModelIndex index, indexList )
foreach ( QModelIndex index, indexList )
{
QgsRuleBasedRendererV2::Rule* initialRule = mModel->ruleForIndex( index );

Expand All @@ -309,7 +309,7 @@ void QgsRuleBasedRendererV2Widget::refineRuleScalesGui( const QModelIndexList& i

QList<int> scales;
bool ok;
foreach( QString item, txt.split( ',' ) )
foreach ( QString item, txt.split( ',' ) )
{
int scale = item.toInt( &ok );
if ( ok )
Expand All @@ -318,7 +318,7 @@ void QgsRuleBasedRendererV2Widget::refineRuleScalesGui( const QModelIndexList& i
QMessageBox::information( this, tr( "Error" ), QString( tr( "\"%1\" is not valid scale denominator, ignoring it." ) ).arg( item ) );
}

foreach( QModelIndex index, indexList )
foreach ( QModelIndex index, indexList )
{
QgsRuleBasedRendererV2::Rule* initialRule = mModel->ruleForIndex( index );
mModel->willAddRules( index, scales.count() + 1 );
Expand All @@ -337,7 +337,7 @@ QList<QgsSymbolV2*> QgsRuleBasedRendererV2Widget::selectedSymbols()
}

QItemSelection sel = viewRules->selectionModel()->selection();
foreach( QItemSelectionRange range, sel )
foreach ( QItemSelectionRange range, sel )
{
QModelIndex parent = range.parent();
QgsRuleBasedRendererV2::Rule* parentRule = mModel->ruleForIndex( parent );
Expand Down Expand Up @@ -684,7 +684,7 @@ QMimeData *QgsRuleBasedRendererV2Model::mimeData( const QModelIndexList &indexes

QDataStream stream( &encodedData, QIODevice::WriteOnly );

foreach( const QModelIndex &index, indexes )
foreach ( const QModelIndex &index, indexes )
{
// each item consists of several columns - let's add it with just first one
if ( !index.isValid() || index.column() != 0 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ QgsVectorColorBrewerColorRampV2Dialog::QgsVectorColorBrewerColorRampV2Dialog( Qg
cboSchemeName->setIconSize( iconSize );

QStringList schemes = QgsVectorColorBrewerColorRampV2::listSchemeNames();
foreach( QString schemeName, schemes )
foreach ( QString schemeName, schemes )
{
// create a preview icon using five color variant
QgsVectorColorBrewerColorRampV2* r = new QgsVectorColorBrewerColorRampV2( schemeName, 5 );
Expand All @@ -67,7 +67,7 @@ void QgsVectorColorBrewerColorRampV2Dialog::populateVariants()
cboColors->clear();
QString schemeName = cboSchemeName->currentText();
QList<int> variants = QgsVectorColorBrewerColorRampV2::listSchemeVariants( schemeName );
foreach( int variant, variants )
foreach ( int variant, variants )
{
cboColors->addItem( QString::number( variant ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgsconfigcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ QgsConfigCache::QgsConfigCache()

QgsConfigCache::~QgsConfigCache()
{
foreach( QgsConfigParser *parser, mCachedConfigurations.values() )
foreach ( QgsConfigParser *parser, mCachedConfigurations.values() )
{
delete parser;
}
Expand Down
16 changes: 8 additions & 8 deletions src/mapserver/qgsconfigparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@ QgsConfigParser::QgsConfigParser()
QgsConfigParser::~QgsConfigParser()
{
//remove the external GML datasets
foreach( QDomDocument *doc, mExternalGMLDatasets.values() )
foreach ( QDomDocument *doc, mExternalGMLDatasets.values() )
{
delete doc;
}

//remove the temporary files
foreach( QTemporaryFile *file, mFilesToRemove )
foreach ( QTemporaryFile *file, mFilesToRemove )
{
delete file;
}

//and also those the temporary file paths
foreach( QString path, mFilePathsToRemove )
foreach ( QString path, mFilePathsToRemove )
{
QFile::remove( path );
}

//delete the layers in the list
foreach( QgsMapLayer *layer, mLayersToRemove )
foreach ( QgsMapLayer *layer, mLayersToRemove )
{
delete layer;
}
Expand Down Expand Up @@ -386,7 +386,7 @@ void QgsConfigParser::appendCRSElementsToLayer( QDomElement& layerElement, QDomD
}
else //no crs constraint
{
foreach( QString crs, crsList )
foreach ( QString crs, crsList )
{
appendCRSElementToLayer( layerElement, CRSPrecedingElement, crs, doc );
}
Expand Down Expand Up @@ -420,7 +420,7 @@ QgsComposition* QgsConfigParser::createPrintComposition( const QString& composer
}

//replace composer map parameters
foreach( QgsComposerMap* currentMap, composerMaps )
foreach ( QgsComposerMap* currentMap, composerMaps )
{
if ( !currentMap )
{
Expand Down Expand Up @@ -508,7 +508,7 @@ QgsComposition* QgsConfigParser::createPrintComposition( const QString& composer
styleName = wmsStyleList.at( i );
}

foreach( QgsMapLayer *layer, mapLayerFromStyle( wmsLayerList.at( i ), styleName ) )
foreach ( QgsMapLayer *layer, mapLayerFromStyle( wmsLayerList.at( i ), styleName ) )
{
if ( layer )
{
Expand All @@ -527,7 +527,7 @@ QgsComposition* QgsConfigParser::createPrintComposition( const QString& composer
}

//replace label text
foreach( QgsComposerLabel *currentLabel, composerLabels )
foreach ( QgsComposerLabel *currentLabel, composerLabels )
{
QString title = parameterMap.value( currentLabel->id().toUpper() );

Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgshttprequesthandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void QgsHttpRequestHandler::requestStringToParameterMap( const QString& request,


//insert key and value into the map (parameters are separated by &
foreach( QString element, request.split( "&" ) )
foreach ( QString element, request.split( "&" ) )
{
int sepidx = element.indexOf( "=", 0, Qt::CaseSensitive );
if ( sepidx == -1 )
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgsmslayerbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ QString QgsMSLayerBuilder::layerNameFromUri( const QString& uri ) const
if ( uri.contains( "dbname" ) )
{
//take tablename
foreach( QString token, uri.split( " " ) )
foreach ( QString token, uri.split( " " ) )
{
if ( token.startsWith( "table" ) )
{
Expand Down
4 changes: 2 additions & 2 deletions src/mapserver/qgsmslayercache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ QgsMSLayerCache::QgsMSLayerCache()
QgsMSLayerCache::~QgsMSLayerCache()
{
QgsDebugMsg( "removing all entries" );
foreach( QgsMSLayerCacheEntry entry, mEntries )
foreach ( QgsMSLayerCacheEntry entry, mEntries )
{
delete entry.layerPointer;
}
Expand Down Expand Up @@ -181,7 +181,7 @@ void QgsMSLayerCache::freeEntryRessources( QgsMSLayerCacheEntry& entry )
delete entry.layerPointer;

//remove the temporary files of a layer
foreach( QString file, entry.temporaryFiles )
foreach ( QString file, entry.temporaryFiles )
{
//remove the temporary file
QFile removeFile( file );
Expand Down
12 changes: 6 additions & 6 deletions src/mapserver/qgsprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void QgsProjectParser::layersAndStylesCapabilities( QDomElement& parentElement,

QMap<QString, QgsMapLayer *> layerMap;

foreach( const QDomElement &elem, mProjectLayerElements )
foreach ( const QDomElement &elem, mProjectLayerElements )
{
QgsMapLayer *layer = createLayerFromElement( elem );
if ( layer )
Expand Down Expand Up @@ -150,7 +150,7 @@ void QgsProjectParser::featureTypeList( QDomElement& parentElement, QDomDocument

QMap<QString, QgsMapLayer *> layerMap;

foreach( const QDomElement &elem, mProjectLayerElements )
foreach ( const QDomElement &elem, mProjectLayerElements )
{
QString type = elem.attribute( "type" );
if ( type == "vector" )
Expand Down Expand Up @@ -252,7 +252,7 @@ void QgsProjectParser::addLayers( QDomDocument &doc,
QStringList pIdDisabled = p->identifyDisabledLayers();

QDomElement embeddedGroupElem;
foreach( const QDomElement &elem, embeddedGroupElements )
foreach ( const QDomElement &elem, embeddedGroupElements )
{
if ( elem.attribute( "name" ) == embeddedGroupName )
{
Expand All @@ -263,7 +263,7 @@ void QgsProjectParser::addLayers( QDomDocument &doc,

QMap<QString, QgsMapLayer *> pLayerMap;
QList<QDomElement> embeddedProjectLayerElements = p->mProjectLayerElements;
foreach( const QDomElement &elem, embeddedProjectLayerElements )
foreach ( const QDomElement &elem, embeddedProjectLayerElements )
{
pLayerMap.insert( layerId( elem ), p->createLayerFromElement( elem ) );
}
Expand Down Expand Up @@ -1483,9 +1483,9 @@ QString QgsProjectParser::serviceUrl() const
{
QString url;

if( !mXMLDoc )
if ( !mXMLDoc )
{
return url;
return url;
}

QDomElement propertiesElem = mXMLDoc->documentElement().firstChildElement( "properties" );
Expand Down
14 changes: 7 additions & 7 deletions src/mapserver/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ QgsWMSServer::QgsWMSServer()

void QgsWMSServer::appendFormats( QDomDocument &doc, QDomElement &elem, const QStringList &formats )
{
foreach( QString format, formats )
foreach ( QString format, formats )
{
QDomElement formatElem = doc.createElement( "Format"/*wms:Format*/ );
formatElem.appendChild( doc.createTextNode( format ) );
Expand Down Expand Up @@ -1673,15 +1673,15 @@ QMap<QString, QString> QgsWMSServer::applyRequestedLayerFilters( const QStringLi
//we need to find the maplayer objects matching the layer name
QList<QgsMapLayer*> layersToFilter;

foreach( QgsMapLayer *layer, QgsMapLayerRegistry::instance()->mapLayers() )
foreach ( QgsMapLayer *layer, QgsMapLayerRegistry::instance()->mapLayers() )
{
if ( layer && layer->name() == eqSplit.at( 0 ) )
{
layersToFilter.push_back( layer );
}
}

foreach( QgsMapLayer *filter, layersToFilter )
foreach ( QgsMapLayer *filter, layersToFilter )
{
QgsVectorLayer* filteredLayer = dynamic_cast<QgsVectorLayer*>( filter );
if ( filteredLayer )
Expand Down Expand Up @@ -1859,7 +1859,7 @@ QStringList QgsWMSServer::applyFeatureSelections( const QStringList& layerList )
return layersWithSelections;
}

foreach( QString selectionLayer, selectionString.split( ";" ) )
foreach ( QString selectionLayer, selectionString.split( ";" ) )
{
//separate layer name from id list
QStringList layerIdSplit = selectionLayer.split( ":" );
Expand All @@ -1872,7 +1872,7 @@ QStringList QgsWMSServer::applyFeatureSelections( const QStringList& layerList )
QString layerName = layerIdSplit.at( 0 );
QgsVectorLayer* vLayer = 0;

foreach( QgsMapLayer *layer, QgsMapLayerRegistry::instance()->mapLayers() )
foreach ( QgsMapLayer *layer, QgsMapLayerRegistry::instance()->mapLayers() )
{
if ( layer && layer->name() == layerName )
{
Expand All @@ -1890,7 +1890,7 @@ QStringList QgsWMSServer::applyFeatureSelections( const QStringList& layerList )
QStringList idList = layerIdSplit.at( 1 ).split( "," );
QgsFeatureIds selectedIds;

foreach( QString id, idList )
foreach ( QString id, idList )
{
selectedIds.insert( STRING_TO_FID( id ) );
}
Expand All @@ -1906,7 +1906,7 @@ void QgsWMSServer::clearFeatureSelections( const QStringList& layerIds ) const
{
QMap<QString, QgsMapLayer*>& layerMap = QgsMapLayerRegistry::instance()->mapLayers();

foreach( QString id, layerIds )
foreach ( QString id, layerIds )
{
QgsVectorLayer *layer = qobject_cast< QgsVectorLayer * >( layerMap.value( id, 0 ) );
if ( !layer )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ int QgsSVGDiagramFactoryWidget::addDirectoryToPreview( const QString& path )
void QgsSVGDiagramFactoryWidget::addStandardDirectoriesToPreview()
{
//list all directories in $prefix/share/qgis/svg
foreach( QString path, QgsApplication::svgPaths() )
foreach ( QString path, QgsApplication::svgPaths() )
{
QDir svgDirectory( path );
if ( !svgDirectory.exists() || !svgDirectory.isReadable() )
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/georeferencer/qgsgeorefplugingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ void QgsGeorefPluginGui::saveGCPs()
{
QTextStream points( &pointFile );
points << "mapX,mapY,pixelX,pixelY,enable" << endl;
foreach( QgsGeorefDataPoint *pt, mPoints )
foreach ( QgsGeorefDataPoint *pt, mPoints )
{
points << ( QString( "%1,%2,%3,%4,%5" ).arg( pt->mapCoords().x(), 0, 'f', 15 ).
arg( pt->mapCoords().y(), 0, 'f', 15 ).arg( pt->pixelCoords().x(), 0, 'f', 15 ).
Expand Down Expand Up @@ -1763,7 +1763,7 @@ QString QgsGeorefPluginGui::generateGDALtranslateCommand( bool generateTFW )
gdalCommand << "-co TFW=YES";
}

foreach( QgsGeorefDataPoint *pt, mPoints )
foreach ( QgsGeorefDataPoint *pt, mPoints )
{
gdalCommand << QString( "-gcp %1 %2 %3 %4" ).arg( pt->pixelCoords().x() ).arg( -pt->pixelCoords().y() )
.arg( pt->mapCoords().x() ).arg( pt->mapCoords().y() );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgstransformsettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( const QString &raster, c
mListCompression.append( "PACKBITS" );
mListCompression.append( "DEFLATE" );
QStringList listCompressionTr;
foreach( QString item, mListCompression )
foreach ( QString item, mListCompression )
{
listCompressionTr.append( tr( item.toAscii().data() ) );
}
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/grass/qgsgrassbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void QgsGrassBrowser::copyMap()

// Filter VectorLayer type from selection
QModelIndexList indexes;
foreach( QModelIndex index, mTree->selectionModel()->selectedIndexes() )
foreach ( QModelIndex index, mTree->selectionModel()->selectedIndexes() )
{
int type = mModel->itemType( index );
if ( type != QgsGrassModel::VectorLayer )
Expand Down Expand Up @@ -306,7 +306,7 @@ void QgsGrassBrowser::renameMap()

// Filter VectorLayer type from selection
QModelIndexList indexes;
foreach( QModelIndex index, mTree->selectionModel()->selectedIndexes() )
foreach ( QModelIndex index, mTree->selectionModel()->selectedIndexes() )
{
int type = mModel->itemType( index );
if ( type != QgsGrassModel::VectorLayer )
Expand Down Expand Up @@ -384,7 +384,7 @@ void QgsGrassBrowser::deleteMap()

// Filter VectorLayer type from selection
QModelIndexList indexes;
foreach( QModelIndex index, mTree->selectionModel()->selectedIndexes() )
foreach ( QModelIndex index, mTree->selectionModel()->selectedIndexes() )
{
int type = mModel->itemType( index );
QString mapset = mModel->itemMapset( index );
Expand All @@ -399,7 +399,7 @@ void QgsGrassBrowser::deleteMap()
QString uri = gisbase + "/" + location + "/"
+ mapset + "/" + map + "/" + layers[i];

foreach( QgsMapLayer *layer, mIface->legendInterface()->layers() )
foreach ( QgsMapLayer *layer, mIface->legendInterface()->layers() )
{
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer );
if ( vl && vl->dataProvider()->name() == "grass" && vl->source() == uri )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/heatmap/heatmapgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ HeatmapGui::HeatmapGui( QWidget* parent, Qt::WFlags fl )
QgsDebugMsg( QString( "Creating Heatmap Dialog" ) );

// Adding point layers to the mInputVectorCombo
foreach( QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() )
foreach ( QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() )
{
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( l );
if ( !vl || vl->geometryType() != QGis::Point )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void QgsDelimitedTextSourceSelect::updateFieldLists()
// than its name. All fields are assumed to be text
bool haveFields = false;

foreach( QString field, fieldList )
foreach ( QString field, fieldList )
{
if (( field.left( 1 ) == "'" || field.left( 1 ) == "\"" ) &&
field.left( 1 ) == field.right( 1 ) )
Expand Down
12 changes: 6 additions & 6 deletions src/providers/gdal/qgsgdaldataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ QVector<QgsDataItem*> QgsWCSConnectionItem::createChildren()
return children;
}

foreach( QgsWcsCoverageSummary coverageSummary, mCapabilities.capabilities().contents.coverageSummary )
foreach ( QgsWcsCoverageSummary coverageSummary, mCapabilities.capabilities().contents.coverageSummary )
{
// Attention, the name may be empty
QgsDebugMsg( QString::number( coverageSummary.orderId ) + " " + coverageSummary.identifier + " " + coverageSummary.title );
Expand Down Expand Up @@ -233,7 +233,7 @@ QgsWCSLayerItem::QgsWCSLayerItem( QgsDataItem* parent, QString name, QString pat
QgsDebugMsg( "uri = " + mDataSourceUri.encodedUri() );
mUri = createUri();
// Populate everything, it costs nothing, all info about layers is collected
foreach( QgsWcsCoverageSummary coverageSummary, mCoverageSummary.coverageSummary )
foreach ( QgsWcsCoverageSummary coverageSummary, mCoverageSummary.coverageSummary )
{
// Attention, the name may be empty
QgsDebugMsg( QString::number( coverageSummary.orderId ) + " " + coverageSummary.identifier + " " + coverageSummary.title );
Expand Down Expand Up @@ -278,7 +278,7 @@ QString QgsWCSLayerItem::createUri()
}
else
{
foreach( QString f, mimes )
foreach ( QString f, mimes )
{
if ( mCoverageSummary.supportedFormat.indexOf( f ) >= 0 )
{
Expand All @@ -297,7 +297,7 @@ QString QgsWCSLayerItem::createUri()
// TODO: prefer project CRS
// get first known if possible
QgsCoordinateReferenceSystem testCrs;
foreach( QString c, mCoverageSummary.supportedCrs )
foreach ( QString c, mCoverageSummary.supportedCrs )
{
testCrs.createFromOgcWmsCrs( c );
if ( testCrs.isValid() )
Expand Down Expand Up @@ -335,7 +335,7 @@ QgsWCSRootItem::~QgsWCSRootItem()
QVector<QgsDataItem*>QgsWCSRootItem::createChildren()
{
QVector<QgsDataItem*> connections;
foreach( QString connName, QgsOWSConnection::connectionList( "WCS" ) )
foreach ( QString connName, QgsOWSConnection::connectionList( "WCS" ) )
{
//QgsDataItem * conn = new QgsWCSConnectionItem( this, connName, mPath + "/" + connName );
QgsOWSConnection connection( "WCS", connName );
Expand Down Expand Up @@ -451,7 +451,7 @@ QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem )
if ( !extensions.contains( suffix ) )
{
bool matches = false;
foreach( QString wildcard, wildcards )
foreach ( QString wildcard, wildcards )
{
QRegExp rx( wildcard, Qt::CaseInsensitive, QRegExp::Wildcard );
if ( rx.exactMatch( info.fileName() ) )
Expand Down
6 changes: 3 additions & 3 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ QgsRasterHistogram QgsGdalProvider::histogram( int theBandNo,
initHistogram( myHistogram, theBandNo, theBinCount, theMinimum, theMaximum, theExtent, theSampleSize, theIncludeOutOfRange );

// Find cached
foreach( QgsRasterHistogram histogram, mHistograms )
foreach ( QgsRasterHistogram histogram, mHistograms )
{
if ( histogram == myHistogram )
{
Expand Down Expand Up @@ -2091,7 +2091,7 @@ QgsRasterBandStats QgsGdalProvider::bandStatistics( int theBandNo, int theStats,
QgsRasterBandStats myRasterBandStats;
initStatistics( myRasterBandStats, theBandNo, theStats, theExtent, theSampleSize );

foreach( QgsRasterBandStats stats, mStatistics )
foreach ( QgsRasterBandStats stats, mStatistics )
{
if ( stats.contains( myRasterBandStats ) )
{
Expand Down Expand Up @@ -2377,7 +2377,7 @@ void QgsGdalProvider::initBaseDataset()
char** papszFromStringList( const QStringList& list )
{
char **papszRetList = NULL;
foreach( QString elem, list )
foreach ( QString elem, list )
{
papszRetList = CSLAddString( papszRetList, elem.toLocal8Bit().constData() );
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/gdal/qgswcssourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ QList<QgsOWSSupportedFormat> QgsWCSSourceSelect::providerFormats()
QList<QgsOWSSupportedFormat> formats;

QMap<QString, QString> mimes = QgsGdalProvider::supportedMimes();
foreach( QString mime, mimes.keys() )
foreach ( QString mime, mimes.keys() )
{
QgsOWSSupportedFormat format = { mime, mimes.value( mime ) };

Expand Down
8 changes: 4 additions & 4 deletions src/providers/grass/qgsgrassprovidermodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ QVector<QgsDataItem*>QgsGrassLocationItem::createChildren()
QDir dir( mPath );

QStringList entries = dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name );
foreach( QString name, entries )
foreach ( QString name, entries )
{
QString path = dir.absoluteFilePath( name );

Expand Down Expand Up @@ -83,7 +83,7 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()

QStringList vectorNames = QgsGrass::vectors( mPath );

foreach( QString name, vectorNames )
foreach ( QString name, vectorNames )
{
QStringList layerNames = QgsGrass::vectorLayers( mGisdbase , mLocation, mName, name );

Expand All @@ -92,7 +92,7 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()
QgsDataCollectionItem *map = 0;
if ( layerNames.size() != 1 )
map = new QgsDataCollectionItem( this, name );
foreach( QString layerName, layerNames )
foreach ( QString layerName, layerNames )
{
QString uri = mPath + QDir::separator() + name + QDir::separator() + layerName;
QgsLayerItem::LayerType layerType = QgsLayerItem::Vector;
Expand Down Expand Up @@ -123,7 +123,7 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()

QStringList rasterNames = QgsGrass::rasters( mPath );

foreach( QString name, rasterNames )
foreach ( QString name, rasterNames )
{
QString uri = mPath + QDir::separator() + "cellhd" + QDir::separator() + name;
QgsDebugMsg( "uri = " + uri );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassrasterprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ QDateTime QgsGrassRasterProvider::dataTimestamp() const
QString mapset = mGisdbase + "/" + mLocation + "/" + mMapset;
QStringList dirs;
dirs << "cell" << "colr";
foreach( QString dir, dirs )
foreach ( QString dir, dirs )
{
QString path = mapset + "/" + dir + "/" + mMapName;
QFileInfo fi( path );
Expand Down
22 changes: 11 additions & 11 deletions src/providers/mssql/qgsmssqldataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void QgsMssqlConnectionItem::refresh()
QVector<QgsDataItem*> items = createChildren( );

// Add new items
foreach( QgsDataItem *item, items )
foreach ( QgsDataItem *item, items )
{
// Is it present in childs?
int index = findItem( mChildren, item );
Expand Down Expand Up @@ -161,11 +161,11 @@ QVector<QgsDataItem*> QgsMssqlConnectionItem::createChildren()

// skip layers which are added already
bool skip = false;
foreach( QgsDataItem *child, mChildren )
foreach ( QgsDataItem *child, mChildren )
{
if ( child->name() == layer.schemaName )
{
foreach( QgsDataItem *child2, child->children() )
foreach ( QgsDataItem *child2, child->children() )
{
if ( child2->name() == layer.tableName )
{
Expand All @@ -184,7 +184,7 @@ QVector<QgsDataItem*> QgsMssqlConnectionItem::createChildren()
QString srid = layer.srid;

QgsMssqlSchemaItem* schemaItem = NULL;
foreach( QgsDataItem *child, children )
foreach ( QgsDataItem *child, children )
{
if ( child->name() == layer.schemaName )
{
Expand Down Expand Up @@ -225,9 +225,9 @@ QVector<QgsDataItem*> QgsMssqlConnectionItem::createChildren()
}

// Remove no more present items
foreach( QgsDataItem *child, mChildren )
foreach ( QgsDataItem *child, mChildren )
{
foreach( QgsDataItem *child2, child->children() )
foreach ( QgsDataItem *child2, child->children() )
{
if ( findItem( newLayers, child2 ) < 0 )
child->deleteChildItem( child2 );
Expand All @@ -246,7 +246,7 @@ void QgsMssqlConnectionItem::setLayerType( QgsMssqlLayerProperty layerProperty )
{
QgsMssqlSchemaItem *schemaItem = NULL;

foreach( QgsDataItem *child, mChildren )
foreach ( QgsDataItem *child, mChildren )
{
if ( child->name() == layerProperty.schemaName )
{
Expand All @@ -255,7 +255,7 @@ void QgsMssqlConnectionItem::setLayerType( QgsMssqlLayerProperty layerProperty )
}
}

foreach( QgsDataItem *layerItem, schemaItem->children() )
foreach ( QgsDataItem *layerItem, schemaItem->children() )
{
if ( layerItem->name() == layerProperty.tableName )
return; // already added
Expand Down Expand Up @@ -341,7 +341,7 @@ bool QgsMssqlConnectionItem::handleDrop( const QMimeData * data, Qt::DropAction
QStringList importResults;
bool hasError = false;
QgsMimeDataUtils::UriList lst = QgsMimeDataUtils::decodeUriList( data );
foreach( const QgsMimeDataUtils::Uri& u, lst )
foreach ( const QgsMimeDataUtils::Uri& u, lst )
{
if ( u.layerType != "vector" )
{
Expand Down Expand Up @@ -454,7 +454,7 @@ QgsMssqlSchemaItem::~QgsMssqlSchemaItem()
void QgsMssqlSchemaItem::addLayers( QgsDataItem* newLayers )
{
// Add new items
foreach( QgsDataItem *child, newLayers->children() )
foreach ( QgsDataItem *child, newLayers->children() )
{
// Is it present in childs?
if ( findItem( mChildren, child ) >= 0 )
Expand Down Expand Up @@ -531,7 +531,7 @@ QVector<QgsDataItem*> QgsMssqlRootItem::createChildren()
QVector<QgsDataItem*> connections;
QSettings settings;
settings.beginGroup( "/MSSQL/connections" );
foreach( QString connName, settings.childGroups() )
foreach ( QString connName, settings.childGroups() )
{
connections << new QgsMssqlConnectionItem( this, connName, mPath + "/" + connName );
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/mssql/qgsmssqlprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void QgsMssqlProvider::loadFields()
return;
}
}
foreach( QString pk, pkCandidates )
foreach ( QString pk, pkCandidates )
{
mQuery.clear();
mQuery.setForwardOnly( true );
Expand Down
22 changes: 11 additions & 11 deletions src/providers/mssql/qgsmssqlsourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ QWidget *QgsMssqlSourceSelectDelegate::createEditor( QWidget *parent, const QSty
if ( index.column() == QgsMssqlTableModel::dbtmType && index.data( Qt::UserRole + 1 ).toBool() )
{
QComboBox *cb = new QComboBox( parent );
foreach( QGis::WkbType type,
QList<QGis::WkbType>()
<< QGis::WKBPoint
<< QGis::WKBLineString
<< QGis::WKBPolygon
<< QGis::WKBMultiPoint
<< QGis::WKBMultiLineString
<< QGis::WKBMultiPolygon
<< QGis::WKBNoGeometry )
foreach ( QGis::WkbType type,
QList<QGis::WkbType>()
<< QGis::WKBPoint
<< QGis::WKBLineString
<< QGis::WKBPolygon
<< QGis::WKBMultiPoint
<< QGis::WKBMultiLineString
<< QGis::WKBMultiPolygon
<< QGis::WKBNoGeometry )
{
cb->addItem( QgsMssqlTableModel::iconForWkbType( type ), QgsMssqlTableModel::displayStringForWkbType( type ), type );
}
Expand Down Expand Up @@ -421,7 +421,7 @@ void QgsMssqlSourceSelect::addTables()
{
mSelectedTables.clear();

foreach( QModelIndex idx, mTablesTreeView->selectionModel()->selection().indexes() )
foreach ( QModelIndex idx, mTablesTreeView->selectionModel()->selection().indexes() )
{
if ( idx.column() != QgsMssqlTableModel::dbtmTable )
continue;
Expand Down Expand Up @@ -735,7 +735,7 @@ void QgsMssqlGeomColumnTypeThread::run()
{
mStopped = false;

foreach( QgsMssqlLayerProperty layerProperty, layerProperties )
foreach ( QgsMssqlLayerProperty layerProperty, layerProperties )
{
if ( !mStopped )
{
Expand Down
6 changes: 3 additions & 3 deletions src/providers/mssql/qgsmssqltablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void QgsMssqlTableModel::addTableEntry( QgsMssqlLayerProperty layerProperty )
if ( detailsFromThread )
flags |= Qt::ItemIsEnabled;

foreach( QStandardItem *item, childItemList )
foreach ( QStandardItem *item, childItemList )
{
item->setFlags( item->flags() & ~flags );
}
Expand Down Expand Up @@ -251,7 +251,7 @@ void QgsMssqlTableModel::setGeometryTypesForTable( QgsMssqlLayerProperty layerPr
row[ dbtmSrid ]->setText( tr( "Enter..." ) );
row[ dbtmSrid ]->setFlags( row[ dbtmSrid ]->flags() | Qt::ItemIsEditable );

foreach( QStandardItem *item, row )
foreach ( QStandardItem *item, row )
{
item->setFlags( item->flags() | Qt::ItemIsEnabled );
}
Expand All @@ -272,7 +272,7 @@ void QgsMssqlTableModel::setGeometryTypesForTable( QgsMssqlLayerProperty layerPr
if ( layerProperty.pkCols.size() < 2 )
flags |= Qt::ItemIsSelectable;

foreach( QStandardItem *item, row )
foreach ( QStandardItem *item, row )
{
item->setFlags( item->flags() | flags );
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/ogr/qgsogrdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem )
if ( myExtensions.indexOf( suffix ) < 0 )
{
bool matches = false;
foreach( QString wildcard, wildcards() )
foreach ( QString wildcard, wildcards() )
{
QRegExp rx( wildcard, Qt::CaseInsensitive, QRegExp::Wildcard );
if ( rx.exactMatch( info.fileName() ) )
Expand Down
2 changes: 1 addition & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ bool QgsOgrProvider::deleteAttributes( const QgsAttributeIds &attributes )
QList<int> attrsLst = attributes.toList();
// sort in descending order
qSort( attrsLst.begin(), attrsLst.end(), qGreater<int>() );
foreach( int attr, attrsLst )
foreach ( int attr, attrsLst )
{
if ( OGR_L_DeleteField( ogrLayer, attr ) != OGRERR_NONE )
{
Expand Down
2 changes: 1 addition & 1 deletion src/providers/osm/osmprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ QgsOSMDataProvider::QgsOSMDataProvider( QString uri )
// remove observer from the URI
// (because otherwise it would be saved into project file and would cause crashes)
QString newProps;
foreach( QString p , props )
foreach ( QString p , props )
{
if ( !p.startsWith( "observer" ) )
{
Expand Down
12 changes: 6 additions & 6 deletions src/providers/ows/qgsowsdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ QVector<QgsDataItem*> QgsOWSConnectionItem::createChildren()

int layerCount = 0;
// Try to open with WMS,WFS,WCS
foreach( QString key, QStringList() << "wms" << "WFS" << "gdal" )
foreach ( QString key, QStringList() << "wms" << "WFS" << "gdal" )
{
QgsDebugMsg( "Add connection for provider " + key );
QLibrary *library = QgsProviderRegistry::instance()->providerLibrary( key );
Expand Down Expand Up @@ -59,13 +59,13 @@ QVector<QgsDataItem*> QgsOWSConnectionItem::createChildren()
}
}

foreach( QgsDataItem* item, serviceItems )
foreach ( QgsDataItem* item, serviceItems )
{
QgsDebugMsg( QString( "serviceItems.size = %1 layerCount = %2 rowCount = %3" ).arg( serviceItems.size() ).arg( layerCount ).arg( item->rowCount() ) );
if ( serviceItems.size() == 1 || layerCount <= 30 || item->rowCount() <= 10 )
{
// Add layers directly to OWS connection
foreach( QgsDataItem* subItem, item->children() )
foreach ( QgsDataItem* subItem, item->children() )
{
item->removeChildItem( subItem );
subItem->setParent( this );
Expand Down Expand Up @@ -151,9 +151,9 @@ QVector<QgsDataItem*>QgsOWSRootItem::createChildren()
QVector<QgsDataItem*> connections;
// Combine all WMS,WFS,WCS connections
QMap<QString, QStringList> uris;
foreach( QString service, QStringList() << "WMS" << "WFS" << "WCS" )
foreach ( QString service, QStringList() << "WMS" << "WFS" << "WCS" )
{
foreach( QString connName, QgsOWSConnection::connectionList( service ) )
foreach ( QString connName, QgsOWSConnection::connectionList( service ) )
{
QgsOWSConnection connection( service, connName );

Expand All @@ -166,7 +166,7 @@ QVector<QgsDataItem*>QgsOWSRootItem::createChildren()
uris[encodedUri] = labels;
}
}
foreach( QString encodedUri, uris.keys() )
foreach ( QString encodedUri, uris.keys() )
{
QgsDataItem * conn = new QgsOWSConnectionItem( this, uris.value( encodedUri ).join( " / " ), encodedUri );
connections.append( conn );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgscolumntypethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void QgsGeomColumnTypeThread::run()

mStopped = false;

foreach( QgsPostgresLayerProperty layerProperty, layerProperties )
foreach ( QgsPostgresLayerProperty layerProperty, layerProperties )
{
if ( !mStopped )
{
Expand Down
Loading