Skip to content

Commit d5dcaa3

Browse files
committedApr 2, 2013
indentation update
1 parent 7d34f02 commit d5dcaa3

File tree

12 files changed

+93
-94
lines changed

12 files changed

+93
-94
lines changed
 

‎python/plugins/sextante/grass/GrassAlgorithmProvider.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,18 @@ def getName(self):
8484

8585
def getIcon(self):
8686
return QIcon(os.path.dirname(__file__) + "/../images/grass.png")
87-
87+
8888
def getPostProcessingErrorMessage(self, wrongLayers):
89-
html = AlgorithmProvider.getPostProcessingErrorMessage(self, wrongLayers)
89+
html = AlgorithmProvider.getPostProcessingErrorMessage(self, wrongLayers)
9090
msg = GrassUtils.checkGrassIsInstalled(True)
91-
html += ("<p>This algorithm requires GRASS to be run. A test to check if GRASS is correctly installed "
91+
html += ("<p>This algorithm requires GRASS to be run. A test to check if GRASS is correctly installed "
9292
"and configured in your system has been performed, with the following result:</p><ul><i>")
9393
if msg is None:
9494
html += "GRASS seems to be correctly installed and configured</li></ul>"
9595
else:
9696
html += msg + "</i></li></ul>"
9797
html += '<p><a href= "http://docs.qgis.org/html/en/docs/user_manual/sextante/3rdParty.html">Click here</a> to know more about how to install and configure GRASS to be used with SEXTANTE</p>'
98-
98+
9999
return html
100100

101101
def getSupportedOutputVectorLayerExtensions(self):

‎python/plugins/sextante/grass/GrassUtils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def checkGrassIsInstalled(ignoreRegistrySettings=False):
343343
if settings.contains(GRASS_INSTALLED):
344344
return
345345

346-
try:
346+
try:
347347
from sextante.core.Sextante import runalg
348348
result = runalg("grass:v.voronoi", points(),False,False,"270778.60198,270855.745301,4458921.97814,4458983.8488",-1,0.0001,None)
349349
if not os.path.exists(result['output']):

‎python/plugins/sextante/gui/SextanteToolbox.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,16 @@ def fillTree(self):
151151

152152
def addRecentAlgorithms(self, updating):
153153
showRecent = SextanteConfig.getSetting(SextanteConfig.SHOW_RECENT_ALGORITHMS)
154-
if showRecent:
154+
if showRecent:
155155
recent = SextanteLog.getRecentAlgorithms()
156156
if len(recent) != 0:
157157
found = False
158158
if updating:
159159
recentItem = self.algorithmTree.topLevelItem(0)
160-
treeWidget = recentItem.treeWidget()
161-
treeWidget.takeTopLevelItem(treeWidget.indexOfTopLevelItem(recentItem))
160+
treeWidget = recentItem.treeWidget()
161+
treeWidget.takeTopLevelItem(treeWidget.indexOfTopLevelItem(recentItem))
162162
#self.algorithmTree.removeItemWidget(first, 0)
163-
163+
164164
recentItem = QTreeWidgetItem()
165165
recentItem.setText(0, self.tr("Recently used algorithms"))
166166
for algname in recent:
@@ -169,7 +169,7 @@ def addRecentAlgorithms(self, updating):
169169
algItem = TreeAlgorithmItem(alg)
170170
recentItem.addChild(algItem)
171171
found = True
172-
if found:
172+
if found:
173173
self.algorithmTree.insertTopLevelItem(0, recentItem)
174174
recentItem.setExpanded(True)
175175

‎python/plugins/sextante/script/scripts/Summarize.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,22 @@
1313
x = 0
1414
y = 0
1515
for ft in features:
16-
c = ft.geometry().centroid().asPoint()
16+
c = ft.geometry().centroid().asPoint()
1717
x += c.x()
18-
y += c.y()
18+
y += c.y()
1919
attrs = ft.attributes()
2020
for f in range(len(fields)):
2121
try:
2222
mean[f] += float(attrs[f].toDouble()[0])
2323
except:
2424
pass
25-
count += 1
25+
count += 1
2626
if count != 0:
2727
mean = [value / count for value in mean]
2828
x /= count
29-
y /= count
30-
outFeat = QgsFeature()
29+
y /= count
30+
outFeat = QgsFeature()
3131
meanPoint = QgsPoint(x, y)
3232
outFeat.setGeometry(QgsGeometry.fromPoint(meanPoint))
3333
outFeat.setAttributes([QVariant(v) for v in mean])
3434
outputLayer.addFeature(outFeat)
35-

‎python/plugins/sextante/tests/SagaTest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_sagametricconversions(self):
1919
dataset=gdal.Open(output, GA_ReadOnly)
2020
strhash=hash(str(dataset.ReadAsArray(0).tolist()))
2121
self.assertEqual(strhash,-2137931723)
22-
22+
2323
def test_sagasortgrid(self):
2424
outputs=sextante.runalg("saga:sortgrid",raster(),True,None)
2525
output=outputs['OUTPUT']
@@ -28,8 +28,8 @@ def test_sagasortgrid(self):
2828
strhash=hash(str(dataset.ReadAsArray(0).tolist()))
2929
self.assertEqual(strhash,1320073153)
3030

31-
'''the following tests are not meant to test the algorithms themselves,
32-
but the algorithm provider, testing things such as the file conversion,
31+
'''the following tests are not meant to test the algorithms themselves,
32+
but the algorithm provider, testing things such as the file conversion,
3333
the selection awareness of SAGA process, etc'''
3434

3535
def test_SagaVectorAlgorithmWithSelection(self):

‎src/gui/attributetable/qgsdualview.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ void QgsDualView::previewColumnChanged( QObject* action )
268268
QMessageBox::warning( this
269269
, tr( "Could not set preview column" )
270270
, tr( "Could not set column '%1' as preview column.\nParser error:\n%2" )
271-
.arg( previewAction->text() )
272-
.arg( mFeatureList->parserErrorString() )
271+
.arg( previewAction->text() )
272+
.arg( mFeatureList->parserErrorString() )
273273
);
274274
}
275275

‎src/gui/qgsnewhttpconnection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ QgsNewHttpConnection::QgsNewHttpConnection(
5555
cbxIgnoreAxisOrientation->setChecked( settings.value( key + "/ignoreAxisOrientation", false ).toBool() );
5656
cbxInvertAxisOrientation->setChecked( settings.value( key + "/invertAxisOrientation", false ).toBool() );
5757
cbxIgnoreGetFeatureInfoURI->setChecked( settings.value( key + "/ignoreGetFeatureInfoURI", false ).toBool() );
58-
58+
5959
txtReferer->setText( settings.value( key + "/referer" ).toString() );
6060

6161
txtUserName->setText( settings.value( credentialsKey + "/username" ).toString() );
@@ -81,7 +81,7 @@ QgsNewHttpConnection::QgsNewHttpConnection(
8181

8282
cbxIgnoreGetFeatureInfoURI->setVisible( false );
8383
mGroupBox->layout()->removeWidget( cbxIgnoreGetFeatureInfoURI );
84-
84+
8585
txtReferer->setVisible( false );
8686
mGroupBox->layout()->removeWidget( txtReferer );
8787
lblReferer->setVisible( false );

‎src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog( const QMap< QString, QPa
2626
QCheckBox* cb = new QCheckBox( this );
2727
cb->setChecked( !it.value().second.isEmpty() );
2828
mTableWidget->setCellWidget( i, 0, cb );
29-
mTableWidget->setColumnWidth(0, cb->width() );
29+
mTableWidget->setColumnWidth( 0, cb->width() );
3030

3131

3232
//property name

‎src/providers/wfs/qgswfssourceselect.cpp

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl, bool emb
9494
mModelProxy->setSortCaseSensitivity( Qt::CaseInsensitive );
9595
treeView->setModel( mModelProxy );
9696

97-
connect( treeView, SIGNAL( doubleClicked(const QModelIndex&) ), this, SLOT( on_treeWidget_itemDoubleClicked(const QModelIndex&) ) );
98-
connect( treeView->selectionModel(), SIGNAL( currentRowChanged ( QModelIndex, QModelIndex) ), this, SLOT( on_treeWidget_currentRowChanged(const QModelIndex&, const QModelIndex&) ) );
97+
connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( on_treeWidget_itemDoubleClicked( const QModelIndex& ) ) );
98+
connect( treeView->selectionModel(), SIGNAL( currentRowChanged( QModelIndex, QModelIndex ) ), this, SLOT( on_treeWidget_currentRowChanged( const QModelIndex&, const QModelIndex& ) ) );
9999
}
100100

101101
QgsWFSSourceSelect::~QgsWFSSourceSelect()
@@ -229,7 +229,7 @@ void QgsWFSSourceSelect::capabilitiesReplyFinished()
229229
cachedItem->setCheckState( Qt::Checked );
230230

231231
typedef QList< QStandardItem* > StandardItemList;
232-
mModel->appendRow( StandardItemList() << titleItem << nameItem << abstractItem << cachedItem << filterItem);
232+
mModel->appendRow( StandardItemList() << titleItem << nameItem << abstractItem << cachedItem << filterItem );
233233

234234
// insert the available CRS into mAvailableCRS
235235
std::list<QString> currentCRSList;
@@ -246,16 +246,16 @@ void QgsWFSSourceSelect::capabilitiesReplyFinished()
246246
treeView->resizeColumnToContents( 1 );
247247
treeView->resizeColumnToContents( 2 );
248248
treeView->resizeColumnToContents( 3 );
249-
for ( int i = 0; i < 2; i++ )
249+
for ( int i = 0; i < 2; i++ )
250250
{
251-
if ( treeView->columnWidth( i ) > 300 )
252-
{
253-
treeView->setColumnWidth( i, 300 );
254-
}
251+
if ( treeView->columnWidth( i ) > 300 )
252+
{
253+
treeView->setColumnWidth( i, 300 );
254+
}
255255
}
256256
if ( treeView->columnWidth( 2 ) > 150 )
257257
{
258-
treeView->setColumnWidth( 2, 150 );
258+
treeView->setColumnWidth( 2, 150 );
259259
}
260260
btnChangeSpatialRefSys->setEnabled( true );
261261
treeView->selectionModel()->select( mModel->index( 0, 0 ), QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows );
@@ -311,7 +311,7 @@ void QgsWFSSourceSelect::connectToServer()
311311
btnConnect->setEnabled( false );
312312
if ( mModel )
313313
{
314-
mModel->removeRows( 0, mModel->rowCount() );
314+
mModel->removeRows( 0, mModel->rowCount() );
315315
}
316316
if ( mCapabilities )
317317
{
@@ -382,7 +382,7 @@ void QgsWFSSourceSelect::addLayer()
382382
QString layerName = typeName;
383383
if ( cbxUseTitleLayerName->isChecked() && !titleName.isEmpty() )
384384
{
385-
layerName = titleName;
385+
layerName = titleName;
386386
}
387387
QgsDebugMsg( "Layer " + typeName + " Filter is " + filter );
388388
//is "cache features" checked?
@@ -401,44 +401,44 @@ void QgsWFSSourceSelect::addLayer()
401401

402402
void QgsWFSSourceSelect::buildQuery( const QModelIndex& index )
403403
{
404-
if ( !index.isValid() )
405-
{
406-
return;
407-
}
408-
QModelIndex filterIndex = index.sibling( index.row(), 4 );
409-
QString typeName = index.sibling( index.row(), 1 ).data().toString();
410-
411-
//get available fields for wfs layer
412-
QgsWFSProvider p( "" ); //bypasses most provider instantiation logic
413-
QgsOWSConnection connection( "WFS", cmbConnections->currentText() );
414-
QgsWFSCapabilities conn( connection.uri().encodedUri() );
415-
QString uri = conn.uriDescribeFeatureType( typeName );
416-
417-
QgsFields fields;
418-
QString geometryAttribute;
419-
QGis::WkbType geomType;
420-
if ( p.describeFeatureType( uri, geometryAttribute, fields, geomType ) != 0 )
421-
{
422-
return;
423-
}
404+
if ( !index.isValid() )
405+
{
406+
return;
407+
}
408+
QModelIndex filterIndex = index.sibling( index.row(), 4 );
409+
QString typeName = index.sibling( index.row(), 1 ).data().toString();
424410

425-
//show expression builder
426-
QgsExpressionBuilderDialog d( 0, filterIndex.data().toString() );
411+
//get available fields for wfs layer
412+
QgsWFSProvider p( "" ); //bypasses most provider instantiation logic
413+
QgsOWSConnection connection( "WFS", cmbConnections->currentText() );
414+
QgsWFSCapabilities conn( connection.uri().encodedUri() );
415+
QString uri = conn.uriDescribeFeatureType( typeName );
427416

428-
//add available attributes to expression builder
429-
QgsExpressionBuilderWidget* w = d.expressionBuilder();
430-
if ( !w )
431-
{
432-
return;
433-
}
417+
QgsFields fields;
418+
QString geometryAttribute;
419+
QGis::WkbType geomType;
420+
if ( p.describeFeatureType( uri, geometryAttribute, fields, geomType ) != 0 )
421+
{
422+
return;
423+
}
434424

435-
w->loadFieldNames( fields );
425+
//show expression builder
426+
QgsExpressionBuilderDialog d( 0, filterIndex.data().toString() );
436427

437-
if ( d.exec() == QDialog::Accepted )
438-
{
439-
QgsDebugMsg( "Expression text = " + w->expressionText() );
440-
mModelProxy->setData( filterIndex, QVariant( w->expressionText() ) );
441-
}
428+
//add available attributes to expression builder
429+
QgsExpressionBuilderWidget* w = d.expressionBuilder();
430+
if ( !w )
431+
{
432+
return;
433+
}
434+
435+
w->loadFieldNames( fields );
436+
437+
if ( d.exec() == QDialog::Accepted )
438+
{
439+
QgsDebugMsg( "Expression text = " + w->expressionText() );
440+
mModelProxy->setData( filterIndex, QVariant( w->expressionText() ) );
441+
}
442442
}
443443

444444
void QgsWFSSourceSelect::changeCRS()
@@ -452,7 +452,7 @@ void QgsWFSSourceSelect::changeCRS()
452452

453453
void QgsWFSSourceSelect::changeCRSFilter()
454454
{
455-
QgsDebugMsg("changeCRSFilter called");
455+
QgsDebugMsg( "changeCRSFilter called" );
456456
//evaluate currently selected typename and set the CRS filter in mProjectionSelector
457457
QModelIndex currentIndex = treeView->selectionModel()->currentIndex();
458458
if ( currentIndex.isValid() )
@@ -527,7 +527,7 @@ void QgsWFSSourceSelect::on_treeWidget_itemDoubleClicked( const QModelIndex& ind
527527
buildQuery( index );
528528
}
529529

530-
void QgsWFSSourceSelect::on_treeWidget_currentRowChanged( const QModelIndex & current, const QModelIndex & previous)
530+
void QgsWFSSourceSelect::on_treeWidget_currentRowChanged( const QModelIndex & current, const QModelIndex & previous )
531531
{
532532
Q_UNUSED( previous )
533533
QgsDebugMsg( "treeWidget_currentRowChanged called" );
@@ -542,7 +542,7 @@ void QgsWFSSourceSelect::on_mBuildQueryButton_clicked()
542542
buildQuery( treeView->selectionModel()->currentIndex() );
543543
}
544544

545-
void QgsWFSSourceSelect::filterChanged(QString text)
545+
void QgsWFSSourceSelect::filterChanged( QString text )
546546
{
547547
QgsDebugMsg( "WFS FeatureType filter changed to :" + text );
548548
QRegExp::PatternSyntax mySyntax = QRegExp::PatternSyntax( QRegExp::RegExp );
@@ -552,16 +552,16 @@ void QgsWFSSourceSelect::filterChanged(QString text)
552552
mModelProxy->sort( mModelProxy->sortColumn(), mModelProxy->sortOrder() );
553553
}
554554

555-
QSize QgsWFSItemDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
555+
QSize QgsWFSItemDelegate::sizeHint( const QStyleOptionViewItem & option, const QModelIndex & index ) const
556556
{
557-
QVariant indexData;
558-
indexData = index.data(Qt::DisplayRole);
559-
if ( indexData.isNull() )
560-
{
561-
return QSize();
562-
}
563-
QString data = indexData.toString();
564-
QSize size = option.fontMetrics.boundingRect(data).size();
565-
size.setHeight(size.height() + 2);
566-
return size;
557+
QVariant indexData;
558+
indexData = index.data( Qt::DisplayRole );
559+
if ( indexData.isNull() )
560+
{
561+
return QSize();
562+
}
563+
QString data = indexData.toString();
564+
QSize size = option.fontMetrics.boundingRect( data ).size();
565+
size.setHeight( size.height() + 2 );
566+
return size;
567567
}

‎src/providers/wfs/qgswfssourceselect.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ class QgsWFSCapabilities;
3030

3131
class QgsWFSItemDelegate : public QItemDelegate
3232
{
33-
Q_OBJECT
33+
Q_OBJECT
3434

3535
public:
3636

37-
QgsWFSItemDelegate(QObject *parent=0) : QItemDelegate(parent){ }
37+
QgsWFSItemDelegate( QObject *parent = 0 ) : QItemDelegate( parent ) { }
3838

39-
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
39+
virtual QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const;
4040

4141
};
4242

@@ -92,9 +92,9 @@ class QgsWFSSourceSelect: public QDialog, private Ui::QgsWFSSourceSelectBase
9292
void on_btnSave_clicked();
9393
void on_btnLoad_clicked();
9494
void on_treeWidget_itemDoubleClicked( const QModelIndex & index );
95-
void on_treeWidget_currentRowChanged( const QModelIndex & current, const QModelIndex & previous);
95+
void on_treeWidget_currentRowChanged( const QModelIndex & current, const QModelIndex & previous );
9696
void on_mBuildQueryButton_clicked();
97-
void filterChanged(QString text);
97+
void filterChanged( QString text );
9898

9999
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
100100

0 commit comments

Comments
 (0)
Please sign in to comment.