Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 2, 2013
1 parent b87ccac commit af4a86f
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 64 deletions.
2 changes: 1 addition & 1 deletion python/plugins/sextante/algs/QGISAlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def __init__(self):
AutoincrementalField(), Explode(), FieldsPyculator(), EquivalentNumField(),
PointsLayerFromTable(), StatisticsByCategories(), Polygonize(),
# ------ raster ------
#CreateConstantRaster(),
#CreateConstantRaster(),
RasterLayerStatistics()
# ------ graphics ------
#VectorLayerHistogram(), VectorLayerScatterplot(), RasterLayerHistogram(),
Expand Down
8 changes: 4 additions & 4 deletions src/app/composer/qgscomposerlegendwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,12 @@ void QgsComposerLegendWidget::on_mRemoveToolButton_clicked()
}

QList<QPersistentModelIndex> indexes;
foreach(const QModelIndex &index, selectionModel->selectedIndexes())
indexes << index;
foreach ( const QModelIndex &index, selectionModel->selectedIndexes() )
indexes << index;

foreach(const QPersistentModelIndex index, indexes)
foreach ( const QPersistentModelIndex index, indexes )
{
itemModel->removeRow( index.row(), index.parent() );
itemModel->removeRow( index.row(), index.parent() );
}

mLegend->adjustBoxSize();
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,12 +736,12 @@ void QgsRasterLayerProperties::sync()
mLayerAttributionLineEdit->setText( mRasterLayer->attribution() );
mLayerAttributionUrlLineEdit->setText( mRasterLayer->attributionUrl() );
mLayerMetadataUrlLineEdit->setText( mRasterLayer->metadataUrl() );
mLayerMetadataUrlTypeComboBox->setCurrentIndex(
mLayerMetadataUrlTypeComboBox->setCurrentIndex(
mLayerMetadataUrlTypeComboBox->findText(
mRasterLayer->metadataUrlType()
)
);
mLayerMetadataUrlFormatComboBox->setCurrentIndex(
mLayerMetadataUrlFormatComboBox->setCurrentIndex(
mLayerMetadataUrlFormatComboBox->findText(
mRasterLayer->metadataUrlFormat()
)
Expand Down
16 changes: 8 additions & 8 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mLayerAttributionLineEdit->setText( layer->attribution() );
mLayerAttributionUrlLineEdit->setText( layer->attributionUrl() );
mLayerMetadataUrlLineEdit->setText( layer->metadataUrl() );
mLayerMetadataUrlTypeComboBox->setCurrentIndex(
mLayerMetadataUrlTypeComboBox->findText(
layer->metadataUrlType()
)
mLayerMetadataUrlTypeComboBox->setCurrentIndex(
mLayerMetadataUrlTypeComboBox->findText(
layer->metadataUrlType()
)
);
mLayerMetadataUrlFormatComboBox->setCurrentIndex(
mLayerMetadataUrlFormatComboBox->findText(
layer->metadataUrlFormat()
)
mLayerMetadataUrlFormatComboBox->setCurrentIndex(
mLayerMetadataUrlFormatComboBox->findText(
layer->metadataUrlFormat()
)
);
}

Expand Down
32 changes: 17 additions & 15 deletions src/core/qgslogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class QFile;
}
#define QgsDebugCall QgsScopeLogger _qgsScopeLogger(__FILE__, __FUNCTION__, __LINE__)
#else
#define QgsDebugCall
#define QgsDebugCall
#define QgsDebugMsg(str)
#define QgsDebugMsgLevel(str, level)
#endif
Expand Down Expand Up @@ -132,20 +132,22 @@ class CORE_EXPORT QgsLogger
static int sPrefixLength;
};

class QgsScopeLogger {
public:
QgsScopeLogger(const char* file, const char* func, int line)
: _file(file), _func(func), _line(line)
{
QgsLogger::debug("Entering.", 1, _file, _func, _line);
}
~QgsScopeLogger() {
QgsLogger::debug("Leaving.", 1, _file, _func, _line);
}
private:
const char *_file;
const char *_func;
int _line;
class QgsScopeLogger
{
public:
QgsScopeLogger( const char* file, const char* func, int line )
: _file( file ), _func( func ), _line( line )
{
QgsLogger::debug( "Entering.", 1, _file, _func, _line );
}
~QgsScopeLogger()
{
QgsLogger::debug( "Leaving.", 1, _file, _func, _line );
}
private:
const char *_file;
const char *_func;
int _line;
};

#endif
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ bool QgsRasterLayer::readXml( const QDomNode& layer_node )
bool res = readSymbology( layer_node, theError );

// old wms settings we need to correct
if ( res && mProviderKey == "wms" && (!renderer() || renderer()->type() != "singlebandcolordata") )
if ( res && mProviderKey == "wms" && ( !renderer() || renderer()->type() != "singlebandcolordata" ) )
{
setRendererForDrawingStyle( SingleBandColorDataStyle );
}
Expand Down
26 changes: 13 additions & 13 deletions src/mapserver/qgsprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void QgsProjectParser::owsGeneralAndResourceList( QDomElement& parentElement, QD
{
// set parentElement id
QFileInfo projectFileInfo( mProjectPath );
parentElement.setAttribute( "id", "ows-context-"+projectFileInfo.baseName() );
parentElement.setAttribute( "id", "ows-context-" + projectFileInfo.baseName() );
// OWSContext General element
QDomElement serviceElem = doc.createElement( "Service" );

Expand Down Expand Up @@ -343,11 +343,11 @@ void QgsProjectParser::owsGeneralAndResourceList( QDomElement& parentElement, QD
combinedBBox.invert();
}
QDomElement lowerCornerElem = doc.createElement( "ows:LowerCorner" );
QDomText lowerCornerText = doc.createTextNode( QString::number( combinedBBox.xMinimum() ) +" "+ QString::number( combinedBBox.yMinimum() ));
QDomText lowerCornerText = doc.createTextNode( QString::number( combinedBBox.xMinimum() ) + " " + QString::number( combinedBBox.yMinimum() ) );
lowerCornerElem.appendChild( lowerCornerText );
bboxElem.appendChild( lowerCornerElem );
QDomElement upperCornerElem = doc.createElement( "ows:upperCorner" );
QDomText upperCornerText = doc.createTextNode( QString::number( combinedBBox.xMaximum() ) +" "+ QString::number( combinedBBox.yMaximum() ));
QDomText upperCornerText = doc.createTextNode( QString::number( combinedBBox.xMaximum() ) + " " + QString::number( combinedBBox.yMaximum() ) );
upperCornerElem.appendChild( upperCornerText );
bboxElem.appendChild( upperCornerElem );
generalElem.appendChild( bboxElem );
Expand Down Expand Up @@ -854,13 +854,13 @@ void QgsProjectParser::addLayers( QDomDocument &doc,
}

void QgsProjectParser::addOWSLayers( QDomDocument &doc,
QDomElement &parentElem,
const QDomElement &legendElem,
const QMap<QString, QgsMapLayer *> &layerMap,
const QStringList &nonIdentifiableLayers,
const QString& strHref,
QgsRectangle& combinedBBox,
QString strGroup) const
QDomElement &parentElem,
const QDomElement &legendElem,
const QMap<QString, QgsMapLayer *> &layerMap,
const QStringList &nonIdentifiableLayers,
const QString& strHref,
QgsRectangle& combinedBBox,
QString strGroup ) const
{
const QgsCoordinateReferenceSystem& projectCrs = projectCRS();
QDomNodeList legendChildren = legendElem.childNodes();
Expand All @@ -882,7 +882,7 @@ void QgsProjectParser::addOWSLayers( QDomDocument &doc,
}
else
{
group = strGroup +"/"+ name;
group = strGroup + "/" + name;
}

if ( currentChildElem.attribute( "embedded" ) == "1" )
Expand Down Expand Up @@ -955,7 +955,7 @@ void QgsProjectParser::addOWSLayers( QDomDocument &doc,
{
layerElem.setAttribute( "queryable", "true" );
}

// is the layer visible ?
if ( currentChildElem.firstChildElement().firstChildElement().attribute( "visible" ) == "1" )
{
Expand All @@ -966,7 +966,7 @@ void QgsProjectParser::addOWSLayers( QDomDocument &doc,
layerElem.setAttribute( "hidden", "true" );
}

if (!strGroup.isEmpty() )
if ( !strGroup.isEmpty() )
{
layerElem.setAttribute( "group", strGroup );
}
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgswfsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ QDomDocument QgsWFSServer::getCapabilities()
getCapabilitiesElement.appendChild( dcpTypeElement );
QDomElement httpElement = doc.createElement( "HTTP"/*wfs:HTTP*/ );
dcpTypeElement.appendChild( httpElement );

//Prepare url
QString hrefString = mConfigParser->wfsServiceUrl();
if ( hrefString.isEmpty() )
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ QDomDocument QgsWMSServer::getContext()
owsContextElem.setAttribute( "xmlns:kml", "http://www.opengis.net/kml/2.2" );
owsContextElem.setAttribute( "xmlns:xlink", "http://www.w3.org/1999/xlink" );
owsContextElem.setAttribute( "xmlns:ns9", "http://www.w3.org/2005/Atom" );
owsContextElem.setAttribute( "xmlns:xal", "urn:oasis:names:tc:ciq:xsdschema:xAL:2.0");
owsContextElem.setAttribute( "xmlns:xal", "urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" );
owsContextElem.setAttribute( "xmlns:ins", "http://www.inspire.org" );
owsContextElem.setAttribute( "version", "0.3.1" );
doc.appendChild( owsContextElem );
Expand Down
4 changes: 2 additions & 2 deletions src/providers/delimitedtext/qgsdelimitedtextfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ bool QgsDelimitedTextFile::open()
delete mFile;
mFile = 0;
}
if( mFile )
if ( mFile )
{
mStream = new QTextStream( mFile );
if ( ! mEncoding.isEmpty() )
Expand Down Expand Up @@ -505,7 +505,7 @@ int QgsDelimitedTextFile::fieldIndex( QString name )

bool QgsDelimitedTextFile::setNextRecordId( long nextRecordId )
{
if( ! mFile ) return false;
if ( ! mFile ) return false;
mHoldCurrentRecord = nextRecordId == mRecordLineNumber;
if ( mHoldCurrentRecord ) return true;
return setNextLineNumber( nextRecordId );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ void QgsDelimitedTextProvider::resetStream()
QgsFeatureIterator QgsDelimitedTextProvider::getFeatures( const QgsFeatureRequest& request )
{
// If the file has become invalid, check that it is still invalid.
if( mLayerValid && ! mValid ) rescanFile();
if ( mLayerValid && ! mValid ) rescanFile();

return QgsFeatureIterator( new QgsDelimitedTextFeatureIterator( this, request ) );
}
Expand Down
22 changes: 11 additions & 11 deletions src/providers/mssql/qgsmssqlprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,22 +579,22 @@ void QgsMssqlProvider::UpdateStatistics( bool estimate )
query.setForwardOnly( true );

// Get the extents from the geometry_columns table to speed up load times.
statement = QString("SELECT min_x, min_y, max_x, max_y from geometry_columns where f_table_schema = '%1' and f_table_name = '%2'").arg( mSchemaName ).arg( mTableName );
statement = QString( "SELECT min_x, min_y, max_x, max_y from geometry_columns where f_table_schema = '%1' and f_table_name = '%2'" ).arg( mSchemaName ).arg( mTableName );

if ( query.exec( statement ) )
{
if ( query.next() )
if ( query.next() )
{
if ( !query.value( 0 ).isNull() || !query.value( 1 ).isNull() ||
!query.value( 2 ).isNull() || !query.value( 3 ).isNull() )
{
if (!query.value( 0 ).isNull() || !query.value( 1 ).isNull() ||
!query.value( 2 ).isNull() || !query.value( 3 ).isNull())
{
mExtent.setXMinimum( query.value( 0 ).toDouble() );
mExtent.setYMinimum( query.value( 1 ).toDouble() );
mExtent.setXMaximum( query.value( 2 ).toDouble() );
mExtent.setYMaximum( query.value( 3 ).toDouble() );
return;
}
mExtent.setXMinimum( query.value( 0 ).toDouble() );
mExtent.setYMinimum( query.value( 1 ).toDouble() );
mExtent.setXMaximum( query.value( 2 ).toDouble() );
mExtent.setYMaximum( query.value( 3 ).toDouble() );
return;
}
}
}

// If we can't find the extents in the geometry_columns table just do what we normally do.
Expand Down
6 changes: 3 additions & 3 deletions src/providers/postgres/qgscolumntypethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ void QgsGeomColumnTypeThread::run()
}

int i = 0, n = layerProperties.size();
for ( QVector<QgsPostgresLayerProperty>::iterator it=layerProperties.begin(),
end=layerProperties.end();
it != end; ++it)
for ( QVector<QgsPostgresLayerProperty>::iterator it = layerProperties.begin(),
end = layerProperties.end();
it != end; ++it )
{
QgsPostgresLayerProperty& layerProperty = *it;
if ( !mStopped )
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgsdelimitedtextprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def delimitedTextData( testname, filename, requests, verbose, **params ):
data.update(rdata)
if not rdata:
log.append("Request "+str(nr)+" did not return any data")
if verbose:
if verbose:
print "Request returned",len(rdata.keys()),"features"
for msg in logger.messages():
filelogname = 'temp_file' if 'tmp' in filename.lower() else filename
Expand Down

0 comments on commit af4a86f

Please sign in to comment.