From df4360b0c8b3f5080917209a9ce654aece1adf56 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Fri, 2 May 2014 10:32:37 +0200 Subject: [PATCH] identation update --- python/gui/qgsfieldcombobox.sip | 2 +- python/gui/qgsfieldexpressionwidget.sip | 8 ++++---- python/gui/qgsfieldmodel.sip | 8 ++++---- python/gui/qgsmapcanvas.sip | 2 +- python/gui/qgsmaptool.sip | 2 +- .../processing/core/ProcessingConfig.py | 10 +++++----- .../processing/gui/ScriptEditorDialog.py | 6 +++--- .../modeler/AddModelFromFileAction.py | 2 +- .../script/AddScriptFromFileAction.py | 2 +- .../processing/script/scripts/Chainage.py | 20 +++++++++---------- .../script/scripts/Unique_values_count.py | 9 ++++----- src/app/composer/qgscomposermanager.cpp | 5 +++-- src/app/composer/qgscomposermanager.h | 4 ++-- src/app/qgisapp.cpp | 2 +- src/app/qgsidentifyresultsdialog.cpp | 2 +- src/gui/qgsmaptool.cpp | 4 ++-- .../qgsdatadefinedsymboldialog.cpp | 6 +++--- 17 files changed, 47 insertions(+), 47 deletions(-) diff --git a/python/gui/qgsfieldcombobox.sip b/python/gui/qgsfieldcombobox.sip index a633017423e..2a0b3c90b27 100644 --- a/python/gui/qgsfieldcombobox.sip +++ b/python/gui/qgsfieldcombobox.sip @@ -32,7 +32,7 @@ class QgsFieldComboBox : QComboBox public slots: //! set the layer of which the fields are listed void setLayer( QgsVectorLayer* layer ); - + //! convenience slot to connect QgsMapLayerComboBox layer signal void setLayer( QgsMapLayer* layer ); diff --git a/python/gui/qgsfieldexpressionwidget.sip b/python/gui/qgsfieldexpressionwidget.sip index 1039e22e207..a4fe77b17a8 100644 --- a/python/gui/qgsfieldexpressionwidget.sip +++ b/python/gui/qgsfieldexpressionwidget.sip @@ -27,16 +27,16 @@ class QgsFieldExpressionWidget : QWidget QgsVectorLayer* layer(); signals: - //! the signal is emitted when the currently selected field changes - void fieldChanged( QString fieldName ); - + //! the signal is emitted when the currently selected field changes + void fieldChanged( QString fieldName ); + //! fieldChanged signal with indication of the validity of the expression void fieldChanged( QString fieldName, bool isValid ); public slots: //! set the layer used to display the fields and expression void setLayer( QgsVectorLayer* layer ); - + //! convenience slot to connect QgsMapLayerComboBox layer signal void setLayer( QgsMapLayer* layer ); diff --git a/python/gui/qgsfieldmodel.sip b/python/gui/qgsfieldmodel.sip index 9eee025435d..52aa3f4a08d 100644 --- a/python/gui/qgsfieldmodel.sip +++ b/python/gui/qgsfieldmodel.sip @@ -28,7 +28,7 @@ class QgsFieldModel : QAbstractItemModel //! return the index corresponding to a given fieldName QModelIndex indexFromName( QString fieldName ); - + //! returns the currently used layer void setAllowExpression( bool allowExpression ); bool allowExpression(); @@ -38,7 +38,7 @@ class QgsFieldModel : QAbstractItemModel * @return the model index of the newly added expression */ QModelIndex setExpression( QString expression ); - + //! remove expressions from the model void removeExpression(); @@ -48,10 +48,10 @@ class QgsFieldModel : QAbstractItemModel public slots: //! set the layer of whch fields are displayed void setLayer( QgsVectorLayer *layer ); - + protected slots: virtual void updateModel(); - + // QAbstractItemModel interface public: QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const; diff --git a/python/gui/qgsmapcanvas.sip b/python/gui/qgsmapcanvas.sip index 934514ae5b5..b2870c931d1 100644 --- a/python/gui/qgsmapcanvas.sip +++ b/python/gui/qgsmapcanvas.sip @@ -354,7 +354,7 @@ class QgsMapCanvas : QGraphicsView //! Emit map tool changed event void mapToolSet( QgsMapTool *tool ); - + //! Emit map tool changed with the old tool //! @note added in 2.3 void mapToolSet( QgsMapTool *newTool, QgsMapTool* oldTool ); diff --git a/python/gui/qgsmaptool.sip b/python/gui/qgsmaptool.sip index d19466a78a9..639910006ae 100644 --- a/python/gui/qgsmaptool.sip +++ b/python/gui/qgsmaptool.sip @@ -105,7 +105,7 @@ class QgsMapTool : QObject //! returns pointer to the tool's map canvas QgsMapCanvas* canvas(); - + /** return the tool name * @note added in 2.3 */ diff --git a/python/plugins/processing/core/ProcessingConfig.py b/python/plugins/processing/core/ProcessingConfig.py index 7f68f9045d6..be9e79a5678 100644 --- a/python/plugins/processing/core/ProcessingConfig.py +++ b/python/plugins/processing/core/ProcessingConfig.py @@ -142,10 +142,10 @@ class ProcessingConfig: @staticmethod - def readSettings(): + def readSettings(): for setting in ProcessingConfig.settings.values(): setting.read() - + @staticmethod def getSetting(name): @@ -177,15 +177,15 @@ class Setting: self.value = default self.hidden = hidden self.valuetype = valuetype - + def read(self): - qsettings = QSettings() + qsettings = QSettings() value = qsettings.value(self.qname, None) if value is not None: if isinstance(self.value, bool): value = str(value).lower() == str(True).lower() self.value = value - + def save(self): QSettings().setValue(self.qname, self.value) diff --git a/python/plugins/processing/gui/ScriptEditorDialog.py b/python/plugins/processing/gui/ScriptEditorDialog.py index bbee64e590f..33b842bd364 100644 --- a/python/plugins/processing/gui/ScriptEditorDialog.py +++ b/python/plugins/processing/gui/ScriptEditorDialog.py @@ -52,7 +52,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor): SCRIPT_PYTHON = 0 SCRIPT_R = 1 - + hasChanged = False def __init__(self, algType, alg): @@ -101,7 +101,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor): self.update = False self.help = None - + self.setHasChanged(False) self.editor.setLexerType(self.algType) @@ -177,7 +177,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor): def setHasChanged(self, hasChanged): self.hasChanged = hasChanged self.btnSave.setEnabled(hasChanged) - + def runAlgorithm(self): if self.algType == self.SCRIPT_PYTHON: alg = ScriptAlgorithm(None, unicode(self.editor.text())) diff --git a/python/plugins/processing/modeler/AddModelFromFileAction.py b/python/plugins/processing/modeler/AddModelFromFileAction.py index 7a41798f19e..aad8e990438 100644 --- a/python/plugins/processing/modeler/AddModelFromFileAction.py +++ b/python/plugins/processing/modeler/AddModelFromFileAction.py @@ -41,7 +41,7 @@ class AddModelFromFileAction(ToolboxAction): def getIcon(self): return QtGui.QIcon(os.path.dirname(__file__) + '/../images/model.png') - + def execute(self): filename = QtGui.QFileDialog.getOpenFileName(self.toolbox, 'model files', None, '*.model') diff --git a/python/plugins/processing/script/AddScriptFromFileAction.py b/python/plugins/processing/script/AddScriptFromFileAction.py index a7d1a25fa59..6a99d6ee0c8 100644 --- a/python/plugins/processing/script/AddScriptFromFileAction.py +++ b/python/plugins/processing/script/AddScriptFromFileAction.py @@ -40,7 +40,7 @@ class AddScriptFromFileAction(ToolboxAction): def getIcon(self): return QtGui.QIcon(':/processing/images/script.png') - + def execute(self): filename = QtGui.QFileDialog.getOpenFileName(self.toolbox, 'Script files', None, '*.py') diff --git a/python/plugins/processing/script/scripts/Chainage.py b/python/plugins/processing/script/scripts/Chainage.py index 962fcfb4c7c..eee146a4aa2 100644 --- a/python/plugins/processing/script/scripts/Chainage.py +++ b/python/plugins/processing/script/scripts/Chainage.py @@ -10,24 +10,24 @@ from PyQt4.QtCore import * from processing.core.VectorWriter import VectorWriter -def create_points(feat): - geom = feat.geometry() +def create_points(feat): + geom = feat.geometry() length = geom.length() currentdistance = 0 if endpoint > 0: length = endpoint - + out = QgsFeature() - while startpoint + currentdistance <= length: - point = geom.interpolate(startpoint + currentdistance) + while startpoint + currentdistance <= length: + point = geom.interpolate(startpoint + currentdistance) currentdistance = currentdistance + distance - out.setGeometry(point) - attrs = feat.attributes() - attrs.append(currentdistance) + out.setGeometry(point) + attrs = feat.attributes() + attrs.append(currentdistance) out.setAttributes(attrs) - writer.addFeature(out) + writer.addFeature(out) layer = processing.getObject(lines) @@ -39,7 +39,7 @@ writer = VectorWriter(output, None, fields, QGis.WKBPoint, feats = processing.features(layer) nFeat = len(feats) for i, feat in enumerate(feats): - progress.setPercentage(int(100 * i / nFeat)) + progress.setPercentage(int(100 * i / nFeat)) create_points(feat) del writer diff --git a/python/plugins/processing/script/scripts/Unique_values_count.py b/python/plugins/processing/script/scripts/Unique_values_count.py index ea46d1228c8..bf466803ca3 100644 --- a/python/plugins/processing/script/scripts/Unique_values_count.py +++ b/python/plugins/processing/script/scripts/Unique_values_count.py @@ -28,7 +28,7 @@ for i in xrange(1, bands + 1): # create dictionary for unique values count count = {} - + # count unique values for the given band for col in range( xsize ): for row in range( ysize ): @@ -37,7 +37,7 @@ for i in xrange(1, bands + 1): # check if cell_value is NaN if math.isnan(cell_value): cell_value = 'Null' - + # round floats if needed elif round_values_to_ndigits: try: @@ -51,12 +51,11 @@ for i in xrange(1, bands + 1): except: count[cell_value] = 1 - # print results sorted by cell_value + # print results sorted by cell_value for key in sorted(count.iterkeys()): line = "%s %s %s" %(i, key, count[key]) f.write(''+ line + '' + '\n') - + f.write('') f.close - \ No newline at end of file diff --git a/src/app/composer/qgscomposermanager.cpp b/src/app/composer/qgscomposermanager.cpp index 14b26bcaf29..fba3e2528d1 100644 --- a/src/app/composer/qgscomposermanager.cpp +++ b/src/app/composer/qgscomposermanager.cpp @@ -284,9 +284,10 @@ void QgsComposerManager::openLocalDirectory( const QString& localDirPath ) } #ifdef Q_WS_MAC -void QgsComposerManager::showEvent(QShowEvent* event) +void QgsComposerManager::showEvent( QShowEvent* event ) { - if(!event->spontaneous()) { + if ( !event->spontaneous() ) + { QgisApp::instance()->addWindow( mWindowAction ); } } diff --git a/src/app/composer/qgscomposermanager.h b/src/app/composer/qgscomposermanager.h index 259e2ce7111..b13cc89d183 100644 --- a/src/app/composer/qgscomposermanager.h +++ b/src/app/composer/qgscomposermanager.h @@ -54,8 +54,8 @@ class QgsComposerManager: public QDialog, private Ui::QgsComposerManagerBase QString mUserTemplatesDir; #ifdef Q_WS_MAC - void showEvent(QShowEvent *event); - void changeEvent(QEvent *); + void showEvent( QShowEvent *event ); + void changeEvent( QEvent * ); QAction* mWindowAction; #endif diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 390148c744f..a68bac619d4 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -1229,7 +1229,7 @@ void QgisApp::showPythonDialog() { QString className, text; mPythonUtils->getError( className, text ); - messageBar()->pushMessage( tr( "Error" ), tr( "Failed to open Python console:" ) + "\n" + className + ": " + text, QgsMessageBar::WARNING); + messageBar()->pushMessage( tr( "Error" ), tr( "Failed to open Python console:" ) + "\n" + className + ": " + text, QgsMessageBar::WARNING ); } #ifdef Q_WS_MAC else diff --git a/src/app/qgsidentifyresultsdialog.cpp b/src/app/qgsidentifyresultsdialog.cpp index 794687bd9df..5a00550a069 100644 --- a/src/app/qgsidentifyresultsdialog.cpp +++ b/src/app/qgsidentifyresultsdialog.cpp @@ -1101,7 +1101,7 @@ void QgsIdentifyResultsDialog::handleCurrentItemChanged( QTreeWidgetItem *curren mOpenFormButton->setEnabled( featItem && featItem->feature().isValid() ); QgsVectorLayer *vlayer = vectorLayer( current ); - if( vlayer ) + if ( vlayer ) { mOpenFormButton->setToolTip( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) ); } diff --git a/src/gui/qgsmaptool.cpp b/src/gui/qgsmaptool.cpp index d267e595851..58f4d61619f 100644 --- a/src/gui/qgsmaptool.cpp +++ b/src/gui/qgsmaptool.cpp @@ -98,7 +98,7 @@ void QgsMapTool::deactivate() void QgsMapTool::setAction( QAction* action ) { - if( mAction ) + if ( mAction ) disconnect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) ); mAction = action; connect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) ); @@ -106,7 +106,7 @@ void QgsMapTool::setAction( QAction* action ) void QgsMapTool::actionDestroyed() { - if( mAction == sender() ) + if ( mAction == sender() ) mAction = 0; } diff --git a/src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp b/src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp index 8eccdecacaa..9ec26a90848 100644 --- a/src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp +++ b/src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp @@ -7,8 +7,8 @@ #include QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog( const QList< DataDefinedSymbolEntry >& entries, const QgsVectorLayer* vl, QWidget * parent, Qt::WindowFlags f ) - : QDialog( parent, f ) - , mVectorLayer( vl ) + : QDialog( parent, f ) + , mVectorLayer( vl ) { setupUi( this ); @@ -159,7 +159,7 @@ int QgsDataDefinedSymbolDialog::comboIndexForExpressionString( const QString& ex { QString attributeString = expr.trimmed(); int comboIndex = cb->findText( attributeString ); - if ( comboIndex == -1 && attributeString.startsWith( '"' ) && attributeString.endsWith( '"') ) + if ( comboIndex == -1 && attributeString.startsWith( '"' ) && attributeString.endsWith( '"' ) ) { attributeString.remove( 0, 1 ).chop( 1 ); comboIndex = cb->findText( attributeString );