From 93cdd0ca40b8f66528e95041171ba35050f0f1dd Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Sun, 8 Sep 2013 20:26:43 +0200 Subject: [PATCH] indentation update --- .../processing/saga/SagaAlgorithmProvider.py | 10 +++++----- src/analysis/openstreetmap/qgsosmdatabase.cpp | 4 ++-- src/core/composer/qgscomposermap.cpp | 20 ++++++++++--------- src/core/qgsvectorfilewriter.cpp | 4 ++-- src/core/raster/qgsrasterblock.cpp | 4 ++-- src/providers/postgres/qgspostgresconn.cpp | 10 ++++++---- src/providers/postgres/qgspostgresconn.h | 3 ++- .../postgres/qgspostgresfeatureiterator.cpp | 4 ++-- tests/src/app/testqgisappclipboard.cpp | 8 ++++---- 9 files changed, 36 insertions(+), 31 deletions(-) diff --git a/python/plugins/processing/saga/SagaAlgorithmProvider.py b/python/plugins/processing/saga/SagaAlgorithmProvider.py index ca558778c52..0e1bbbf033b 100644 --- a/python/plugins/processing/saga/SagaAlgorithmProvider.py +++ b/python/plugins/processing/saga/SagaAlgorithmProvider.py @@ -67,19 +67,19 @@ class SagaAlgorithmProvider(AlgorithmProvider): ProcessingConfig.removeSetting(SagaUtils.SAGA_RESAMPLING_REGION_CELLSIZE) ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_CONSOLE) ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_COMMANDS) - - def _loadAlgorithms(self): + + def _loadAlgorithms(self): self.algs = [] - saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208) + saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208) folder = SagaUtils.sagaDescriptionPath() for descriptionFile in os.listdir(folder): - if descriptionFile.endswith("txt"): + if descriptionFile.endswith("txt"): if not saga208: if descriptionFile.startswith("2.0.8"): continue else: - if descriptionFile.startswith("2.1"): + if descriptionFile.startswith("2.1"): continue try: alg = SagaAlgorithm(os.path.join(folder, descriptionFile)) diff --git a/src/analysis/openstreetmap/qgsosmdatabase.cpp b/src/analysis/openstreetmap/qgsosmdatabase.cpp index 3c9f9cec4d3..0aa7eabf361 100644 --- a/src/analysis/openstreetmap/qgsosmdatabase.cpp +++ b/src/analysis/openstreetmap/qgsosmdatabase.cpp @@ -421,7 +421,7 @@ void QgsOSMDatabase::exportSpatiaLiteNodes( const QString& tableName, const QStr sqlite3_bind_null( stmtInsert, ++col ); } - sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), (int) geom->wkbSize(), SQLITE_STATIC ); + sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC ); int insertRes = sqlite3_step( stmtInsert ); if ( insertRes != SQLITE_DONE ) @@ -489,7 +489,7 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName sqlite3_bind_null( stmtInsert, ++col ); } - sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), (int) geom->wkbSize(), SQLITE_STATIC ); + sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC ); int insertRes = sqlite3_step( stmtInsert ); if ( insertRes != SQLITE_DONE ) diff --git a/src/core/composer/qgscomposermap.cpp b/src/core/composer/qgscomposermap.cpp index 14803604db8..fadd7b39ccd 100644 --- a/src/core/composer/qgscomposermap.cpp +++ b/src/core/composer/qgscomposermap.cpp @@ -41,8 +41,8 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int width, int height ) : QgsComposerItem( x, y, width, height, composition ), mKeepLayerSet( false ), - mOverviewFrameMapId( -1 ), mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ), - mGridEnabled( false ), mGridStyle( Solid ), + mOverviewFrameMapId( -1 ), mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ), + mGridEnabled( false ), mGridStyle( Solid ), mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) ), mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver ), mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ), @@ -87,8 +87,8 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w QgsComposerMap::QgsComposerMap( QgsComposition *composition ) : QgsComposerItem( 0, 0, 10, 10, composition ), mKeepLayerSet( false ), mOverviewFrameMapId( -1 ), - mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ), - mGridEnabled( false ), mGridStyle( Solid ), + mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ), + mGridEnabled( false ), mGridStyle( Solid ), mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) ), mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver ), mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ), @@ -121,19 +121,21 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition ) void QgsComposerMap::extentCenteredOnOverview( QgsRectangle& extent ) const { extent = mExtent; - if ( ! mOverviewCentered ) { + if ( ! mOverviewCentered ) + { return; } - if ( mOverviewFrameMapId != -1 ) { + if ( mOverviewFrameMapId != -1 ) + { const QgsComposerMap* overviewFrameMap = mComposition->getComposerMapById( mOverviewFrameMapId ); QgsRectangle otherExtent = overviewFrameMap->extent(); QgsPoint center = otherExtent.center(); QgsRectangle movedExtent( center.x() - mExtent.width() / 2, - center.y() - mExtent.height() / 2, - center.x() - mExtent.width() / 2 + mExtent.width(), - center.y() - mExtent.height() / 2 + mExtent.height() ); + center.y() - mExtent.height() / 2, + center.x() - mExtent.width() / 2 + mExtent.width(), + center.y() - mExtent.height() / 2 + mExtent.height() ); extent = movedExtent; } } diff --git a/src/core/qgsvectorfilewriter.cpp b/src/core/qgsvectorfilewriter.cpp index 04ef9c222a0..b2b8e652635 100644 --- a/src/core/qgsvectorfilewriter.cpp +++ b/src/core/qgsvectorfilewriter.cpp @@ -669,7 +669,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature ) return 0; } - OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast( geom->asWkb() ), (int) geom->wkbSize() ); + OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast( geom->asWkb() ), ( int ) geom->wkbSize() ); if ( err != OGRERR_NONE ) { mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" ) @@ -685,7 +685,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature ) } else if ( geom ) { - OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast( geom->asWkb() ), (int) geom->wkbSize() ); + OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast( geom->asWkb() ), ( int ) geom->wkbSize() ); if ( err != OGRERR_NONE ) { mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" ) diff --git a/src/core/raster/qgsrasterblock.cpp b/src/core/raster/qgsrasterblock.cpp index 990d87cf7ac..e902855ff55 100644 --- a/src/core/raster/qgsrasterblock.cpp +++ b/src/core/raster/qgsrasterblock.cpp @@ -324,7 +324,7 @@ bool QgsRasterBlock::isNoData( size_t index ) return false; } // TODO: optimize - int row = (int) index / mWidth; + int row = ( int ) index / mWidth; int column = index % mWidth; size_t byte = ( size_t )row * mNoDataBitmapWidth + column / 8 ; int bit = column % 8; @@ -406,7 +406,7 @@ bool QgsRasterBlock::setIsNoData( size_t index ) } } // TODO: optimize - int row = (int) index / mWidth; + int row = ( int ) index / mWidth; int column = index % mWidth; size_t byte = ( size_t )row * mNoDataBitmapWidth + column / 8; int bit = column % 8; diff --git a/src/providers/postgres/qgspostgresconn.cpp b/src/providers/postgres/qgspostgresconn.cpp index 1ea05270f00..cce4f20b54d 100644 --- a/src/providers/postgres/qgspostgresconn.cpp +++ b/src/providers/postgres/qgspostgresconn.cpp @@ -277,8 +277,8 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty& layerProperty, co // could use array_agg() and count() // array output would look like this: "{One,tWo}" QString sql = QString( "SELECT attname, CASE WHEN typname = ANY(ARRAY['geometry','geography','topogeometry']) THEN 1 ELSE null END AS isSpatial FROM pg_attribute JOIN pg_type ON atttypid=pg_type.oid WHERE attrelid=regclass('%1.%2')" ) - .arg( quotedIdentifier( schemaName ) ) - .arg( quotedIdentifier( viewName ) ); + .arg( quotedIdentifier( schemaName ) ) + .arg( quotedIdentifier( viewName ) ); QgsDebugMsg( sql ); QgsPostgresResult colRes = PQexec( sql ); @@ -288,12 +288,14 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty& layerProperty, co { for ( int i = 0; i < colRes.PQntuples(); i++ ) { - if ( fetchPkCandidates ) { + if ( fetchPkCandidates ) + { QgsDebugMsg( colRes.PQgetvalue( i, 0 ) ); layerProperty.pkCols << colRes.PQgetvalue( i, 0 ); } - if ( colRes.PQgetisnull( i, 1 ) == 0 ) { + if ( colRes.PQgetisnull( i, 1 ) == 0 ) + { ++layerProperty.nSpCols; } } diff --git a/src/providers/postgres/qgspostgresconn.h b/src/providers/postgres/qgspostgresconn.h index e9b964df80e..574af5dd618 100644 --- a/src/providers/postgres/qgspostgresconn.h +++ b/src/providers/postgres/qgspostgresconn.h @@ -60,7 +60,8 @@ struct QgsPostgresLayerProperty // TODO: rename this ! int size() const { Q_ASSERT( types.size() == srids.size() ); return types.size(); } - QString defaultName() const { + QString defaultName() const + { QString n = tableName; if ( nSpCols > 1 ) n += "." + geometryColName; return n; diff --git a/src/providers/postgres/qgspostgresfeatureiterator.cpp b/src/providers/postgres/qgspostgresfeatureiterator.cpp index f7d9db5862c..26b7a202e0f 100644 --- a/src/providers/postgres/qgspostgresfeatureiterator.cpp +++ b/src/providers/postgres/qgspostgresfeatureiterator.cpp @@ -275,8 +275,8 @@ bool QgsPostgresFeatureIterator::declareCursor( const QString& whereClause ) query += QString( "%1(%2(%3%4),'%5')" ) .arg( P->mConnectionRO->majorVersion() < 2 ? "asbinary" : "st_asbinary" ) .arg( P->mConnectionRO->majorVersion() < 2 ? "force_2d" - : P->mConnectionRO->majorVersion() > 2 || P->mConnectionRO->minorVersion() > 0 ? "ST_Force2D" - : "st_force_2d" ) + : P->mConnectionRO->majorVersion() > 2 || P->mConnectionRO->minorVersion() > 0 ? "st_force2d" + : "st_force_2d" ) .arg( P->quotedIdentifier( P->mGeometryColumn ) ) .arg( P->mSpatialColType == sctGeography ? "::geometry" : "" ) .arg( P->endianString() ); diff --git a/tests/src/app/testqgisappclipboard.cpp b/tests/src/app/testqgisappclipboard.cpp index 3eff3159e66..46325cafeb5 100644 --- a/tests/src/app/testqgisappclipboard.cpp +++ b/tests/src/app/testqgisappclipboard.cpp @@ -69,7 +69,7 @@ void TestQgisAppClipboard::copyPaste() { qDebug() << "TestQgisAppClipboard::copyPaste()"; - QMap filesCounts; + QMap filesCounts; filesCounts.insert( "points.shp", 17 ); filesCounts.insert( "lines.shp", 6 ); filesCounts.insert( "polys.shp", 10 ); @@ -79,7 +79,7 @@ void TestQgisAppClipboard::copyPaste() // add vector layer QString filePath = mTestDataDir + fileName; qDebug() << "add vector layer: " << filePath; - QgsVectorLayer *inputLayer = mQgisApp->addVectorLayer ( filePath, fileName, "ogr" ); + QgsVectorLayer *inputLayer = mQgisApp->addVectorLayer( filePath, fileName, "ogr" ); QVERIFY( inputLayer->isValid() ); // copy all features to clipboard @@ -89,13 +89,13 @@ void TestQgisAppClipboard::copyPaste() QgsFeatureList features = mQgisApp->clipboard()->copyOf(); qDebug() << features.size() << " features copied to clipboard"; - QVERIFY( features.size() == filesCounts.value(fileName) ); + QVERIFY( features.size() == filesCounts.value( fileName ) ); QgsVectorLayer *pastedLayer = mQgisApp->pasteAsNewMemoryVector( "pasted" ); QVERIFY( pastedLayer ); QVERIFY( pastedLayer->isValid() ); qDebug() << pastedLayer->featureCount() << " features in pasted layer"; - QVERIFY( pastedLayer->featureCount() == filesCounts.value(fileName) ); + QVERIFY( pastedLayer->featureCount() == filesCounts.value( fileName ) ); } }