Skip to content

Commit

Permalink
identation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 2, 2014
1 parent 3d91663 commit df4360b
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion python/gui/qgsfieldcombobox.sip
Expand Up @@ -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 );

Expand Down
8 changes: 4 additions & 4 deletions python/gui/qgsfieldexpressionwidget.sip
Expand Up @@ -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 );

Expand Down
8 changes: 4 additions & 4 deletions python/gui/qgsfieldmodel.sip
Expand Up @@ -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();
Expand All @@ -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();

Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmapcanvas.sip
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmaptool.sip
Expand Up @@ -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
*/
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/core/ProcessingConfig.py
Expand Up @@ -142,10 +142,10 @@ def getSettings():


@staticmethod
def readSettings():
def readSettings():
for setting in ProcessingConfig.settings.values():
setting.read()


@staticmethod
def getSetting(name):
Expand Down Expand Up @@ -177,15 +177,15 @@ def __init__(self, group, name, description, default, hidden=False, valuetype =
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)

Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/gui/ScriptEditorDialog.py
Expand Up @@ -52,7 +52,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor):

SCRIPT_PYTHON = 0
SCRIPT_R = 1

hasChanged = False

def __init__(self, algType, alg):
Expand Down Expand Up @@ -101,7 +101,7 @@ def __init__(self, algType, alg):

self.update = False
self.help = None

self.setHasChanged(False)

self.editor.setLexerType(self.algType)
Expand Down Expand Up @@ -177,7 +177,7 @@ def saveScript(self, saveAs):
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()))
Expand Down
Expand Up @@ -41,7 +41,7 @@ def __init__(self):

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')
Expand Down
Expand Up @@ -40,7 +40,7 @@ def __init__(self):

def getIcon(self):
return QtGui.QIcon(':/processing/images/script.png')

def execute(self):
filename = QtGui.QFileDialog.getOpenFileName(self.toolbox, 'Script files', None,
'*.py')
Expand Down
20 changes: 10 additions & 10 deletions python/plugins/processing/script/scripts/Chainage.py
Expand Up @@ -10,24 +10,24 @@
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)
Expand All @@ -39,7 +39,7 @@ def create_points(feat):
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
Expand Down
Expand Up @@ -28,7 +28,7 @@

# create dictionary for unique values count
count = {}

# count unique values for the given band
for col in range( xsize ):
for row in range( ysize ):
Expand All @@ -37,7 +37,7 @@
# check if cell_value is NaN
if math.isnan(cell_value):
cell_value = 'Null'

# round floats if needed
elif round_values_to_ndigits:
try:
Expand All @@ -51,12 +51,11 @@
except:
count[cell_value] = 1

# print results sorted by cell_value
# print results sorted by cell_value
for key in sorted(count.iterkeys()):
line = "<TD>%s</TD> <TD>%s</TD> <TD>%s</TD>" %(i, key, count[key])
f.write('<TR>'+ line + '</TR>' + '\n')

f.write('</TABLE>')
f.close


5 changes: 3 additions & 2 deletions src/app/composer/qgscomposermanager.cpp
Expand Up @@ -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 );
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/composer/qgscomposermanager.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsidentifyresultsdialog.cpp
Expand Up @@ -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" ) );
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmaptool.cpp
Expand Up @@ -98,15 +98,15 @@ 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() ) );
}

void QgsMapTool::actionDestroyed()
{
if( mAction == sender() )
if ( mAction == sender() )
mAction = 0;
}

Expand Down
6 changes: 3 additions & 3 deletions src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp
Expand Up @@ -7,8 +7,8 @@
#include <QPushButton>

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 );

Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit df4360b

Please sign in to comment.