Skip to content

Commit

Permalink
indentation update and a few unused parameter warnings fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 22, 2012
1 parent 8968496 commit f770aea
Show file tree
Hide file tree
Showing 19 changed files with 119 additions and 105 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolfeatureaction.cpp
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
8 changes: 4 additions & 4 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -951,7 +951,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
QSettings myQSettings; // where we keep last used filter in persistent state
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", "." ).toString();
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Load layer properties from style file" ), myLastUsedDir,
tr( "QGIS Layer Style File" ) + " (*.qml);;" + tr( "SLD File" ) + " (*.sld)" );
tr( "QGIS Layer Style File" ) + " (*.qml);;" + tr( "SLD File" ) + " (*.sld)" );
if ( myFileName.isNull() )
{
return;
Expand All @@ -963,7 +963,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
if ( myFileName.endsWith( ".sld", Qt::CaseInsensitive ) )
{
// load from SLD
myMessage = layer->loadSldStyle( myFileName, defaultLoadedFlag );
myMessage = layer->loadSldStyle( myFileName, defaultLoadedFlag );
}
else
{
Expand Down Expand Up @@ -991,7 +991,7 @@ void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
QSettings myQSettings; // where we keep last used filter in persistent state
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", "." ).toString();
QString myOutputFileName = QFileDialog::getSaveFileName( this, tr( "Save layer properties as style file" ), myLastUsedDir,
tr( "QGIS Layer Style File" ) + " (*.qml);;" + tr( "SLD File" ) + " (*.sld)" );
tr( "QGIS Layer Style File" ) + " (*.qml);;" + tr( "SLD File" ) + " (*.sld)" );
if ( myOutputFileName.isNull() ) //dialog canceled
{
return;
Expand All @@ -1006,7 +1006,7 @@ void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
if ( myOutputFileName.endsWith( ".sld", Qt::CaseInsensitive ) )
{
// convert to SLD
myMessage = layer->saveSldStyle( myOutputFileName, defaultLoadedFlag );
myMessage = layer->saveSldStyle( myOutputFileName, defaultLoadedFlag );
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -300,8 +300,8 @@ bool QgsCoordinateReferenceSystem::axisInverted() const
OGRAxisOrientation orientation;
const char *axis0 = OSRGetAxis( mCRS, mGeoFlag ? "GEOGCS" : "PROJCS", 0, &orientation );
mAxisInverted = mGeoFlag
? (orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other )
: (orientation == OAO_North || orientation == OAO_South );
? ( orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other )
: ( orientation == OAO_North || orientation == OAO_South );
QgsDebugMsg( QString( "srid:%1 axis0:%2 orientation:%3 inverted:%4" ).arg( mSRID ).arg( axis0 ).arg( OSRAxisEnumToName( orientation ) ).arg( mAxisInverted ) );
}

Expand Down
26 changes: 13 additions & 13 deletions src/core/qgsexpression.cpp
Expand Up @@ -664,11 +664,11 @@ QgsExpression::Node* QgsExpression::Node::createFromOgcFilter( QDomElement &elem
{
return QgsExpression::NodeLiteral::createFromOgcFilter( element, errorMessage );
}
else if ( element.localName() == "Function")
else if ( element.localName() == "Function" )
{
return QgsExpression::NodeFunction::createFromOgcFilter( element, errorMessage );
}
else if ( element.localName() == "PropertyName")
else if ( element.localName() == "PropertyName" )
{
return QgsExpression::NodeColumnRef::createFromOgcFilter( element, errorMessage );
}
Expand Down Expand Up @@ -826,11 +826,11 @@ QgsExpression::Node* QgsExpression::NodeUnaryOperator::createFromOgcFilter( QDom
if ( !operand )
{
if ( errorMessage.isEmpty() )
errorMessage = QString( "invalid operand for '%1' unary operator" ).arg( ogcOperatorName );
errorMessage = QString( "invalid operand for '%1' unary operator" ).arg( ogcOperatorName );
return NULL;
}

return new QgsExpression::NodeUnaryOperator( ( UnaryOperator ) i, operand );
return new QgsExpression::NodeUnaryOperator(( UnaryOperator ) i, operand );
}

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

if( mOp == boNotLike || mOp == boNotILike )
{
matches = !matches;
}
if ( mOp == boNotLike || mOp == boNotILike )
{
matches = !matches;
}

return matches ? TVL_True : TVL_False;
}
Expand Down Expand Up @@ -1085,8 +1085,8 @@ void QgsExpression::NodeBinaryOperator::toOgcFilter( QDomDocument &doc, QDomElem

element.appendChild( eqElem );
}
else if ( ( opLeftLiteral && opLeftLiteral->value().isNull() ) ||
( opRightLiteral && opRightLiteral->value().isNull() ) )
else if (( opLeftLiteral && opLeftLiteral->value().isNull() ) ||
( opRightLiteral && opRightLiteral->value().isNull() ) )
{
// at least one operand is NULL, use <ogc:PropertyIsNull> element
QDomElement isNullElem = doc.createElement( "ogc:PropertyIsNull" );
Expand Down Expand Up @@ -1186,7 +1186,7 @@ QgsExpression::Node* QgsExpression::NodeBinaryOperator::createFromOgcFilter( QDo
if ( !opLeft )
{
if ( errorMessage.isEmpty() )
errorMessage = QString( "invalid left operand for '%1' binary operator" ).arg( ogcOperatorName );
errorMessage = QString( "invalid left operand for '%1' binary operator" ).arg( ogcOperatorName );
break;
}

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

return new QgsExpression::NodeBinaryOperator( ( BinaryOperator ) i, opLeft, opRight );
return new QgsExpression::NodeBinaryOperator(( BinaryOperator ) i, opLeft, opRight );
}

if ( !opLeft && !opRight )
Expand Down
10 changes: 5 additions & 5 deletions src/core/raster/qgscolorrampshader.cpp
Expand Up @@ -65,7 +65,7 @@ bool QgsColorRampShader::discreteColor( double theValue, int* theReturnRedValue,
myColorRampItem = mColorRampItemList.value( mCurrentColorRampItemIndex );
myTinyDiff = qAbs( theValue - myColorRampItem.value );
//If the previous entry is less, then search closer to the top of the list (assumes mColorRampItemList is sorted)
if ( mCurrentColorRampItemIndex != 0 &&
if ( mCurrentColorRampItemIndex != 0 &&
theValue <= mColorRampItemList.at( mCurrentColorRampItemIndex - 1 ).value )
{
mCurrentColorRampItemIndex--;
Expand Down Expand Up @@ -121,8 +121,8 @@ bool QgsColorRampShader::exactColor( double theValue, int* theReturnRedValue, in
}
//pixel value sits between ramp entries so bail
else if ( mCurrentColorRampItemIndex != myColorRampItemCount - 1 &&
theValue > myColorRampItem.value && theValue < mColorRampItemList.at(
mCurrentColorRampItemIndex + 1 ).value )
theValue > myColorRampItem.value && theValue < mColorRampItemList.at(
mCurrentColorRampItemIndex + 1 ).value )
{
return false;
}
Expand Down Expand Up @@ -280,8 +280,8 @@ bool QgsColorRampShader::shade( double theValue, int* theReturnRedValue, int* th
}

bool QgsColorRampShader::shade( double theRedValue, double theGreenValue,
double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int*
theReturnBlueValue )
double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int*
theReturnBlueValue )
{
Q_UNUSED( theRedValue );
Q_UNUSED( theGreenValue );
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -90,8 +90,8 @@ void QgsRendererCategoryV2::toSld( QDomDocument &doc, QDomElement &element, QgsS
// create the ogc:Filter for the range
QDomElement filterElem = doc.createElement( "ogc:Filter" );
QString filterFunc = QString( "%1 = '%2'" )
.arg( attrName.replace( "\"", "\"\"" ) )
.arg( mValue.toString().replace( "'", "''" ) );
.arg( attrName.replace( "\"", "\"\"" ) )
.arg( mValue.toString().replace( "'", "''" ) );
QgsSymbolLayerV2Utils::createFunctionElement( doc, filterElem, filterFunc );
ruleElem.appendChild( filterElem );

Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsellipsesymbollayerv2.cpp
Expand Up @@ -191,7 +191,7 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2::clone() const
return QgsEllipseSymbolLayerV2::create( properties() );
}

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

QDomElement graphicElem = element.firstChildElement( "Graphic" );
if( graphicElem.isNull() )
if ( graphicElem.isNull() )
return NULL;

QString name = "circle";
Expand Down
10 changes: 5 additions & 5 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Expand Up @@ -440,7 +440,7 @@ QgsSymbolLayerV2* QgsSVGFillSymbolLayer::clone() const
return clonedLayer;
}

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

QDomElement fillElem = element.firstChildElement( "Fill" );
if( fillElem.isNull() )
if ( fillElem.isNull() )
return NULL;

QDomElement graphicFillElem = fillElem.firstChildElement( "GraphicFill" );
if( graphicFillElem.isNull() )
if ( graphicFillElem.isNull() )
return NULL;

QDomElement graphicElem = graphicFillElem.firstChildElement( "Graphic" );
if( graphicElem.isNull() )
if ( graphicElem.isNull() )
return NULL;

if ( !QgsSymbolLayerV2Utils::externalGraphicFromSld( graphicElem, path, mimeType, fillColor, size ) )
Expand Down Expand Up @@ -807,7 +807,7 @@ QgsSymbolLayerV2* QgsLinePatternFillSymbolLayer::clone() const
return clonedLayer;
}

void QgsLinePatternFillSymbolLayer::toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
void QgsLinePatternFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
{
QDomElement symbolizerElem = doc.createElement( "se:PolygonSymbolizer" );
if ( !props.value( "uom", "" ).isEmpty() )
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Expand Up @@ -120,8 +120,8 @@ void QgsRendererRangeV2::toSld( QDomDocument &doc, QDomElement &element, QgsStri
// create the ogc:Filter for the range
QDomElement filterElem = doc.createElement( "ogc:Filter" );
QString filterFunc = QString( "%1 > %2 AND %1 <= %3" )
.arg( attrName.replace( "\"", "\"\"" ) )
.arg( mLowerValue ).arg( mUpperValue );
.arg( attrName.replace( "\"", "\"\"" ) )
.arg( mLowerValue ).arg( mUpperValue );
QgsSymbolLayerV2Utils::createFunctionElement( doc, filterElem, filterFunc );

mSymbol->toSld( doc, ruleElem, props );
Expand Down
10 changes: 5 additions & 5 deletions src/core/symbology-ng/qgslinesymbollayerv2.cpp
Expand Up @@ -197,9 +197,9 @@ QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::createFromSld( QDomElement &elemen
QVector<qreal> customDashVector;

if ( !QgsSymbolLayerV2Utils::lineFromSld( strokeElem, penStyle,
color, width,
&penJoinStyle, &penCapStyle,
&customDashVector ) )
color, width,
&penJoinStyle, &penCapStyle,
&customDashVector ) )
return NULL;

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

QString gap;
switch( mPlacement )
switch ( mPlacement )
{
case FirstVertex:
symbolizerElem.appendChild( QgsSymbolLayerV2Utils::createVendorOptionElement( doc, "placement", "firstPoint" ) );
Expand All @@ -681,7 +681,7 @@ void QgsMarkerLineSymbolLayerV2::toSld( QDomDocument &doc, QDomElement &element,
break;
}

if( !mRotateMarker )
if ( !mRotateMarker )
{
// markers in LineSymbolizer must be drawn following the line orientation,
// use a VendorOption when no marker rotation
Expand Down
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Expand Up @@ -461,7 +461,7 @@ QgsSymbolLayerV2* QgsSimpleMarkerSymbolLayerV2::createFromSld( QDomElement &elem
QgsDebugMsg( "Entered." );

QDomElement graphicElem = element.firstChildElement( "Graphic" );
if( graphicElem.isNull() )
if ( graphicElem.isNull() )
return NULL;

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

QDomElement graphicElem = element.firstChildElement( "Graphic" );
if( graphicElem.isNull() )
if ( graphicElem.isNull() )
return NULL;

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

QDomElement graphicElem = element.firstChildElement( "Graphic" );
if( graphicElem.isNull() )
if ( graphicElem.isNull() )
return NULL;

QString name, format;
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsrendererv2.cpp
Expand Up @@ -402,7 +402,7 @@ QgsFeatureRendererV2* QgsFeatureRendererV2::loadSld( const QDomNode &node, QGis:
int ruleCount = 0;

QDomElement ruleElem = featTypeStyleElem.firstChildElement( "Rule" );
while( !ruleElem.isNull() )
while ( !ruleElem.isNull() )
{
ruleCount++;

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

QDomElement ruleChildElem = ruleElem.firstChildElement();
while( !ruleChildElem.isNull() )
while ( !ruleChildElem.isNull() )
{
// rule has filter or min/max scale denominator, use the RuleRenderer
if ( ruleChildElem.localName() == "Filter" ||
Expand Down
14 changes: 10 additions & 4 deletions src/core/symbology-ng/qgsrendererv2registry.h
Expand Up @@ -69,17 +69,23 @@ class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetadata
QgsRendererV2CreateFunc pfCreate,
QIcon icon = QIcon(),
QgsRendererV2WidgetFunc pfWidget = NULL )
: QgsRendererV2AbstractMetadata( name, visibleName, icon ),
mCreateFunc( pfCreate ), mWidgetFunc( pfWidget ), mCreateFromSldFunc( NULL ) {}
: QgsRendererV2AbstractMetadata( name, visibleName, icon )
, mCreateFunc( pfCreate )
, mWidgetFunc( pfWidget )
, mCreateFromSldFunc( NULL )
{}

QgsRendererV2Metadata( QString name,
QString visibleName,
QgsRendererV2CreateFunc pfCreate,
QgsRendererV2CreateFromSldFunc pfCreateFromSld,
QIcon icon = QIcon(),
QgsRendererV2WidgetFunc pfWidget = NULL )
: QgsRendererV2AbstractMetadata( name, visibleName, icon ),
mCreateFunc( pfCreate ), mWidgetFunc( pfWidget ), mCreateFromSldFunc( pfCreateFromSld ) {}
: QgsRendererV2AbstractMetadata( name, visibleName, icon )
, mCreateFunc( pfCreate )
, mWidgetFunc( pfWidget )
, mCreateFromSldFunc( pfCreateFromSld )
{}

virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) { return mCreateFunc ? mCreateFunc( elem ) : NULL; }
virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer )
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Expand Up @@ -473,7 +473,7 @@ QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::createFromSld( QDomE

// retrieve the Rule element child nodes
QDomElement childElem = ruleElem.firstChildElement();
while( !childElem.isNull() )
while ( !childElem.isNull() )
{
if ( childElem.localName() == "Name" )
{
Expand Down Expand Up @@ -548,7 +548,7 @@ QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::createFromSld( QDomE
QgsSymbolV2 *symbol = 0;
if ( layers.size() > 0 )
{
switch( geomType )
switch ( geomType )
{
case QGis::Line:
symbol = new QgsLineSymbolV2( layers );
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
Expand Up @@ -242,7 +242,7 @@ QgsFeatureRendererV2* QgsSingleSymbolRendererV2::createFromSld( QDomElement& ele

// retrieve the Rule element child nodes
QDomElement childElem = ruleElem.firstChildElement();
while( !childElem.isNull() )
while ( !childElem.isNull() )
{
if ( childElem.localName() == "Name" )
{
Expand All @@ -265,7 +265,7 @@ QgsFeatureRendererV2* QgsSingleSymbolRendererV2::createFromSld( QDomElement& ele
QgsSymbolV2 *symbol = 0;
if ( layers.size() > 0 )
{
switch( geomType )
switch ( geomType )
{
case QGis::Line:
symbol = new QgsLineSymbolV2( layers );
Expand Down

0 comments on commit f770aea

Please sign in to comment.