4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ void QgsSVGFillSymbolLayer::startRender( QgsSymbolV2RenderContext& context )
double outlineWidth = 1;
int size = context.outputPixelSize( mPatternWidth );
const QImage& patternImage = QgsSvgCache::instance()->svgAsImage( mSvgFilePath, size, fillColor, outlineColor, outlineWidth,
context.renderContext().scaleFactor(), context.renderContext().rasterScaleFactor() );
context.renderContext().scaleFactor(), context.renderContext().rasterScaleFactor() );
QTransform brushTransform;
brushTransform.scale( 1.0 / context.renderContext().rasterScaleFactor(), 1.0 / context.renderContext().rasterScaleFactor() );
if( !doubleNear( context.alpha(), 1.0 ) )
if ( !doubleNear( context.alpha(), 1.0 ) )
{
QImage transparentImage = patternImage.copy();
QgsSymbolLayerV2Utils::multiplyImageOpacity( &transparentImage, context.alpha() );
Expand Down
20 changes: 10 additions & 10 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,21 +472,21 @@ QgsSymbolLayerV2* QgsSvgMarkerSymbolLayerV2::create( const QgsStringMap& props )
QgsSvgMarkerSymbolLayerV2* m = new QgsSvgMarkerSymbolLayerV2( name, size, angle );

//we only check the svg default parameters if necessary, since it could be expensive
if( !props.contains("fill") && !props.contains("outline") && !props.contains("outline-width") )
if ( !props.contains( "fill" ) && !props.contains( "outline" ) && !props.contains( "outline-width" ) )
{
QColor fillColor, outlineColor;
double outlineWidth;
bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
QgsSvgCache::instance()->containsParams( name, hasFillParam, fillColor, hasOutlineParam, outlineColor, hasOutlineWidthParam, outlineWidth );
if( hasFillParam )
if ( hasFillParam )
{
m->setFillColor( fillColor );
}
if( hasOutlineParam )
if ( hasOutlineParam )
{
m->setOutlineColor( outlineColor );
}
if( hasOutlineWidthParam )
if ( hasOutlineWidthParam )
{
m->setOutlineWidth( outlineWidth );
}
Expand All @@ -510,15 +510,15 @@ void QgsSvgMarkerSymbolLayerV2::setPath( QString path )
double outlineWidth;
bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
QgsSvgCache::instance()->containsParams( path, hasFillParam, fillColor, hasOutlineParam, outlineColor, hasOutlineWidthParam, outlineWidth );
if( hasFillParam )
if ( hasFillParam )
{
setFillColor( fillColor );
}
if( hasOutlineParam )
if ( hasOutlineParam )
{
setOutlineColor( outlineColor );
}
if( hasOutlineWidthParam )
if ( hasOutlineWidthParam )
{
setOutlineWidth( outlineWidth );
}
Expand Down Expand Up @@ -555,7 +555,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
outputOffset = _rotatedOffset( outputOffset, mAngle );
p->translate( point + outputOffset );

int size = (int)( context.outputLineWidth( mSize ) );
int size = ( int )( context.outputLineWidth( mSize ) );

if ( mAngle != 0 )
p->rotate( mAngle );
Expand All @@ -565,7 +565,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
const QImage& img = QgsSvgCache::instance()->svgAsImage( mPath, size, mFillColor, mOutlineColor, mOutlineWidth,
context.renderContext().scaleFactor(), context.renderContext().rasterScaleFactor() );
//consider transparency
if( !doubleNear( context.alpha(), 1.0 ) )
if ( !doubleNear( context.alpha(), 1.0 ) )
{
QImage transparentImage = img.copy();
QgsSymbolLayerV2Utils::multiplyImageOpacity( &transparentImage, context.alpha() );
Expand All @@ -584,7 +584,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
p->drawPicture( 0, 0, pct );
}

if( context.selected() )
if ( context.selected() )
{
QPen pen( context.selectionColor() );
pen.setWidth( context.outputLineWidth( 1.0 ) );
Expand Down
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgssvgcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ QgsSvgCacheEntry* QgsSvgCache::cacheEntry( const QString& file, int size, const
else
{
takeEntryFromList( currentEntry );
if( !mMostRecentEntry ) //list is empty
if ( !mMostRecentEntry ) //list is empty
{
mMostRecentEntry = currentEntry;
mLeastRecentEntry = currentEntry;
Expand Down Expand Up @@ -342,9 +342,9 @@ void QgsSvgCache::replaceElemParams( QDomElement& elem, const QColor& fill, cons
value = QString::number( outlineWidth );
}

if( entryIt != entryList.constBegin() )
if ( entryIt != entryList.constBegin() )
{
newAttributeString.append(";");
newAttributeString.append( ";" );
}
newAttributeString.append( key + ":" + value );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgssymbollayerv2widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ void QgsSvgMarkerSymbolLayerV2Widget::populateList()

void QgsSvgMarkerSymbolLayerV2Widget::setGuiForSvg( const QgsSvgMarkerSymbolLayerV2* layer )
{
if( !layer )
if ( !layer )
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgsconfigcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ QgsConfigParser* QgsConfigCache::insertConfiguration( const QString& filePath )
if ( !configDoc->setContent( configFile, true, &errorMsg, &line, &column ) )
{
QgsDebugMsg( QString( "Parse error %1 at row %2, column %3 in %4 " )
.arg( errorMsg ).arg( line ).arg( column ).arg( filePath ) );
.arg( errorMsg ).arg( line ).arg( column ).arg( filePath ) );
delete configFile;
delete configDoc;
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/mapserver/qgspostrequesthandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ QgsPostRequestHandler::~QgsPostRequestHandler()

std::map<QString, QString> QgsPostRequestHandler::parseInput()
{
QgsDebugMsg("QgsPostRequestHandler::parseInput");
QgsDebugMsg( "QgsPostRequestHandler::parseInput" );
std::map<QString, QString> parameters;
QString inputString = readPostBody();
QgsDebugMsg(inputString);
QgsDebugMsg( inputString );
requestStringToParameterMap( inputString, parameters );
return parameters;
}
6 changes: 4 additions & 2 deletions src/plugins/roadgraph/linevectorlayerdirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ void RgLineVectorLayerDirector::makeGraph( RgGraphBuilder *builder, const QVecto
if ( feature.geometry()->wkbType() == QGis::WKBLineString )
{
mpl.push_back( feature.geometry()->asPolyline() );
}else if ( feature.geometry()->wkbType() == QGis::WKBMultiLineString )
}
else if ( feature.geometry()->wkbType() == QGis::WKBMultiLineString )
{
mpl = feature.geometry()->asMultiPolyline();
}
Expand Down Expand Up @@ -214,7 +215,8 @@ void RgLineVectorLayerDirector::makeGraph( RgGraphBuilder *builder, const QVecto
if ( feature.geometry()->wkbType() == QGis::WKBLineString )
{
mpl.push_back( feature.geometry()->asPolyline() );
}else if ( feature.geometry()->wkbType() == QGis::WKBMultiLineString )
}
else if ( feature.geometry()->wkbType() == QGis::WKBMultiLineString )
{
mpl = feature.geometry()->asMultiPolyline();
}
Expand Down
40 changes: 20 additions & 20 deletions src/plugins/zonal_statistics/qgszonalstatisticsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"

QgsZonalStatisticsDialog::QgsZonalStatisticsDialog(QgisInterface* iface): QDialog(), mIface(iface)
QgsZonalStatisticsDialog::QgsZonalStatisticsDialog( QgisInterface* iface ): QDialog(), mIface( iface )
{
setupUi(this);
setupUi( this );
insertAvailableLayers();
mColumnPrefixLineEdit->setText(proposeAttributePrefix());
mColumnPrefixLineEdit->setText( proposeAttributePrefix() );
}

QgsZonalStatisticsDialog::QgsZonalStatisticsDialog(): QDialog(0), mIface(0)
QgsZonalStatisticsDialog::QgsZonalStatisticsDialog(): QDialog( 0 ), mIface( 0 )
{
setupUi(this);
setupUi( this );
}

QgsZonalStatisticsDialog::~QgsZonalStatisticsDialog()
Expand All @@ -55,7 +55,7 @@ void QgsZonalStatisticsDialog::insertAvailableLayers()
else
{
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( layer_it.value() );
if(vl && vl->geometryType() == QGis::Polygon)
if ( vl && vl->geometryType() == QGis::Polygon )
{
mPolygonLayerComboBox->addItem( vl->name(), QVariant( vl->id() ) );
}
Expand All @@ -76,11 +76,11 @@ QString QgsZonalStatisticsDialog::rasterFilePath() const
QgsVectorLayer* QgsZonalStatisticsDialog::polygonLayer() const
{
int index = mPolygonLayerComboBox->currentIndex();
if(index == -1)
if ( index == -1 )
{
return 0;
}
return dynamic_cast<QgsVectorLayer*>(QgsMapLayerRegistry::instance()->mapLayer(mPolygonLayerComboBox->itemData( index ).toString()));
return dynamic_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( mPolygonLayerComboBox->itemData( index ).toString() ) );
}

QString QgsZonalStatisticsDialog::attributePrefix() const
Expand All @@ -90,28 +90,28 @@ QString QgsZonalStatisticsDialog::attributePrefix() const

QString QgsZonalStatisticsDialog::proposeAttributePrefix() const
{
if(!polygonLayer())
if ( !polygonLayer() )
{
return "";
}

QString proposedPrefix = "";
while(!prefixIsValid(proposedPrefix))
while ( !prefixIsValid( proposedPrefix ) )
{
proposedPrefix.prepend("_");
proposedPrefix.prepend( "_" );
}
return proposedPrefix;
}

bool QgsZonalStatisticsDialog::prefixIsValid(const QString& prefix) const
bool QgsZonalStatisticsDialog::prefixIsValid( const QString& prefix ) const
{
QgsVectorLayer* vl = polygonLayer();
if(!vl)
if ( !vl )
{
return false;
}
QgsVectorDataProvider* dp = vl->dataProvider();
if(!dp)
if ( !dp )
{
return false;
}
Expand All @@ -120,13 +120,13 @@ bool QgsZonalStatisticsDialog::prefixIsValid(const QString& prefix) const
QgsFieldMap::const_iterator it = providerFieldMap.constBegin();
QString currentFieldName;

for(; it != providerFieldMap.constEnd(); ++it)
for ( ; it != providerFieldMap.constEnd(); ++it )
{
currentFieldName = it.value().name();
if ( currentFieldName == ( prefix + "mean" ) || currentFieldName == ( prefix + "sum" ) || currentFieldName == ( prefix + "count" ) )
{
currentFieldName = it.value().name();
if(currentFieldName == (prefix + "mean") || currentFieldName == (prefix + "sum") || currentFieldName == (prefix + "count") )
{
return false;
}
return false;
}
}
return true;
}
6 changes: 3 additions & 3 deletions src/plugins/zonal_statistics/qgszonalstatisticsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class QgsVectorLayer;

class QgsZonalStatisticsDialog: public QDialog, private Ui::QgsZonalStatisticsDialogBase
{
Q_OBJECT
Q_OBJECT
public:
QgsZonalStatisticsDialog(QgisInterface* iface);
QgsZonalStatisticsDialog( QgisInterface* iface );
~QgsZonalStatisticsDialog();

QString rasterFilePath() const;
Expand All @@ -42,7 +42,7 @@ class QgsZonalStatisticsDialog: public QDialog, private Ui::QgsZonalStatisticsDi
/**Propose a valid prefix for the attributes*/
QString proposeAttributePrefix() const;
/**Check if a prefix can be used for the count, sum and mean attribute*/
bool prefixIsValid(const QString& prefix) const;
bool prefixIsValid( const QString& prefix ) const;

QgisInterface* mIface;
};
Expand Down
16 changes: 8 additions & 8 deletions src/plugins/zonal_statistics/qgszonalstatisticsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const QString name_ = QObject::tr( "Zonal statistics plugin" );
static const QString description_ = QObject::tr( "A plugin to calculate count, sum, mean of rasters for each polygon of a vector layer" );
static const QString version_ = QObject::tr( "Version 0.1" );

QgsZonalStatisticsPlugin::QgsZonalStatisticsPlugin( QgisInterface* iface ): mIface(iface), mAction(0)
QgsZonalStatisticsPlugin::QgsZonalStatisticsPlugin( QgisInterface* iface ): mIface( iface ), mAction( 0 )
{

}
Expand All @@ -52,23 +52,23 @@ void QgsZonalStatisticsPlugin::unload()

void QgsZonalStatisticsPlugin::run()
{
QgsZonalStatisticsDialog d(mIface);
if(d.exec() == QDialog::Rejected)
QgsZonalStatisticsDialog d( mIface );
if ( d.exec() == QDialog::Rejected )
{
return;
}

QString rasterFile = d.rasterFilePath();
QgsVectorLayer* vl = d.polygonLayer();
if(!vl)
if ( !vl )
{
return;
}

QgsZonalStatistics zs(vl, rasterFile, d.attributePrefix(), 1); //atm hardcode first band
QProgressDialog p(tr("Calculating zonal statistics..."), tr("Abort..."), 0, 0);
p.setWindowModality(Qt::WindowModal);
zs.calculateStatistics(&p);
QgsZonalStatistics zs( vl, rasterFile, d.attributePrefix(), 1 ); //atm hardcode first band
QProgressDialog p( tr( "Calculating zonal statistics..." ), tr( "Abort..." ), 0, 0 );
p.setWindowModality( Qt::WindowModal );
zs.calculateStatistics( &p );
}

//global methods for the plugin manager
Expand Down
14 changes: 7 additions & 7 deletions src/plugins/zonal_statistics/qgszonalstatisticsplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ class QAction;

class QgsZonalStatisticsPlugin: public QObject, public QgisPlugin
{
Q_OBJECT
Q_OBJECT
public:
QgsZonalStatisticsPlugin( QgisInterface* iface );
~QgsZonalStatisticsPlugin();
QgsZonalStatisticsPlugin( QgisInterface* iface );
~QgsZonalStatisticsPlugin();

/**initialize connection to GUI*/
void initGui();
/**Unload the plugin and cleanup the GUI*/
void unload();
/**initialize connection to GUI*/
void initGui();
/**Unload the plugin and cleanup the GUI*/
void unload();

private slots:
/**Select input file, output file, format and analysis method*/
Expand Down
16 changes: 8 additions & 8 deletions src/providers/spatialite/qgsspatialiteprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ bool QgsSpatiaLiteProvider::nextFeature( QgsFeature & feature )
}

bool QgsSpatiaLiteProvider::getFeature( sqlite3_stmt *stmt, bool fetchGeometry,
QgsFeature &feature,
const QgsAttributeList &fetchAttributes)
QgsFeature &feature,
const QgsAttributeList &fetchAttributes )
{
int ret = sqlite3_step( stmt );
if ( ret == SQLITE_DONE )
Expand Down Expand Up @@ -3856,7 +3856,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
sqlite3_free_table( results );
}
else if ( mQuery.startsWith( "(select", Qt::CaseInsensitive ) &&
mQuery.endsWith( ")" ) )
mQuery.endsWith( ")" ) )
{
// checking if this one is a select query

Expand Down Expand Up @@ -3898,11 +3898,11 @@ bool QgsSpatiaLiteProvider::checkLayerType()
{
// checking if this one is a Table-based layer
sql = QString( "SELECT read_only FROM geometry_columns "
"LEFT JOIN geometry_columns_auth "
"USING (f_table_name, f_geometry_column) "
"WHERE f_table_name=%1 and f_geometry_column=%2" )
.arg( quotedValue( mTableName ) )
.arg( quotedValue( mGeometryColumn ) );
"LEFT JOIN geometry_columns_auth "
"USING (f_table_name, f_geometry_column) "
"WHERE f_table_name=%1 and f_geometry_column=%2" )
.arg( quotedValue( mTableName ) )
.arg( quotedValue( mGeometryColumn ) );

ret = sqlite3_get_table( sqliteHandle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg );
if ( ret != SQLITE_OK )
Expand Down
10 changes: 5 additions & 5 deletions src/providers/spatialite/qgsspatialiteprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,12 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
bool getSridDetails();
bool getTableSummary();
bool prepareStatement( sqlite3_stmt *&stmt,
const QgsAttributeList &fetchAttributes,
bool fetchGeometry,
QString whereClause );
const QgsAttributeList &fetchAttributes,
bool fetchGeometry,
QString whereClause );
bool getFeature( sqlite3_stmt *stmt, bool fetchGeometry,
QgsFeature &feature,
const QgsAttributeList &fetchAttributes );
QgsFeature &feature,
const QgsAttributeList &fetchAttributes );
void convertToGeosWKB( const unsigned char *blob, size_t blob_size,
unsigned char **wkb, size_t *geom_size );
int computeSizeFromMultiWKB2D( const unsigned char *p_in, int nDims,
Expand Down