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 8, 2013
1 parent c9fe92c commit 93cdd0c
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 31 deletions.
10 changes: 5 additions & 5 deletions python/plugins/processing/saga/SagaAlgorithmProvider.py
Expand Up @@ -67,19 +67,19 @@ def unload(self):
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))
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/openstreetmap/qgsosmdatabase.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down
20 changes: 11 additions & 9 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -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 ),
Expand Down Expand Up @@ -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 ),
Expand Down Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorfilewriter.cpp
Expand Up @@ -669,7 +669,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
return 0;
}

OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast<unsigned char *>( geom->asWkb() ), (int) geom->wkbSize() );
OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast<unsigned char *>( geom->asWkb() ), ( int ) geom->wkbSize() );
if ( err != OGRERR_NONE )
{
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
Expand All @@ -685,7 +685,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
}
else if ( geom )
{
OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast<unsigned char *>( geom->asWkb() ), (int) geom->wkbSize() );
OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast<unsigned char *>( geom->asWkb() ), ( int ) geom->wkbSize() );
if ( err != OGRERR_NONE )
{
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsrasterblock.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 6 additions & 4 deletions src/providers/postgres/qgspostgresconn.cpp
Expand Up @@ -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 );

Expand All @@ -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;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/providers/postgres/qgspostgresconn.h
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspostgresfeatureiterator.cpp
Expand Up @@ -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() );
Expand Down
8 changes: 4 additions & 4 deletions tests/src/app/testqgisappclipboard.cpp
Expand Up @@ -69,7 +69,7 @@ void TestQgisAppClipboard::copyPaste()
{
qDebug() << "TestQgisAppClipboard::copyPaste()";

QMap<QString,int> filesCounts;
QMap<QString, int> filesCounts;
filesCounts.insert( "points.shp", 17 );
filesCounts.insert( "lines.shp", 6 );
filesCounts.insert( "polys.shp", 10 );
Expand All @@ -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
Expand All @@ -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 ) );
}
}

Expand Down

0 comments on commit 93cdd0c

Please sign in to comment.