Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Jun 2, 2013
1 parent b87ccac commit af4a86f8a65e170af49d37025329f97a338f7070
@@ -133,7 +133,7 @@ def __init__(self):
AutoincrementalField(), Explode(), FieldsPyculator(), EquivalentNumField(),
PointsLayerFromTable(), StatisticsByCategories(), Polygonize(),
# ------ raster ------
#CreateConstantRaster(),
#CreateConstantRaster(),
RasterLayerStatistics()
# ------ graphics ------
#VectorLayerHistogram(), VectorLayerScatterplot(), RasterLayerHistogram(),
@@ -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();
@@ -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()
)
@@ -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()
)
);
}

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

@@ -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 );
@@ -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();
@@ -882,7 +882,7 @@ void QgsProjectParser::addOWSLayers( QDomDocument &doc,
}
else
{
group = strGroup +"/"+ name;
group = strGroup + "/" + name;
}

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

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

if (!strGroup.isEmpty() )
if ( !strGroup.isEmpty() )
{
layerElem.setAttribute( "group", strGroup );
}
@@ -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() )
@@ -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 );
@@ -101,7 +101,7 @@ bool QgsDelimitedTextFile::open()
delete mFile;
mFile = 0;
}
if( mFile )
if ( mFile )
{
mStream = new QTextStream( mFile );
if ( ! mEncoding.isEmpty() )
@@ -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 );
@@ -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 ) );
}
@@ -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.
@@ -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 )
@@ -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

0 comments on commit af4a86f

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