Skip to content

Commit f770aea

Browse files
committed
indentation update and a few unused parameter warnings fixes
1 parent 8968496 commit f770aea

19 files changed

+119
-105
lines changed

src/app/qgsmaptoolfeatureaction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y )
149149
if ( featList.size() == 0 )
150150
return false;
151151

152-
foreach ( QgsFeature feat, featList )
152+
foreach( QgsFeature feat, featList )
153153
{
154154
int actionIdx = layer->actions()->defaultAction();
155155

src/app/qgsvectorlayerproperties.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
951951
QSettings myQSettings; // where we keep last used filter in persistent state
952952
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", "." ).toString();
953953
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Load layer properties from style file" ), myLastUsedDir,
954-
tr( "QGIS Layer Style File" ) + " (*.qml);;" + tr( "SLD File" ) + " (*.sld)" );
954+
tr( "QGIS Layer Style File" ) + " (*.qml);;" + tr( "SLD File" ) + " (*.sld)" );
955955
if ( myFileName.isNull() )
956956
{
957957
return;
@@ -963,7 +963,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
963963
if ( myFileName.endsWith( ".sld", Qt::CaseInsensitive ) )
964964
{
965965
// load from SLD
966-
myMessage = layer->loadSldStyle( myFileName, defaultLoadedFlag );
966+
myMessage = layer->loadSldStyle( myFileName, defaultLoadedFlag );
967967
}
968968
else
969969
{
@@ -991,7 +991,7 @@ void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
991991
QSettings myQSettings; // where we keep last used filter in persistent state
992992
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", "." ).toString();
993993
QString myOutputFileName = QFileDialog::getSaveFileName( this, tr( "Save layer properties as style file" ), myLastUsedDir,
994-
tr( "QGIS Layer Style File" ) + " (*.qml);;" + tr( "SLD File" ) + " (*.sld)" );
994+
tr( "QGIS Layer Style File" ) + " (*.qml);;" + tr( "SLD File" ) + " (*.sld)" );
995995
if ( myOutputFileName.isNull() ) //dialog canceled
996996
{
997997
return;
@@ -1006,7 +1006,7 @@ void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
10061006
if ( myOutputFileName.endsWith( ".sld", Qt::CaseInsensitive ) )
10071007
{
10081008
// convert to SLD
1009-
myMessage = layer->saveSldStyle( myOutputFileName, defaultLoadedFlag );
1009+
myMessage = layer->saveSldStyle( myOutputFileName, defaultLoadedFlag );
10101010
}
10111011
else
10121012
{

src/core/qgscoordinatereferencesystem.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ bool QgsCoordinateReferenceSystem::axisInverted() const
300300
OGRAxisOrientation orientation;
301301
const char *axis0 = OSRGetAxis( mCRS, mGeoFlag ? "GEOGCS" : "PROJCS", 0, &orientation );
302302
mAxisInverted = mGeoFlag
303-
? (orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other )
304-
: (orientation == OAO_North || orientation == OAO_South );
303+
? ( orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other )
304+
: ( orientation == OAO_North || orientation == OAO_South );
305305
QgsDebugMsg( QString( "srid:%1 axis0:%2 orientation:%3 inverted:%4" ).arg( mSRID ).arg( axis0 ).arg( OSRAxisEnumToName( orientation ) ).arg( mAxisInverted ) );
306306
}
307307

src/core/qgsexpression.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,11 @@ QgsExpression::Node* QgsExpression::Node::createFromOgcFilter( QDomElement &elem
664664
{
665665
return QgsExpression::NodeLiteral::createFromOgcFilter( element, errorMessage );
666666
}
667-
else if ( element.localName() == "Function")
667+
else if ( element.localName() == "Function" )
668668
{
669669
return QgsExpression::NodeFunction::createFromOgcFilter( element, errorMessage );
670670
}
671-
else if ( element.localName() == "PropertyName")
671+
else if ( element.localName() == "PropertyName" )
672672
{
673673
return QgsExpression::NodeColumnRef::createFromOgcFilter( element, errorMessage );
674674
}
@@ -826,11 +826,11 @@ QgsExpression::Node* QgsExpression::NodeUnaryOperator::createFromOgcFilter( QDom
826826
if ( !operand )
827827
{
828828
if ( errorMessage.isEmpty() )
829-
errorMessage = QString( "invalid operand for '%1' unary operator" ).arg( ogcOperatorName );
829+
errorMessage = QString( "invalid operand for '%1' unary operator" ).arg( ogcOperatorName );
830830
return NULL;
831831
}
832832

833-
return new QgsExpression::NodeUnaryOperator( ( UnaryOperator ) i, operand );
833+
return new QgsExpression::NodeUnaryOperator(( UnaryOperator ) i, operand );
834834
}
835835

836836
errorMessage = QString( "%1 unary operator not supported." ).arg( element.tagName() );
@@ -975,10 +975,10 @@ QVariant QgsExpression::NodeBinaryOperator::eval( QgsExpression* parent, QgsFeat
975975
matches = QRegExp( regexp ).indexIn( str ) != -1;
976976
}
977977

978-
if( mOp == boNotLike || mOp == boNotILike )
979-
{
980-
matches = !matches;
981-
}
978+
if ( mOp == boNotLike || mOp == boNotILike )
979+
{
980+
matches = !matches;
981+
}
982982

983983
return matches ? TVL_True : TVL_False;
984984
}
@@ -1085,8 +1085,8 @@ void QgsExpression::NodeBinaryOperator::toOgcFilter( QDomDocument &doc, QDomElem
10851085

10861086
element.appendChild( eqElem );
10871087
}
1088-
else if ( ( opLeftLiteral && opLeftLiteral->value().isNull() ) ||
1089-
( opRightLiteral && opRightLiteral->value().isNull() ) )
1088+
else if (( opLeftLiteral && opLeftLiteral->value().isNull() ) ||
1089+
( opRightLiteral && opRightLiteral->value().isNull() ) )
10901090
{
10911091
// at least one operand is NULL, use <ogc:PropertyIsNull> element
10921092
QDomElement isNullElem = doc.createElement( "ogc:PropertyIsNull" );
@@ -1186,7 +1186,7 @@ QgsExpression::Node* QgsExpression::NodeBinaryOperator::createFromOgcFilter( QDo
11861186
if ( !opLeft )
11871187
{
11881188
if ( errorMessage.isEmpty() )
1189-
errorMessage = QString( "invalid left operand for '%1' binary operator" ).arg( ogcOperatorName );
1189+
errorMessage = QString( "invalid left operand for '%1' binary operator" ).arg( ogcOperatorName );
11901190
break;
11911191
}
11921192

@@ -1195,11 +1195,11 @@ QgsExpression::Node* QgsExpression::NodeBinaryOperator::createFromOgcFilter( QDo
11951195
if ( !opRight )
11961196
{
11971197
if ( errorMessage.isEmpty() )
1198-
errorMessage = QString( "invalid right operand for '%1' binary operator" ).arg( ogcOperatorName );
1198+
errorMessage = QString( "invalid right operand for '%1' binary operator" ).arg( ogcOperatorName );
11991199
break;
12001200
}
12011201

1202-
return new QgsExpression::NodeBinaryOperator( ( BinaryOperator ) i, opLeft, opRight );
1202+
return new QgsExpression::NodeBinaryOperator(( BinaryOperator ) i, opLeft, opRight );
12031203
}
12041204

12051205
if ( !opLeft && !opRight )

src/core/raster/qgscolorrampshader.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bool QgsColorRampShader::discreteColor( double theValue, int* theReturnRedValue,
6565
myColorRampItem = mColorRampItemList.value( mCurrentColorRampItemIndex );
6666
myTinyDiff = qAbs( theValue - myColorRampItem.value );
6767
//If the previous entry is less, then search closer to the top of the list (assumes mColorRampItemList is sorted)
68-
if ( mCurrentColorRampItemIndex != 0 &&
68+
if ( mCurrentColorRampItemIndex != 0 &&
6969
theValue <= mColorRampItemList.at( mCurrentColorRampItemIndex - 1 ).value )
7070
{
7171
mCurrentColorRampItemIndex--;
@@ -121,8 +121,8 @@ bool QgsColorRampShader::exactColor( double theValue, int* theReturnRedValue, in
121121
}
122122
//pixel value sits between ramp entries so bail
123123
else if ( mCurrentColorRampItemIndex != myColorRampItemCount - 1 &&
124-
theValue > myColorRampItem.value && theValue < mColorRampItemList.at(
125-
mCurrentColorRampItemIndex + 1 ).value )
124+
theValue > myColorRampItem.value && theValue < mColorRampItemList.at(
125+
mCurrentColorRampItemIndex + 1 ).value )
126126
{
127127
return false;
128128
}
@@ -280,8 +280,8 @@ bool QgsColorRampShader::shade( double theValue, int* theReturnRedValue, int* th
280280
}
281281

282282
bool QgsColorRampShader::shade( double theRedValue, double theGreenValue,
283-
double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int*
284-
theReturnBlueValue )
283+
double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int*
284+
theReturnBlueValue )
285285
{
286286
Q_UNUSED( theRedValue );
287287
Q_UNUSED( theGreenValue );

src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ void QgsRendererCategoryV2::toSld( QDomDocument &doc, QDomElement &element, QgsS
9090
// create the ogc:Filter for the range
9191
QDomElement filterElem = doc.createElement( "ogc:Filter" );
9292
QString filterFunc = QString( "%1 = '%2'" )
93-
.arg( attrName.replace( "\"", "\"\"" ) )
94-
.arg( mValue.toString().replace( "'", "''" ) );
93+
.arg( attrName.replace( "\"", "\"\"" ) )
94+
.arg( mValue.toString().replace( "'", "''" ) );
9595
QgsSymbolLayerV2Utils::createFunctionElement( doc, filterElem, filterFunc );
9696
ruleElem.appendChild( filterElem );
9797

src/core/symbology-ng/qgsellipsesymbollayerv2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2::clone() const
191191
return QgsEllipseSymbolLayerV2::create( properties() );
192192
}
193193

194-
void QgsEllipseSymbolLayerV2::toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
194+
void QgsEllipseSymbolLayerV2::toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
195195
{
196196
QDomElement symbolizerElem = doc.createElement( "se:PointSymbolizer" );
197197
if ( !props.value( "uom", "" ).isEmpty() )
@@ -256,7 +256,7 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2::createFromSld( QDomElement &element )
256256
QgsDebugMsg( "Entered." );
257257

258258
QDomElement graphicElem = element.firstChildElement( "Graphic" );
259-
if( graphicElem.isNull() )
259+
if ( graphicElem.isNull() )
260260
return NULL;
261261

262262
QString name = "circle";

src/core/symbology-ng/qgsfillsymbollayerv2.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ QgsSymbolLayerV2* QgsSVGFillSymbolLayer::clone() const
440440
return clonedLayer;
441441
}
442442

443-
void QgsSVGFillSymbolLayer::toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
443+
void QgsSVGFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
444444
{
445445
QDomElement symbolizerElem = doc.createElement( "se:PolygonSymbolizer" );
446446
if ( !props.value( "uom", "" ).isEmpty() )
@@ -507,15 +507,15 @@ QgsSymbolLayerV2* QgsSVGFillSymbolLayer::createFromSld( QDomElement &element )
507507
double size, borderWidth;
508508

509509
QDomElement fillElem = element.firstChildElement( "Fill" );
510-
if( fillElem.isNull() )
510+
if ( fillElem.isNull() )
511511
return NULL;
512512

513513
QDomElement graphicFillElem = fillElem.firstChildElement( "GraphicFill" );
514-
if( graphicFillElem.isNull() )
514+
if ( graphicFillElem.isNull() )
515515
return NULL;
516516

517517
QDomElement graphicElem = graphicFillElem.firstChildElement( "Graphic" );
518-
if( graphicElem.isNull() )
518+
if ( graphicElem.isNull() )
519519
return NULL;
520520

521521
if ( !QgsSymbolLayerV2Utils::externalGraphicFromSld( graphicElem, path, mimeType, fillColor, size ) )
@@ -807,7 +807,7 @@ QgsSymbolLayerV2* QgsLinePatternFillSymbolLayer::clone() const
807807
return clonedLayer;
808808
}
809809

810-
void QgsLinePatternFillSymbolLayer::toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
810+
void QgsLinePatternFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
811811
{
812812
QDomElement symbolizerElem = doc.createElement( "se:PolygonSymbolizer" );
813813
if ( !props.value( "uom", "" ).isEmpty() )

src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ void QgsRendererRangeV2::toSld( QDomDocument &doc, QDomElement &element, QgsStri
120120
// create the ogc:Filter for the range
121121
QDomElement filterElem = doc.createElement( "ogc:Filter" );
122122
QString filterFunc = QString( "%1 > %2 AND %1 <= %3" )
123-
.arg( attrName.replace( "\"", "\"\"" ) )
124-
.arg( mLowerValue ).arg( mUpperValue );
123+
.arg( attrName.replace( "\"", "\"\"" ) )
124+
.arg( mLowerValue ).arg( mUpperValue );
125125
QgsSymbolLayerV2Utils::createFunctionElement( doc, filterElem, filterFunc );
126126

127127
mSymbol->toSld( doc, ruleElem, props );

src/core/symbology-ng/qgslinesymbollayerv2.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::createFromSld( QDomElement &elemen
197197
QVector<qreal> customDashVector;
198198

199199
if ( !QgsSymbolLayerV2Utils::lineFromSld( strokeElem, penStyle,
200-
color, width,
201-
&penJoinStyle, &penCapStyle,
202-
&customDashVector ) )
200+
color, width,
201+
&penJoinStyle, &penCapStyle,
202+
&customDashVector ) )
203203
return NULL;
204204

205205
double offset = 0.0;
@@ -661,7 +661,7 @@ void QgsMarkerLineSymbolLayerV2::toSld( QDomDocument &doc, QDomElement &element,
661661
QgsSymbolLayerV2Utils::createGeometryElement( doc, symbolizerElem, props.value( "geom", "" ) );
662662

663663
QString gap;
664-
switch( mPlacement )
664+
switch ( mPlacement )
665665
{
666666
case FirstVertex:
667667
symbolizerElem.appendChild( QgsSymbolLayerV2Utils::createVendorOptionElement( doc, "placement", "firstPoint" ) );
@@ -681,7 +681,7 @@ void QgsMarkerLineSymbolLayerV2::toSld( QDomDocument &doc, QDomElement &element,
681681
break;
682682
}
683683

684-
if( !mRotateMarker )
684+
if ( !mRotateMarker )
685685
{
686686
// markers in LineSymbolizer must be drawn following the line orientation,
687687
// use a VendorOption when no marker rotation

src/core/symbology-ng/qgsmarkersymbollayerv2.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ QgsSymbolLayerV2* QgsSimpleMarkerSymbolLayerV2::createFromSld( QDomElement &elem
461461
QgsDebugMsg( "Entered." );
462462

463463
QDomElement graphicElem = element.firstChildElement( "Graphic" );
464-
if( graphicElem.isNull() )
464+
if ( graphicElem.isNull() )
465465
return NULL;
466466

467467
QString name = "square";
@@ -723,7 +723,7 @@ QgsSymbolLayerV2* QgsSvgMarkerSymbolLayerV2::createFromSld( QDomElement &element
723723
QgsDebugMsg( "Entered." );
724724

725725
QDomElement graphicElem = element.firstChildElement( "Graphic" );
726-
if( graphicElem.isNull() )
726+
if ( graphicElem.isNull() )
727727
return NULL;
728728

729729
QString path, mimeType;
@@ -994,7 +994,7 @@ QgsSymbolLayerV2* QgsFontMarkerSymbolLayerV2::createFromSld( QDomElement &elemen
994994
QgsDebugMsg( "Entered." );
995995

996996
QDomElement graphicElem = element.firstChildElement( "Graphic" );
997-
if( graphicElem.isNull() )
997+
if ( graphicElem.isNull() )
998998
return NULL;
999999

10001000
QString name, format;

src/core/symbology-ng/qgsrendererv2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ QgsFeatureRendererV2* QgsFeatureRendererV2::loadSld( const QDomNode &node, QGis:
402402
int ruleCount = 0;
403403

404404
QDomElement ruleElem = featTypeStyleElem.firstChildElement( "Rule" );
405-
while( !ruleElem.isNull() )
405+
while ( !ruleElem.isNull() )
406406
{
407407
ruleCount++;
408408

@@ -415,7 +415,7 @@ QgsFeatureRendererV2* QgsFeatureRendererV2::loadSld( const QDomNode &node, QGis:
415415
}
416416

417417
QDomElement ruleChildElem = ruleElem.firstChildElement();
418-
while( !ruleChildElem.isNull() )
418+
while ( !ruleChildElem.isNull() )
419419
{
420420
// rule has filter or min/max scale denominator, use the RuleRenderer
421421
if ( ruleChildElem.localName() == "Filter" ||

src/core/symbology-ng/qgsrendererv2registry.h

+10-4
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,23 @@ class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetadata
6969
QgsRendererV2CreateFunc pfCreate,
7070
QIcon icon = QIcon(),
7171
QgsRendererV2WidgetFunc pfWidget = NULL )
72-
: QgsRendererV2AbstractMetadata( name, visibleName, icon ),
73-
mCreateFunc( pfCreate ), mWidgetFunc( pfWidget ), mCreateFromSldFunc( NULL ) {}
72+
: QgsRendererV2AbstractMetadata( name, visibleName, icon )
73+
, mCreateFunc( pfCreate )
74+
, mWidgetFunc( pfWidget )
75+
, mCreateFromSldFunc( NULL )
76+
{}
7477

7578
QgsRendererV2Metadata( QString name,
7679
QString visibleName,
7780
QgsRendererV2CreateFunc pfCreate,
7881
QgsRendererV2CreateFromSldFunc pfCreateFromSld,
7982
QIcon icon = QIcon(),
8083
QgsRendererV2WidgetFunc pfWidget = NULL )
81-
: QgsRendererV2AbstractMetadata( name, visibleName, icon ),
82-
mCreateFunc( pfCreate ), mWidgetFunc( pfWidget ), mCreateFromSldFunc( pfCreateFromSld ) {}
84+
: QgsRendererV2AbstractMetadata( name, visibleName, icon )
85+
, mCreateFunc( pfCreate )
86+
, mWidgetFunc( pfWidget )
87+
, mCreateFromSldFunc( pfCreateFromSld )
88+
{}
8389

8490
virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) { return mCreateFunc ? mCreateFunc( elem ) : NULL; }
8591
virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer )

src/core/symbology-ng/qgsrulebasedrendererv2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::createFromSld( QDomE
473473

474474
// retrieve the Rule element child nodes
475475
QDomElement childElem = ruleElem.firstChildElement();
476-
while( !childElem.isNull() )
476+
while ( !childElem.isNull() )
477477
{
478478
if ( childElem.localName() == "Name" )
479479
{
@@ -548,7 +548,7 @@ QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::createFromSld( QDomE
548548
QgsSymbolV2 *symbol = 0;
549549
if ( layers.size() > 0 )
550550
{
551-
switch( geomType )
551+
switch ( geomType )
552552
{
553553
case QGis::Line:
554554
symbol = new QgsLineSymbolV2( layers );

src/core/symbology-ng/qgssinglesymbolrendererv2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ QgsFeatureRendererV2* QgsSingleSymbolRendererV2::createFromSld( QDomElement& ele
242242

243243
// retrieve the Rule element child nodes
244244
QDomElement childElem = ruleElem.firstChildElement();
245-
while( !childElem.isNull() )
245+
while ( !childElem.isNull() )
246246
{
247247
if ( childElem.localName() == "Name" )
248248
{
@@ -265,7 +265,7 @@ QgsFeatureRendererV2* QgsSingleSymbolRendererV2::createFromSld( QDomElement& ele
265265
QgsSymbolV2 *symbol = 0;
266266
if ( layers.size() > 0 )
267267
{
268-
switch( geomType )
268+
switch ( geomType )
269269
{
270270
case QGis::Line:
271271
symbol = new QgsLineSymbolV2( layers );

0 commit comments

Comments
 (0)