Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
indentation update
  • Loading branch information
jef-n committed Sep 26, 2014
1 parent bfb7569 commit d8cc79a
Show file tree
Hide file tree
Showing 38 changed files with 260 additions and 263 deletions.
22 changes: 11 additions & 11 deletions src/analysis/vector/qgsgeometryanalyzer.cpp
Expand Up @@ -1108,29 +1108,29 @@ bool QgsGeometryAnalyzer::createOffsetGeometry( QgsGeometry* geom, QgsGeometry*
//geos 3.3 needed for line offsets
#if defined(GEOS_VERSION_MAJOR) && defined(GEOS_VERSION_MINOR) && \
((GEOS_VERSION_MAJOR>3) || ((GEOS_VERSION_MAJOR==3) && (GEOS_VERSION_MINOR>=3)))
GEOSGeometry* offsetGeom = GEOSOffsetCurve_r(geosctxt, ( *inputGeomIt )->asGeos(), -offset, 8 /*quadSegments*/, 0 /*joinStyle*/, 5.0 /*mitreLimit*/ );
if ( !offsetGeom || !GEOSisValid_r(geosctxt, offsetGeom ) )
GEOSGeometry* offsetGeom = GEOSOffsetCurve_r( geosctxt, ( *inputGeomIt )->asGeos(), -offset, 8 /*quadSegments*/, 0 /*joinStyle*/, 5.0 /*mitreLimit*/ );
if ( !offsetGeom || !GEOSisValid_r( geosctxt, offsetGeom ) )
{
return false;
}
if ( !GEOSisValid_r(geosctxt, offsetGeom ) || GEOSGeomTypeId_r(geosctxt, offsetGeom ) != GEOS_LINESTRING || GEOSGeomGetNumPoints_r(geosctxt, offsetGeom ) < 1 )
if ( !GEOSisValid_r( geosctxt, offsetGeom ) || GEOSGeomTypeId_r( geosctxt, offsetGeom ) != GEOS_LINESTRING || GEOSGeomGetNumPoints_r( geosctxt, offsetGeom ) < 1 )
{
GEOSGeom_destroy_r(geosctxt, offsetGeom );
GEOSGeom_destroy_r( geosctxt, offsetGeom );
return false;
}
outputGeomList.push_back( offsetGeom );
#else
outputGeomList.push_back( GEOSGeom_clone_r(geosctxt, ( *inputGeomIt )->asGeos() ) );
outputGeomList.push_back( GEOSGeom_clone_r( geosctxt, ( *inputGeomIt )->asGeos() ) );
#endif
}
else if ( geom->type() == QGis::Point )
{
QgsPoint p = ( *inputGeomIt )->asPoint();
p = createPointOffset( p.x(), p.y(), offset, lineGeom );
GEOSCoordSequence* ptSeq = GEOSCoordSeq_create_r(geosctxt, 1, 2 );
GEOSCoordSeq_setX_r(geosctxt, ptSeq, 0, p.x() );
GEOSCoordSeq_setY_r(geosctxt, ptSeq, 0, p.y() );
GEOSGeometry* geosPt = GEOSGeom_createPoint_r(geosctxt, ptSeq );
GEOSCoordSequence* ptSeq = GEOSCoordSeq_create_r( geosctxt, 1, 2 );
GEOSCoordSeq_setX_r( geosctxt, ptSeq, 0, p.x() );
GEOSCoordSeq_setY_r( geosctxt, ptSeq, 0, p.y() );
GEOSGeometry* geosPt = GEOSGeom_createPoint_r( geosctxt, ptSeq );
outputGeomList.push_back( geosPt );
}
}
Expand All @@ -1153,11 +1153,11 @@ bool QgsGeometryAnalyzer::createOffsetGeometry( QgsGeometry* geom, QgsGeometry*
GEOSGeometry* collection = 0;
if ( geom->type() == QGis::Point )
{
collection = GEOSGeom_createCollection_r(geosctxt, GEOS_MULTIPOINT, geomArray, outputGeomList.size() );
collection = GEOSGeom_createCollection_r( geosctxt, GEOS_MULTIPOINT, geomArray, outputGeomList.size() );
}
else if ( geom->type() == QGis::Line )
{
collection = GEOSGeom_createCollection_r(geosctxt, GEOS_MULTILINESTRING, geomArray, outputGeomList.size() );
collection = GEOSGeom_createCollection_r( geosctxt, GEOS_MULTILINESTRING, geomArray, outputGeomList.size() );
}
geom->fromGeos( collection );
delete[] geomArray;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -9762,7 +9762,7 @@ void QgisApp::writeProject( QDomDocument &doc )
delete clonedRoot;
doc.firstChildElement( "qgis" ).appendChild( oldLegendElem );

QgsProject::instance()->writeEntry( "Legend", "filterByMap", (bool) layerTreeView()->layerTreeModel()->legendFilterByMap() );
QgsProject::instance()->writeEntry( "Legend", "filterByMap", ( bool ) layerTreeView()->layerTreeModel()->legendFilterByMap() );

projectChanged( doc );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsattributeactiondialog.cpp
Expand Up @@ -62,7 +62,7 @@ QgsAttributeActionDialog::QgsAttributeActionDialog( QgsAttributeAction* actions,
connect( insertFieldButton, SIGNAL( clicked() ), this, SLOT( insertField() ) );
connect( insertExpressionButton, SIGNAL( clicked() ), this, SLOT( insertExpression() ) );

connect( chooseIconButton, SIGNAL(clicked()), this, SLOT( chooseIcon() ) );
connect( chooseIconButton, SIGNAL( clicked() ), this, SLOT( chooseIcon() ) );

init();
// Populate the combo box with the field names. Will the field names
Expand Down Expand Up @@ -312,7 +312,7 @@ void QgsAttributeActionDialog::chooseIcon()
{
QList<QByteArray> list = QImageWriter::supportedImageFormats();
QStringList formatList;
Q_FOREACH( const QByteArray& format, list )
Q_FOREACH ( const QByteArray& format, list )
formatList << QString( "*.%1" ).arg( QString( format ) );

QString filter = QString( "Images( %1 ); All( *.* )" ).arg( formatList.join( " " ) );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributeactiondialog.h
Expand Up @@ -62,7 +62,7 @@ class APP_EXPORT QgsAttributeActionDialog: public QWidget, private Ui::QgsAttrib

private:

void insertRow(int row, QgsAction::ActionType type, const QString &name, const QString &action, const QString& iconPath, bool capture );
void insertRow( int row, QgsAction::ActionType type, const QString &name, const QString &action, const QString& iconPath, bool capture );
void swapRows( int row1, int row2 );

void insert( int pos );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolrotatepointsymbols.cpp
Expand Up @@ -109,7 +109,7 @@ void QgsMapToolRotatePointSymbols::canvasPressEvent( QMouseEvent *e )

if ( mCurrentRotationAttributes.size() < 1 )
{
emit messageEmitted( tr( "The active point layer does not have a rotation attribute." ), QgsMessageBar::CRITICAL );
emit messageEmitted( tr( "The active point layer does not have a rotation attribute." ), QgsMessageBar::CRITICAL );
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposermapitem.cpp
Expand Up @@ -19,7 +19,7 @@
#include "qgscomposermap.h"
#include <QUuid>

QgsComposerMapItem::QgsComposerMapItem(const QString &name, QgsComposerMap *map )
QgsComposerMapItem::QgsComposerMapItem( const QString &name, QgsComposerMap *map )
: QgsComposerObject( map->composition() )
, mName( name )
, mComposerMap( map )
Expand Down
12 changes: 6 additions & 6 deletions src/core/layertree/qgslayertreegroup.cpp
Expand Up @@ -120,17 +120,17 @@ void QgsLayerTreeGroup::removeChildren( int from, int count )
}

void QgsLayerTreeGroup::removeChildrenGroupWithoutLayers()
{
{
// clean the layer tree by removing empty group
foreach ( QgsLayerTreeNode* treeNode, children() )
{
if ( treeNode->nodeType() == QgsLayerTreeNode::NodeGroup )
{
QgsLayerTreeGroup* treeGroup = qobject_cast<QgsLayerTreeGroup*>( treeNode );
if ( treeGroup->findLayerIds().count() == 0 )
removeChildNode( treeNode );
else
treeGroup->removeChildrenGroupWithoutLayers();
QgsLayerTreeGroup* treeGroup = qobject_cast<QgsLayerTreeGroup*>( treeNode );
if ( treeGroup->findLayerIds().count() == 0 )
removeChildNode( treeNode );
else
treeGroup->removeChildrenGroupWithoutLayers();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/layertree/qgslayertreemodel.cpp
Expand Up @@ -96,7 +96,7 @@ int QgsLayerTreeModel::rowCount( const QModelIndex &parent ) const

if ( QgsLayerTree::isLayer( n ) )
{
if( !testFlag( ShowLegend ) )
if ( !testFlag( ShowLegend ) )
return 0;

QgsLayerTreeLayer* nL = QgsLayerTree::toLayer( n );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsattributeaction.cpp
Expand Up @@ -45,7 +45,7 @@ void QgsAttributeAction::addAction( QgsAction::ActionType type, QString name, QS
mActions << QgsAction( type, name, action, capture );
}

void QgsAttributeAction::addAction(QgsAction::ActionType type, QString name, QString action, const QString& icon, bool capture)
void QgsAttributeAction::addAction( QgsAction::ActionType type, QString name, QString action, const QString& icon, bool capture )
{
mActions << QgsAction( type, name, action, icon, capture );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsattributeaction.h
Expand Up @@ -126,7 +126,7 @@ class CORE_EXPORT QgsAttributeAction
* any stdout from the process will be captured and displayed in a
* dialog box.
*/
void addAction(QgsAction::ActionType type, QString name, QString action, const QString& icon, bool capture = false );
void addAction( QgsAction::ActionType type, QString name, QString action, const QString& icon, bool capture = false );

//! Remove an action at given index
void removeAction( int index );
Expand Down
4 changes: 0 additions & 4 deletions src/core/qgsconnectionpool.h
Expand Up @@ -206,18 +206,14 @@ class QgsConnectionPool
//! @return initialized connection or null on error
T acquireConnection( const QString& connInfo )
{
QgsDebugMsg( QString( "Lock mutex 0x%1" ).arg( (qint64) &mMutex, 0, 16 ) );
mMutex.lock();
QgsDebugMsg( QString( "Unlock mutex 0x%1" ).arg( (qint64) &mMutex, 0, 16 ) );
typename T_Groups::iterator it = mGroups.find( connInfo );
if ( it == mGroups.end() )
{
it = mGroups.insert( connInfo, new T_Group( connInfo ) );
}
T_Group* group = *it;
QgsDebugMsg( QString( "Unlock mutex 0x%1" ).arg( (qint64) &mMutex, 0, 16 ) );
mMutex.unlock();
QgsDebugMsg( QString( "Unlocked mutex 0x%1" ).arg( (qint64) &mMutex, 0, 16 ) );

return group->acquire();
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsfield.h
Expand Up @@ -246,7 +246,7 @@ class CORE_EXPORT QgsFields
//! @note added in 2.6
bool operator==( const QgsFields& other ) const { return mFields == other.mFields; }
//! @note added in 2.6
bool operator!=( const QgsFields& other ) const { return ! ( *this == other ); }
bool operator!=( const QgsFields& other ) const { return !( *this == other ); }

protected:
//! internal storage of the container
Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsgeometry.cpp
Expand Up @@ -129,15 +129,15 @@ class GEOSInit

~GEOSInit()
{
finishGEOS_r(ctxt);
finishGEOS_r( ctxt );
}
};

static GEOSInit geosinit;

GEOSContextHandle_t QgsGeometry::getGEOSHandler()
{
return geosinit.ctxt;
return geosinit.ctxt;
}

QgsGeometry::QgsGeometry()
Expand Down Expand Up @@ -193,7 +193,7 @@ static GEOSGeometry *createGeosPoint( const QgsPoint &point )
GEOSCoordSequence *coord = GEOSCoordSeq_create_r( geosinit.ctxt, 1, 2 );
GEOSCoordSeq_setX_r( geosinit.ctxt, coord, 0, point.x() );
GEOSCoordSeq_setY_r( geosinit.ctxt, coord, 0, point.y() );
return GEOSGeom_createPoint_r(geosinit.ctxt, coord );
return GEOSGeom_createPoint_r( geosinit.ctxt, coord );
}

static GEOSCoordSequence *createGeosCoordSequence( const QgsPolyline& points )
Expand Down Expand Up @@ -305,7 +305,7 @@ static GEOSGeometry *createGeosPolygon( const QVector<GEOSGeometry*> &rings )
{
#if defined(GEOS_VERSION_MAJOR) && defined(GEOS_VERSION_MINOR) && \
((GEOS_VERSION_MAJOR>3) || ((GEOS_VERSION_MAJOR==3) && (GEOS_VERSION_MINOR>=3)))
return GEOSGeom_createEmptyPolygon_r(geosinit.ctxt);
return GEOSGeom_createEmptyPolygon_r( geosinit.ctxt );
#else
shell = GEOSGeom_createLinearRing_r( geosinit.ctxt, GEOSCoordSeq_create_r( geosinit.ctxt, 0, 2 ) );
#endif
Expand Down Expand Up @@ -379,7 +379,7 @@ QgsGeometry* QgsGeometry::fromWkt( QString wkt )
{
try
{
GEOSWKTReader *reader = GEOSWKTReader_create_r(geosinit.ctxt);
GEOSWKTReader *reader = GEOSWKTReader_create_r( geosinit.ctxt );
QgsGeometry *g = fromGeosGeom( GEOSWKTReader_read_r( geosinit.ctxt, reader, wkt.toLocal8Bit().data() ) );
GEOSWKTReader_destroy_r( geosinit.ctxt, reader );
return g;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaphittest.cpp
Expand Up @@ -7,7 +7,7 @@


QgsMapHitTest::QgsMapHitTest( const QgsMapSettings& settings )
: mSettings( settings )
: mSettings( settings )
{
}

Expand Down
20 changes: 10 additions & 10 deletions src/core/qgsmaphittest.h
Expand Up @@ -17,22 +17,22 @@ class QgsVectorLayer;
*/
class CORE_EXPORT QgsMapHitTest
{
public:
QgsMapHitTest( const QgsMapSettings& settings );
public:
QgsMapHitTest( const QgsMapSettings& settings );

void run();
void run();

QSet<QgsSymbolV2*> symbolsForLayer( QgsVectorLayer* layer ) const { return mHitTest[layer]; }
QSet<QgsSymbolV2*> symbolsForLayer( QgsVectorLayer* layer ) const { return mHitTest[layer]; }

protected:
protected:

typedef QSet<QgsSymbolV2*> SymbolV2Set;
typedef QMap<QgsVectorLayer*, SymbolV2Set> HitTest;
typedef QSet<QgsSymbolV2*> SymbolV2Set;
typedef QMap<QgsVectorLayer*, SymbolV2Set> HitTest;

void runHitTestLayer( QgsVectorLayer* vl, SymbolV2Set& usedSymbols, QgsRenderContext& context );
void runHitTestLayer( QgsVectorLayer* vl, SymbolV2Set& usedSymbols, QgsRenderContext& context );

QgsMapSettings mSettings;
HitTest mHitTest;
QgsMapSettings mSettings;
HitTest mHitTest;

};

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrelation.cpp
Expand Up @@ -241,7 +241,7 @@ void QgsRelation::updateRelationStatus()
mValid = false;
}

Q_FOREACH( const FieldPair& fieldPair, mFieldPairs )
Q_FOREACH ( const FieldPair& fieldPair, mFieldPairs )
{
if ( -1 == mReferencingLayer->fieldNameIndex( fieldPair.first )
|| -1 == mReferencedLayer->fieldNameIndex( fieldPair.second ) )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsrelationmanager.cpp
Expand Up @@ -182,7 +182,7 @@ void QgsRelationManager::writeProject( QDomDocument & doc )
void QgsRelationManager::layersRemoved( const QStringList& layers )
{
bool relationsChanged = false;
Q_FOREACH( const QString& layer, layers )
Q_FOREACH ( const QString& layer, layers )
{
QMapIterator<QString, QgsRelation> it( mRelations );

Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -2830,7 +2830,7 @@ void QgsVectorLayer::uniqueValues( int index, QList<QVariant> &uniqueValues, int
if ( mEditBuffer )
{
QSet<QString> vals;
Q_FOREACH( const QVariant& v, uniqueValues )
Q_FOREACH ( const QVariant& v, uniqueValues )
{
vals << v.toString();
}
Expand Down Expand Up @@ -3556,13 +3556,13 @@ void QgsVectorLayer::invalidateSymbolCountedFlag()

void QgsVectorLayer::onRelationsLoaded()
{
Q_FOREACH( QgsAttributeEditorElement* elem, mAttributeEditorElements )
Q_FOREACH ( QgsAttributeEditorElement* elem, mAttributeEditorElements )
{
if ( elem->type() == QgsAttributeEditorElement::AeTypeContainer )
{
QgsAttributeEditorContainer* cont = dynamic_cast< QgsAttributeEditorContainer* >( elem );
QList<QgsAttributeEditorElement*> relations = cont->findElements( QgsAttributeEditorElement::AeTypeRelation );
Q_FOREACH( QgsAttributeEditorElement* relElem, relations )
Q_FOREACH ( QgsAttributeEditorElement* relElem, relations )
{
QgsAttributeEditorRelation* rel = dynamic_cast< QgsAttributeEditorRelation* >( relElem );
rel->init( QgsProject::instance()->relationManager() );
Expand Down Expand Up @@ -3618,7 +3618,7 @@ QDomElement QgsAttributeEditorContainer::toDomElement( QDomDocument& doc ) const
QDomElement elem = doc.createElement( "attributeEditorContainer" );
elem.setAttribute( "name", mName );

Q_FOREACH( QgsAttributeEditorElement* child, mChildren )
Q_FOREACH ( QgsAttributeEditorElement* child, mChildren )
{
elem.appendChild( child->toDomElement( doc ) );
}
Expand All @@ -3634,7 +3634,7 @@ QList<QgsAttributeEditorElement*> QgsAttributeEditorContainer::findElements( Qgs
{
QList<QgsAttributeEditorElement*> results;

Q_FOREACH( QgsAttributeEditorElement* elem, mChildren )
Q_FOREACH ( QgsAttributeEditorElement* elem, mChildren )
{
if ( elem->type() == type )
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayerjoinbuffer.cpp
Expand Up @@ -23,7 +23,7 @@
#include <QDomElement>

QgsVectorLayerJoinBuffer::QgsVectorLayerJoinBuffer( QgsVectorLayer* layer )
: mLayer( layer )
: mLayer( layer )
{
}

Expand All @@ -49,7 +49,7 @@ static bool _hasCycleDFS( QgsVectorLayer* n, QHash<QgsVectorLayer*, int>& mark )
if ( mark.value( n ) == 0 ) // not visited
{
mark[n] = 1; // temporary
foreach ( QgsVectorLayer* m, _outEdges(n) )
foreach ( QgsVectorLayer* m, _outEdges( n ) )
{
if ( _hasCycleDFS( m, mark ) )
return true;
Expand Down
20 changes: 10 additions & 10 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -708,15 +708,15 @@ void QgsCategorizedSymbolRendererV2::setSourceColorRamp( QgsVectorColorRampV2* r

void QgsCategorizedSymbolRendererV2::updateColorRamp( QgsVectorColorRampV2* ramp, bool inverted )
{
setSourceColorRamp(ramp);
setInvertedColorRamp(inverted);
double num=mCategories.count()-1;
setSourceColorRamp( ramp );
setInvertedColorRamp( inverted );
double num = mCategories.count() - 1;
double count = 0;
foreach ( const QgsRendererCategoryV2 &cat, mCategories )
{
double value=count/num;
if( mInvertedColorRamp ) value=1.0-value;
cat.symbol()->setColor(mSourceColorRamp->color(value));
double value = count / num;
if ( mInvertedColorRamp ) value = 1.0 - value;
cat.symbol()->setColor( mSourceColorRamp->color( value ) );
count += 1;
}
}
Expand Down Expand Up @@ -808,11 +808,11 @@ QgsCategorizedSymbolRendererV2* QgsCategorizedSymbolRendererV2::convertFromRende
// If not one of the specifically handled renderers, then just grab the symbol from the renderer
// Could have applied this to specific renderer types (singleSymbol, graduatedSymbo)

QgsCategorizedSymbolRendererV2* r =new QgsCategorizedSymbolRendererV2( "", QgsCategoryList() );
QgsSymbolV2List symbols=const_cast<QgsFeatureRendererV2 *>(renderer)->symbols();
if( symbols.size() > 0 )
QgsCategorizedSymbolRendererV2* r = new QgsCategorizedSymbolRendererV2( "", QgsCategoryList() );
QgsSymbolV2List symbols = const_cast<QgsFeatureRendererV2 *>( renderer )->symbols();
if ( symbols.size() > 0 )
{
r->setSourceSymbol(symbols.at(0)->clone());
r->setSourceSymbol( symbols.at( 0 )->clone() );
}
return r;

Expand Down

0 comments on commit d8cc79a

Please sign in to comment.