mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
indentation update
This commit is contained in:
parent
ebd9726d64
commit
907ce69306
@ -82,7 +82,7 @@ class GrassAlgorithm(GeoAlgorithm):
|
|||||||
|
|
||||||
def getParameterDescriptions(self):
|
def getParameterDescriptions(self):
|
||||||
descs = {}
|
descs = {}
|
||||||
_, helpfile = self.help()
|
_, helpfile = self.help()
|
||||||
try:
|
try:
|
||||||
infile = open(helpfile)
|
infile = open(helpfile)
|
||||||
lines = infile.readlines()
|
lines = infile.readlines()
|
||||||
|
@ -83,7 +83,7 @@ class Grass7Algorithm(GeoAlgorithm):
|
|||||||
|
|
||||||
def getParameterDescriptions(self):
|
def getParameterDescriptions(self):
|
||||||
descs = {}
|
descs = {}
|
||||||
_, helpfile = self.help()
|
_, helpfile = self.help()
|
||||||
try:
|
try:
|
||||||
infile = open(helpfile)
|
infile = open(helpfile)
|
||||||
lines = infile.readlines()
|
lines = infile.readlines()
|
||||||
|
@ -150,7 +150,7 @@ class OTBAlgorithm(GeoAlgorithm):
|
|||||||
if line.startswith("*Parameter"):
|
if line.startswith("*Parameter"):
|
||||||
param = ParameterFactory.getFromString(line[1:])
|
param = ParameterFactory.getFromString(line[1:])
|
||||||
param.isAdvanced = True
|
param.isAdvanced = True
|
||||||
else:
|
else:
|
||||||
param = getParameterFromString(line)
|
param = getParameterFromString(line)
|
||||||
# Hack for initializing the elevation parameters from Processing configuration
|
# Hack for initializing the elevation parameters from Processing configuration
|
||||||
if param.name == "-elev.dem.path" or param.name == "-elev.dem" or "elev.dem" in param.name:
|
if param.name == "-elev.dem.path" or param.name == "-elev.dem" or "elev.dem" in param.name:
|
||||||
|
@ -16,7 +16,7 @@ n = polyLayer.featureCount()
|
|||||||
l = 0
|
l = 0
|
||||||
|
|
||||||
writer = processing.VectorWriter(Results, None, polyPrder.fields(),
|
writer = processing.VectorWriter(Results, None, polyPrder.fields(),
|
||||||
QGis.WKBMultiPolygon, polyPrder.crs())
|
QGis.WKBMultiPolygon, polyPrder.crs())
|
||||||
|
|
||||||
|
|
||||||
resgeom = QgsGeometry()
|
resgeom = QgsGeometry()
|
||||||
|
@ -11,8 +11,8 @@ layer = processing.getObject(Input)
|
|||||||
inputFields = layer.pendingFields()
|
inputFields = layer.pendingFields()
|
||||||
fieldIdxs = []
|
fieldIdxs = []
|
||||||
fields = Fields.split(',')
|
fields = Fields.split(',')
|
||||||
for f in fields:
|
for f in fields:
|
||||||
idx = inputFields.indexFromName(f)
|
idx = inputFields.indexFromName(f)
|
||||||
if idx == -1:
|
if idx == -1:
|
||||||
raise GeoAlgorithmExecutionException('Field not found:' + f)
|
raise GeoAlgorithmExecutionException('Field not found:' + f)
|
||||||
fieldIdxs.append(idx)
|
fieldIdxs.append(idx)
|
||||||
|
@ -605,14 +605,14 @@ void QgsFieldsProperties::attributesListCellChanged( int row, int column )
|
|||||||
QTableWidgetItem *aliasItem = mFieldsList->item( row, column );
|
QTableWidgetItem *aliasItem = mFieldsList->item( row, column );
|
||||||
if ( aliasItem )
|
if ( aliasItem )
|
||||||
{
|
{
|
||||||
if ( !aliasItem->text().trimmed().isEmpty() )
|
if ( !aliasItem->text().trimmed().isEmpty() )
|
||||||
{
|
{
|
||||||
mLayer->addAttributeAlias( idx, aliasItem->text() );
|
mLayer->addAttributeAlias( idx, aliasItem->text() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mLayer->remAttributeAlias(idx);
|
mLayer->remAttributeAlias( idx );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,14 +218,14 @@ void QgsComposerMapOverview::setFrameMap( const int mapId )
|
|||||||
|
|
||||||
void QgsComposerMapOverview::connectSignals()
|
void QgsComposerMapOverview::connectSignals()
|
||||||
{
|
{
|
||||||
if ( mFrameMapId != -1 && mComposerMap->composition() )
|
if ( mFrameMapId != -1 && mComposerMap->composition() )
|
||||||
|
{
|
||||||
|
const QgsComposerMap* map = mComposerMap->composition()->getComposerMapById( mFrameMapId );
|
||||||
|
if ( map )
|
||||||
{
|
{
|
||||||
const QgsComposerMap* map = mComposerMap->composition()->getComposerMapById( mFrameMapId );
|
QObject::connect( map, SIGNAL( extentChanged() ), this, SLOT( overviewExtentChanged() ) );
|
||||||
if ( map )
|
|
||||||
{
|
|
||||||
QObject::connect( map, SIGNAL( extentChanged() ), this, SLOT( overviewExtentChanged() ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsComposerMapOverview::setFrameSymbol( QgsFillSymbolV2 *symbol )
|
void QgsComposerMapOverview::setFrameSymbol( QgsFillSymbolV2 *symbol )
|
||||||
|
@ -96,7 +96,7 @@ class CORE_EXPORT QgsComposerMapOverview : public QObject
|
|||||||
*/
|
*/
|
||||||
void connectSignals();
|
void connectSignals();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void overviewExtentChanged();
|
void overviewExtentChanged();
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ void QgsAttributeAction::removeAction( int index )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsAttributeAction::doAction(int index, const QgsFeature& feat, int defaultValueIndex )
|
void QgsAttributeAction::doAction( int index, const QgsFeature& feat, int defaultValueIndex )
|
||||||
{
|
{
|
||||||
QMap<QString, QVariant> substitutionMap;
|
QMap<QString, QVariant> substitutionMap;
|
||||||
if ( defaultValueIndex >= 0 )
|
if ( defaultValueIndex >= 0 )
|
||||||
|
@ -150,7 +150,7 @@ bool QgsFields::append( const QgsField& field, FieldOrigin origin, int originInd
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QgsFields::appendExpressionField(const QgsField& field, int originIndex)
|
bool QgsFields::appendExpressionField( const QgsField& field, int originIndex )
|
||||||
{
|
{
|
||||||
if ( mNameToIndex.contains( field.name() ) )
|
if ( mNameToIndex.contains( field.name() ) )
|
||||||
return false;
|
return false;
|
||||||
|
@ -2046,13 +2046,13 @@ bool QgsVectorLayer::addAttribute( const QgsField &field )
|
|||||||
return mEditBuffer->addAttribute( field );
|
return mEditBuffer->addAttribute( field );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsVectorLayer::remAttributeAlias( int attIndex)
|
void QgsVectorLayer::remAttributeAlias( int attIndex )
|
||||||
{
|
{
|
||||||
if ( attIndex < 0 || attIndex >= pendingFields().count() )
|
if ( attIndex < 0 || attIndex >= pendingFields().count() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString name = pendingFields()[ attIndex ].name();
|
QString name = pendingFields()[ attIndex ].name();
|
||||||
if ( mAttributeAliasMap.contains(name) )
|
if ( mAttributeAliasMap.contains( name ) )
|
||||||
{
|
{
|
||||||
mAttributeAliasMap.remove( name );
|
mAttributeAliasMap.remove( name );
|
||||||
emit layerModified();
|
emit layerModified();
|
||||||
@ -2895,11 +2895,11 @@ QVariant QgsVectorLayer::minimumValue( int index )
|
|||||||
else if ( origin == QgsFields::OriginEdit || origin == QgsFields::OriginExpression )
|
else if ( origin == QgsFields::OriginEdit || origin == QgsFields::OriginExpression )
|
||||||
{
|
{
|
||||||
// the layer is editable, but in certain cases it can still be avoided going through all features
|
// the layer is editable, but in certain cases it can still be avoided going through all features
|
||||||
if ( origin == QgsFields::OriginEdit &&
|
if ( origin == QgsFields::OriginEdit &&
|
||||||
mEditBuffer->mDeletedFeatureIds.isEmpty() &&
|
mEditBuffer->mDeletedFeatureIds.isEmpty() &&
|
||||||
mEditBuffer->mAddedFeatures.isEmpty() && !
|
mEditBuffer->mAddedFeatures.isEmpty() && !
|
||||||
mEditBuffer->mDeletedAttributeIds.contains( index ) &&
|
mEditBuffer->mDeletedAttributeIds.contains( index ) &&
|
||||||
mEditBuffer->mChangedAttributeValues.isEmpty() )
|
mEditBuffer->mChangedAttributeValues.isEmpty() )
|
||||||
{
|
{
|
||||||
return mDataProvider->minimumValue( index );
|
return mDataProvider->minimumValue( index );
|
||||||
}
|
}
|
||||||
|
@ -551,7 +551,7 @@ void QgsVectorLayerFeatureIterator::addVirtualAttributes( QgsFeature& f )
|
|||||||
{
|
{
|
||||||
QMap<int, QgsExpression*>::ConstIterator it = mExpressionFieldInfo.constBegin();
|
QMap<int, QgsExpression*>::ConstIterator it = mExpressionFieldInfo.constBegin();
|
||||||
|
|
||||||
for( ; it != mExpressionFieldInfo.constEnd(); ++it )
|
for ( ; it != mExpressionFieldInfo.constEnd(); ++it )
|
||||||
{
|
{
|
||||||
QgsExpression* exp = it.value();
|
QgsExpression* exp = it.value();
|
||||||
QVariant val = exp->evaluate( f );
|
QVariant val = exp->evaluate( f );
|
||||||
|
@ -163,7 +163,7 @@ bool QgsAttributeForm::save()
|
|||||||
QVariant srcVar = eww->value();
|
QVariant srcVar = eww->value();
|
||||||
// need to check dstVar.isNull() != srcVar.isNull()
|
// need to check dstVar.isNull() != srcVar.isNull()
|
||||||
// otherwise if dstVar=NULL and scrVar=0, then dstVar = srcVar
|
// otherwise if dstVar=NULL and scrVar=0, then dstVar = srcVar
|
||||||
if ( ( dstVar != srcVar || dstVar.isNull() != srcVar.isNull() ) && srcVar.isValid() )
|
if (( dstVar != srcVar || dstVar.isNull() != srcVar.isNull() ) && srcVar.isValid() )
|
||||||
{
|
{
|
||||||
dst[eww->fieldIdx()] = srcVar;
|
dst[eww->fieldIdx()] = srcVar;
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ bool QgsAttributeForm::save()
|
|||||||
int n = 0;
|
int n = 0;
|
||||||
for ( int i = 0; i < dst.count(); ++i )
|
for ( int i = 0; i < dst.count(); ++i )
|
||||||
{
|
{
|
||||||
if ( ( dst[i] == src[i] && dst[i].isNull() == src[i].isNull() ) || !dst[i].isValid() )
|
if (( dst[i] == src[i] && dst[i].isNull() == src[i].isNull() ) || !dst[i].isValid() )
|
||||||
{
|
{
|
||||||
QgsDebugMsg( "equal or invalid destination" );
|
QgsDebugMsg( "equal or invalid destination" );
|
||||||
QgsDebugMsg( QString( "dst:'%1' (type:%2,isNull:%3,isValid:%4)" )
|
QgsDebugMsg( QString( "dst:'%1' (type:%2,isNull:%3,isValid:%4)" )
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
|
|
||||||
QgsCodeEditorHTML::QgsCodeEditorHTML( QWidget *parent )
|
QgsCodeEditorHTML::QgsCodeEditorHTML( QWidget *parent )
|
||||||
: QgsCodeEditor( parent )
|
: QgsCodeEditor( parent )
|
||||||
{
|
{
|
||||||
if ( !parent )
|
if ( !parent )
|
||||||
{
|
{
|
||||||
|
@ -64,8 +64,8 @@ QgsServerProjectParser::QgsServerProjectParser( QDomDocument* xmlDoc, const QStr
|
|||||||
}
|
}
|
||||||
|
|
||||||
QgsServerProjectParser::QgsServerProjectParser()
|
QgsServerProjectParser::QgsServerProjectParser()
|
||||||
: mXMLDoc( 0 )
|
: mXMLDoc( 0 )
|
||||||
, mUseLayerIDs( false )
|
, mUseLayerIDs( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ QgsOgrFeatureSource::QgsOgrFeatureSource( const QgsOgrProvider* p )
|
|||||||
mSubsetString = p->mSubsetString;
|
mSubsetString = p->mSubsetString;
|
||||||
mEncoding = p->mEncoding; // no copying - this is a borrowed pointer from Qt
|
mEncoding = p->mEncoding; // no copying - this is a borrowed pointer from Qt
|
||||||
mFields = p->mAttributeFields;
|
mFields = p->mAttributeFields;
|
||||||
mOgrGeometryTypeFilter = wkbFlatten(p->mOgrGeometryTypeFilter);
|
mOgrGeometryTypeFilter = wkbFlatten( p->mOgrGeometryTypeFilter );
|
||||||
}
|
}
|
||||||
|
|
||||||
QgsFeatureIterator QgsOgrFeatureSource::getFeatures( const QgsFeatureRequest& request )
|
QgsFeatureIterator QgsOgrFeatureSource::getFeatures( const QgsFeatureRequest& request )
|
||||||
|
@ -447,7 +447,7 @@ QgsOgrProvider::~QgsOgrProvider()
|
|||||||
|
|
||||||
repack();
|
repack();
|
||||||
|
|
||||||
if( ogrDataSource )
|
if ( ogrDataSource )
|
||||||
{
|
{
|
||||||
OGR_DS_Destroy( ogrDataSource );
|
OGR_DS_Destroy( ogrDataSource );
|
||||||
}
|
}
|
||||||
@ -551,7 +551,7 @@ QString QgsOgrProvider::subsetString()
|
|||||||
QString QgsOgrProvider::ogrWkbGeometryTypeName( OGRwkbGeometryType type ) const
|
QString QgsOgrProvider::ogrWkbGeometryTypeName( OGRwkbGeometryType type ) const
|
||||||
{
|
{
|
||||||
QString geom;
|
QString geom;
|
||||||
switch ( (int)type )
|
switch (( int )type )
|
||||||
{
|
{
|
||||||
case wkbUnknown: geom = "Unknown"; break;
|
case wkbUnknown: geom = "Unknown"; break;
|
||||||
case wkbPoint: geom = "Point"; break;
|
case wkbPoint: geom = "Point"; break;
|
||||||
@ -624,7 +624,7 @@ QStringList QgsOgrProvider::subLayers() const
|
|||||||
|
|
||||||
QgsDebugMsg( QString( "id = %1 name = %2 layerGeomType = %3" ).arg( i ).arg( theLayerName ).arg( layerGeomType ) );
|
QgsDebugMsg( QString( "id = %1 name = %2 layerGeomType = %3" ).arg( i ).arg( theLayerName ).arg( layerGeomType ) );
|
||||||
|
|
||||||
if ( wkbFlatten(layerGeomType) != wkbUnknown )
|
if ( wkbFlatten( layerGeomType ) != wkbUnknown )
|
||||||
{
|
{
|
||||||
int theLayerFeatureCount = OGR_L_GetFeatureCount( layer, 0 );
|
int theLayerFeatureCount = OGR_L_GetFeatureCount( layer, 0 );
|
||||||
|
|
||||||
@ -660,10 +660,10 @@ QStringList QgsOgrProvider::subLayers() const
|
|||||||
{
|
{
|
||||||
fCount[wkbUnknown] = 0;
|
fCount[wkbUnknown] = 0;
|
||||||
}
|
}
|
||||||
bool bIs25D = ( (layerGeomType & wkb25DBit) != 0 );
|
bool bIs25D = (( layerGeomType & wkb25DBit ) != 0 );
|
||||||
foreach ( OGRwkbGeometryType gType, fCount.keys() )
|
foreach ( OGRwkbGeometryType gType, fCount.keys() )
|
||||||
{
|
{
|
||||||
QString geom = ogrWkbGeometryTypeName( (bIs25D) ? (OGRwkbGeometryType) (gType | wkb25DBit) : gType );
|
QString geom = ogrWkbGeometryTypeName(( bIs25D ) ? ( OGRwkbGeometryType )( gType | wkb25DBit ) : gType );
|
||||||
|
|
||||||
QString sl = QString( "%1:%2:%3:%4" ).arg( i ).arg( theLayerName ).arg( fCount.value( gType ) ).arg( geom );
|
QString sl = QString( "%1:%2:%3:%4" ).arg( i ).arg( theLayerName ).arg( fCount.value( gType ) ).arg( geom );
|
||||||
QgsDebugMsg( "sub layer: " + sl );
|
QgsDebugMsg( "sub layer: " + sl );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user