Skip to content
Permalink
Browse files

indentation update/fix (followup 9ab22bd)

  • Loading branch information
jef-n committed Feb 11, 2015
1 parent 10e09bc commit f76d7301a327882bc12a0e022a2dacf62746a62e
@@ -28,8 +28,7 @@

from qgis.core import QgsField, QgsExpression, QgsFeature
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.GeoAlgorithmExecutionException import \
GeoAlgorithmExecutionException
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import ParameterVector
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector
@@ -66,20 +66,20 @@ def getWidgetFromParameter(self, param):
item.setLayer(layers[0])
return item
return ParametersPanel.getWidgetFromParameter(self, param)

def updateDependentFields(self):
sender = self.sender()
if not isinstance(sender, QComboBox):
return
if not sender.name in self.dependentItems:
if sender.name not in self.dependentItems:
return
layer = sender.itemData(sender.currentIndex())
children = self.dependentItems[sender.name]
for child in children:
widget = self.valueItems[child]
if isinstance(widget, FieldsMappingPanel):
widget.setLayer(layer)

def somethingDependsOnThisParameter(self, parent):
for param in self.alg.parameters:
if isinstance(param, ParameterFieldsMapping):
@@ -96,13 +96,13 @@ def __init__(self, alg):

self.mainWidget = FieldsMapperParametersPanel(self, alg)
self.setMainWidget()

def setParamValue(self, param, widget, alg=None):
if isinstance(param, ParameterFieldsMapping):
return param.setValue(widget.value())
return AlgorithmDialog.setParamValue(self, param, widget, alg)


class FieldsMapperModelerParametersDialog(ModelerParametersDialog):

def __init__(self, alg, model, algName=None):
@@ -118,7 +118,7 @@ def getWidgetFromParameter(self, param):
if isinstance(param, ParameterFieldsMapping):
return FieldsMappingPanel()
return ModelerParametersDialog.getWidgetFromParameter(self, param)

def setPreviousValues(self):
ModelerParametersDialog.setPreviousValues(self)
if self._algName is not None:
@@ -454,7 +454,7 @@ def on_model_rowsInserted(self, parent, start, end):

def updateLayerCombo(self):
layers = dataobjects.getVectorLayers()
layers.sort(key = lambda lay: lay.name())
layers.sort(key=lambda lay: lay.name())
for layer in layers:
self.layerCombo.addItem(layer.name(), layer)

@@ -77,7 +77,7 @@ def onRightLayerChange(self):

def updatePredicates(self):
if (isinstance(self.leftLayer, QgsVectorLayer)
and isinstance(self.rightLayer, QgsVectorLayer)):
and isinstance(self.rightLayer, QgsVectorLayer)):
leftType = self.leftLayer.geometryType()
rightType = self.rightLayer.geometryType()
unusablePredicates = self.unusablePredicates[leftType][rightType]
@@ -86,7 +86,7 @@ def updatePredicates(self):
for predicate in ParameterGeometryPredicate.predicates:
widget = self.getWidget(predicate)
widget.setEnabled(predicate in self.enabledPredicated
and not predicate in unusablePredicates)
and predicate not in unusablePredicates)

def setRows(self, rows):
widgets = []
@@ -206,18 +206,18 @@ class QgsBrowserTreeFilterProxyModel : public QSortFilterProxyModel

// returns true if at least one ancestor is accepted by filter
bool filterAcceptsAncestor( const QModelIndex &sourceIndex ) const
{
if ( !mModel )
return true;
{
if ( !mModel )
return true;

QModelIndex sourceParentIndex = mModel->parent( sourceIndex );
if ( !sourceParentIndex.isValid() )
return false;
if ( filterAcceptsItem( sourceParentIndex ) )
return true;
QModelIndex sourceParentIndex = mModel->parent( sourceIndex );
if ( !sourceParentIndex.isValid() )
return false;
if ( filterAcceptsItem( sourceParentIndex ) )
return true;

return filterAcceptsAncestor( sourceParentIndex );
}
return filterAcceptsAncestor( sourceParentIndex );
}

// returns true if at least one descendant s accepted by filter
bool filterAcceptsDescendant( const QModelIndex &sourceIndex ) const
@@ -52,7 +52,7 @@ namespace pal
const char* what() const throw() override
{
return "This set is full...";
}
}
};

/** \brief Thrown when trying to access an empty dada set
@@ -62,7 +62,7 @@ namespace pal
const char* what() const throw() override
{
return "This set is empty...";
}
}
};

/** \brief Thrown when a geometry type is not like expected
@@ -72,7 +72,7 @@ namespace pal
const char* what() const throw() override
{
return "GeometryTypeId is not expected...";
}
}
};

/** \brief Thrown when a geometry type is not like expected
@@ -82,7 +82,7 @@ namespace pal
const char* what() const throw() override
{
return "Geometry Type is unknown";
}
}
};


@@ -93,7 +93,7 @@ namespace pal
const char * what() const throw() override
{
return "No way to compute positions";
}
}
};
};

@@ -53,7 +53,7 @@ namespace pal
const char * what() const throw() override
{
return "Not yet implemented... sorry";
}
}
};

/** \brief Try to access an unknown feature
@@ -63,7 +63,7 @@ namespace pal
const char * what() const throw() override
{
return "Feature not found";
}
}
};

/** \brief Try to access an unknown layer
@@ -73,7 +73,7 @@ namespace pal
const char * what() const throw() override
{
return "Layer not found";
}
}
};

/** \brief layer already exists
@@ -83,7 +83,7 @@ namespace pal
const char * what() const throw() override
{
return "Layers names must be unique";
}
}
};

/** \brief features already exists
@@ -93,7 +93,7 @@ namespace pal
const char * what() const throw() override
{
return "Features IDs must be unique within a layer";
}
}
};

/** \brief thrown when a value is not in the valid scale range
@@ -109,7 +109,7 @@ namespace pal
const char * what() const throw() override
{
return "value not allowed";
}
}
};
};

@@ -522,10 +522,10 @@ class CORE_EXPORT QgsExpression

virtual QStringList referencedColumns() const override { QStringList lst( mNode->referencedColumns() ); foreach ( Node* n, mList->list() ) lst.append( n->referencedColumns() ); return lst; }
virtual bool needsGeometry() const override { bool needs = false; foreach ( Node* n, mList->list() ) needs |= n->needsGeometry(); return needs; }
virtual void accept( Visitor& v ) const override { v.visit( *this ); }
virtual void accept( Visitor& v ) const override { v.visit( *this ); }

protected:
Node* mNode;
protected:
Node* mNode;
NodeList* mList;
bool mNotIn;
};
@@ -35,15 +35,15 @@ class QgisVisitor : public SpatialIndex::IVisitor
: mList( list ) {}

void visitNode( const INode& n ) override
{ Q_UNUSED( n ); }
{ Q_UNUSED( n ); }

void visitData( const IData& d ) override
{
mList.append( d.getIdentifier() );
}

void visitData( std::vector<const IData*>& v ) override
{ Q_UNUSED( v ); }
{ Q_UNUSED( v ); }

private:
QList<QgsFeatureId>& mList;
@@ -56,7 +56,7 @@ class QgsSpatialIndexCopyVisitor : public SpatialIndex::IVisitor
: mNewIndex( newIndex ) {}

void visitNode( const INode& n ) override
{ Q_UNUSED( n ); }
{ Q_UNUSED( n ); }

void visitData( const IData& d ) override
{
@@ -67,7 +67,7 @@ class QgsSpatialIndexCopyVisitor : public SpatialIndex::IVisitor
}

void visitData( std::vector<const IData*>& v ) override
{ Q_UNUSED( v ); }
{ Q_UNUSED( v ); }

private:
SpatialIndex::ISpatialIndex* mNewIndex;
@@ -226,7 +226,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
virtual QStringList subLayers() const override
{
return QStringList();
}
}

/** \brief Returns the legend rendered as pixmap
*
@@ -107,9 +107,9 @@ class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetadata

virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) override { return mCreateFunc ? mCreateFunc( elem ) : NULL; }
virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) override
{ return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) : NULL; }
{ return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) : NULL; }
virtual QgsFeatureRendererV2* createRendererFromSld( QDomElement& elem, QGis::GeometryType geomType ) override
{ return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) : NULL; }
{ return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) : NULL; }

//! @note not available in python bindings
QgsRendererV2CreateFunc createFunction() const { return mCreateFunc; }

0 comments on commit f76d730

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