Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Sep 26, 2014
1 parent bfb7569 commit d8cc79ac44b70334ff2f503da2b6036286d49ab5
Showing with 260 additions and 263 deletions.
  1. +11 −11 src/analysis/vector/qgsgeometryanalyzer.cpp
  2. +1 −1 src/app/qgisapp.cpp
  3. +2 −2 src/app/qgsattributeactiondialog.cpp
  4. +1 −1 src/app/qgsattributeactiondialog.h
  5. +1 −1 src/app/qgsmaptoolrotatepointsymbols.cpp
  6. +1 −1 src/core/composer/qgscomposermapitem.cpp
  7. +6 −6 src/core/layertree/qgslayertreegroup.cpp
  8. +1 −1 src/core/layertree/qgslayertreemodel.cpp
  9. +1 −1 src/core/qgsattributeaction.cpp
  10. +1 −1 src/core/qgsattributeaction.h
  11. +0 −4 src/core/qgsconnectionpool.h
  12. +1 −1 src/core/qgsfield.h
  13. +5 −5 src/core/qgsgeometry.cpp
  14. +1 −1 src/core/qgsmaphittest.cpp
  15. +10 −10 src/core/qgsmaphittest.h
  16. +1 −1 src/core/qgsrelation.cpp
  17. +1 −1 src/core/qgsrelationmanager.cpp
  18. +5 −5 src/core/qgsvectorlayer.cpp
  19. +2 −2 src/core/qgsvectorlayerjoinbuffer.cpp
  20. +10 −10 src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
  21. +85 −85 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
  22. +10 −10 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h
  23. +1 −1 src/core/symbology-ng/qgspointdisplacementrenderer.h
  24. +3 −3 src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
  25. +2 −2 src/gui/attributetable/qgsdualview.cpp
  26. +1 −1 src/gui/attributetable/qgsfeaturelistview.cpp
  27. +1 −1 src/gui/editorwidgets/qgsuniquevaluewidgetwrapper.cpp
  28. +15 −15 src/gui/qgsattributeform.cpp
  29. +2 −2 src/gui/qgscollapsiblegroupbox.cpp
  30. +1 −1 src/gui/qgsmapcanvasmap.cpp
  31. +3 −3 src/gui/qgsmessagelogviewer.cpp
  32. +8 −8 src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp
  33. +42 −42 src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
  34. +1 −1 src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.h
  35. +1 −1 src/gui/symbology-ng/qgspointdisplacementrendererwidget.cpp
  36. +1 −1 src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
  37. +19 −18 src/mapserver/qgswmsconfigparser.cpp
  38. +2 −2 src/providers/memory/qgsmemoryfeatureiterator.cpp
@@ -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 );
}
}
@@ -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;
@@ -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 );
}
@@ -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
@@ -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( " " ) );
@@ -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 );
@@ -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;
}

@@ -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 )
@@ -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();
}
}
}
@@ -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 );
@@ -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 );
}
@@ -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 );
@@ -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();
}
@@ -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
@@ -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()
@@ -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 )
@@ -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
@@ -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;
@@ -7,7 +7,7 @@


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

@@ -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;

};

@@ -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 ) )
@@ -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 );

@@ -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();
}
@@ -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() );
@@ -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 ) );
}
@@ -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 )
{
@@ -23,7 +23,7 @@
#include <QDomElement>

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

@@ -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;
@@ -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;
}
}
@@ -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;

0 comments on commit d8cc79a

Please sign in to comment.
You can’t perform that action at this time.