indentation update

This commit is contained in:
Juergen E. Fischer 2013-08-25 10:45:52 +02:00
parent 8ea742ae8d
commit e8b954537e
27 changed files with 55 additions and 55 deletions

View File

@ -76,7 +76,7 @@ class LayerPreview(QgsMapCanvas):
if self.item is not None:
## skip exception on RuntimeError fixes #6892
try:
self.disconnect(self.item, SIGNAL('aboutToChange'), self.setDirty)
self.disconnect(self.item, SIGNAL('aboutToChange'), self.setDirty)
except RuntimeError:
pass
self.item = None

View File

@ -43,7 +43,7 @@ class ExampleAlgorithm(GeoAlgorithm):
a new one just with just those features of the input layer that are
selected.
It is meant to be used as an example of how to create your own
It is meant to be used as an example of how to create your own
algorithms and explain methods and variables used to do it. An algorithm
like this will be available in all elements, and there is not need
for additional work.

View File

@ -80,7 +80,7 @@ class ExampleAlgorithmProvider(AlgorithmProvider):
def _loadAlgorithms(self):
'''Here we fill the list of algorithms in self.algs.
This method is called whenever the list of algorithms should be updated.
If the list of algorithms can change
If the list of algorithms can change
(for instance, if it contains algorithms from user-defined scripts and
a new script might have been added), you should create the list again
here.

View File

@ -63,7 +63,7 @@ class ProcessingToolbox(QDockWidget, Ui_ProcessingToolbox):
else:
self.modeComboBox.setCurrentIndex(1)
self.modeComboBox.currentIndexChanged.connect(self.modeHasChanged)
self.searchBox.textChanged.connect(self.fillTree)
self.algorithmTree.customContextMenuRequested.connect(self.showPopupMenu)
self.algorithmTree.doubleClicked.connect(self.executeAlgorithm)

View File

@ -181,7 +181,7 @@ class SagaAlgorithm(GeoAlgorithm):
raise GeoAlgorithmExecutionException("SAGA folder is not configured.\nPlease configure it before running SAGA algorithms.")
commands = list()
self.exportedLayers = {}
self.preProcessInputs()
#1: Export rasters to sgrd and vectors to shp
@ -309,7 +309,7 @@ class SagaAlgorithm(GeoAlgorithm):
else:
commands.append("libio_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 1 -TYPE 0 -FILE \"" + filename + "\"");
#4 Run SAGA
commands = self.editCommands(commands)
SagaUtils.createSagaBatchJobFileFromSagaCommands(commands)
@ -332,7 +332,7 @@ class SagaAlgorithm(GeoAlgorithm):
if hasattr(module, 'preProcessInputs'):
func = getattr(module,'preProcessInputs')
func(self)
def editCommands(self, commands):
name = self.commandLineName()[len('saga:'):]
try:

View File

@ -25,8 +25,8 @@ __revision__ = '$Format:%H$'
from processing.tests.TestData import table
def editCommands(commands):
def editCommands(commands):
commands[-3] = commands[-3] + " -STATS " + table()
return commands
return commands

View File

@ -6192,24 +6192,24 @@ void QgisApp::duplicateLayers( QList<QgsMapLayer *> lyrList )
if ( unSppType.isEmpty() && dupLayer && !dupLayer->isValid() )
{
msgBars.append( new QgsMessageBarItem(
tr( "Duplicate layer: " ),
tr( "%1 (duplication resulted in invalid layer)" ).arg( selectedLyr->name() ) ,
QgsMessageBar::WARNING,
0,
mInfoBar ) );
tr( "Duplicate layer: " ),
tr( "%1 (duplication resulted in invalid layer)" ).arg( selectedLyr->name() ) ,
QgsMessageBar::WARNING,
0,
mInfoBar ) );
continue;
}
if ( !unSppType.isEmpty() || !dupLayer )
{
msgBars.append( new QgsMessageBarItem(
tr( "Duplicate layer: " ),
tr( "%1 (%2 type unsupported)" )
.arg( selectedLyr->name() )
.arg( !unSppType.isEmpty() ? QString( "'" ) + unSppType + "' " : "" ),
QgsMessageBar::WARNING,
0,
mInfoBar ) );
tr( "Duplicate layer: " ),
tr( "%1 (%2 type unsupported)" )
.arg( selectedLyr->name() )
.arg( !unSppType.isEmpty() ? QString( "'" ) + unSppType + "' " : "" ),
QgsMessageBar::WARNING,
0,
mInfoBar ) );
continue;
}

View File

@ -201,8 +201,8 @@ void QgsAbout::setLicence()
#endif
if ( licenceFile.open( QIODevice::ReadOnly ) )
{
QString content = licenceFile.readAll();
txtLicense->setText(content);
QString content = licenceFile.readAll();
txtLicense->setText( content );
}
}

View File

@ -174,7 +174,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
{
//problem with coordinate transformation
QMessageBox::information( 0, tr( "Coordinate transform error" ),
tr( "Cannot transform the point to the layers coordinate system" ) );
tr( "Cannot transform the point to the layers coordinate system" ) );
return;
}

View File

@ -92,7 +92,7 @@ void QgsMapToolAddPart::canvasReleaseEvent( QMouseEvent * e )
//add point to list and to rubber band
if ( e->button() == Qt::LeftButton )
{
int error = addVertex( e->pos() );
int error = addVertex( e->pos() );
if ( error == 1 )
{
QgsDebugMsg( "current layer is not a vector layer" );

View File

@ -61,8 +61,8 @@ void QgsMapToolAddRing::canvasReleaseEvent( QMouseEvent * e )
{
//problem with coordinate transformation
QMessageBox::information( 0, tr( "Coordinate transform error" ),
tr( "Cannot transform the point to the layers coordinate system" ) );
return;
tr( "Cannot transform the point to the layers coordinate system" ) );
return;
}
startCapturing();

View File

@ -56,7 +56,7 @@ class QgsMapToolEdit: public QgsMapTool
* @param geometryType
* @param alternativeBand if true, rubber band will be set with more transparency and a dash pattern. defaut is false.
*/
QgsRubberBand* createRubberBand(QGis::GeometryType geometryType = QGis::Line , bool alternativeBand = false );
QgsRubberBand* createRubberBand( QGis::GeometryType geometryType = QGis::Line , bool alternativeBand = false );
/**Returns the current vector layer of the map canvas or 0*/
QgsVectorLayer* currentVectorLayer();

View File

@ -67,7 +67,7 @@ void QgsMapToolLabel::createRubberBands( )
mLabelRubberBand->addPoint( QgsPoint( rect.xMaximum(), rect.yMaximum() ) );
mLabelRubberBand->addPoint( QgsPoint( rect.xMaximum(), rect.yMinimum() ) );
mLabelRubberBand->addPoint( QgsPoint( rect.xMinimum(), rect.yMinimum() ) );
mLabelRubberBand->setColor( QColor(0,255,0, 65) );
mLabelRubberBand->setColor( QColor( 0, 255, 0, 65 ) );
mLabelRubberBand->setWidth( 3 );
mLabelRubberBand->show();
@ -82,7 +82,7 @@ void QgsMapToolLabel::createRubberBands( )
if ( geom )
{
mFeatureRubberBand = new QgsRubberBand( mCanvas, geom->type() );
mFeatureRubberBand->setColor( QColor(255, 0, 0, 65) );
mFeatureRubberBand->setColor( QColor( 255, 0, 0, 65 ) );
mFeatureRubberBand->setToGeometry( geom, vlayer );
mFeatureRubberBand->show();
}
@ -103,7 +103,7 @@ void QgsMapToolLabel::createRubberBands( )
QgsGeometry* pointGeom = QgsGeometry::fromPoint( fixPoint );
mFixPointRubberBand = new QgsRubberBand( mCanvas, QGis::Line );
mFixPointRubberBand->setColor( QColor(0, 0, 255, 65) );
mFixPointRubberBand->setColor( QColor( 0, 0, 255, 65 ) );
mFixPointRubberBand->setToGeometry( pointGeom, vlayer );
mFixPointRubberBand->show();
delete pointGeom;

View File

@ -127,7 +127,7 @@ void QgsMapToolMoveFeature::canvasPressEvent( QMouseEvent * e )
}
mStartPointMapCoords = toMapCoordinates( e->pos() );
mRubberBand->setColor( QColor(255, 0, 0, 65) );
mRubberBand->setColor( QColor( 255, 0, 0, 65 ) );
mRubberBand->setWidth( 2 );
mRubberBand->show();

View File

@ -60,7 +60,7 @@ void QgsMapToolReshape::canvasReleaseEvent( QMouseEvent * e )
{
//problem with coordinate transformation
QMessageBox::information( 0, tr( "Coordinate transform error" ),
tr( "Cannot transform the point to the layers coordinate system" ) );
tr( "Cannot transform the point to the layers coordinate system" ) );
return;
}

View File

@ -169,7 +169,7 @@ void QgsMapToolRotateFeature::canvasPressEvent( QMouseEvent * e )
}
}
mRubberBand->setColor( QColor(255, 0, 0, 65) );
mRubberBand->setColor( QColor( 255, 0, 0, 65 ) );
mRubberBand->setWidth( 2 );
mRubberBand->show();

View File

@ -198,7 +198,7 @@ QgsRubberBand* QgsMapToolRotateLabel::createRotationPreviewBox()
}
mRotationPreviewBox = new QgsRubberBand( mCanvas, QGis::Line );
mRotationPreviewBox->setColor( QColor(0, 0, 255, 65));
mRotationPreviewBox->setColor( QColor( 0, 0, 255, 65 ) );
mRotationPreviewBox->setWidth( 3 );
setRotationPreviewBox( mCurrentRotation - mStartRotation );
return mRotationPreviewBox;

View File

@ -299,7 +299,7 @@ void QgsMapToolSimplify::canvasPressEvent( QMouseEvent * e )
mRubberBand = new QgsRubberBand( mCanvas );
mRubberBand->setToGeometry( mSelectedFeature.geometry(), 0 );
mRubberBand->setColor( QColor(255, 0, 0, 65) );
mRubberBand->setColor( QColor( 255, 0, 0, 65 ) );
mRubberBand->setWidth( 2 );
mRubberBand->show();
//calculate boudaries for slidebar

View File

@ -640,7 +640,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
myBlue = settings.value( "/qgis/digitizing/line_color_blue", 0 ).toInt();
myAlpha = settings.value( "/qgis/digitizing/line_color_alpha", 200 ).toInt();
mLineColorToolButton->setColor( QColor( myRed, myGreen, myBlue, myAlpha ) );
mLineColorToolButton->setColorDialogOptions(QColorDialog::ShowAlphaChannel);
mLineColorToolButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
//default snap mode
mDefaultSnapModeComboBox->insertItem( 0, tr( "To vertex" ), "to vertex" );

View File

@ -465,7 +465,7 @@ void QgsMapRenderer::render( QPainter* painter, double* forceWidthScale )
mRenderContext.painter()->device()->height(), QImage::Format_ARGB32 );
if ( mypImage->isNull() )
{
QgsDebugMsg( "insufficient memory for image " + QString::number(mRenderContext.painter()->device()->width()) + "x" + QString::number(mRenderContext.painter()->device()->height()) );
QgsDebugMsg( "insufficient memory for image " + QString::number( mRenderContext.painter()->device()->width() ) + "x" + QString::number( mRenderContext.painter()->device()->height() ) );
emit drawError( ml );
painter->end(); // drawError is not caught by anyone, so we end painting to notify caller
return;
@ -510,7 +510,7 @@ void QgsMapRenderer::render( QPainter* painter, double* forceWidthScale )
mRenderContext.painter()->device()->height(), QImage::Format_ARGB32 );
if ( mypFlattenedImage->isNull() )
{
QgsDebugMsg( "insufficient memory for image " + QString::number(mRenderContext.painter()->device()->width()) + "x" + QString::number(mRenderContext.painter()->device()->height()) );
QgsDebugMsg( "insufficient memory for image " + QString::number( mRenderContext.painter()->device()->width() ) + "x" + QString::number( mRenderContext.painter()->device()->height() ) );
emit drawError( ml );
painter->end(); // drawError is not caught by anyone, so we end painting to notify caller
return;

View File

@ -3858,7 +3858,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
}
//layer names
QString layerName = QString::fromUtf8( ( *it )->getLayerName() );
QString layerName = QString::fromUtf8(( *it )->getLayerName() );
if ( palGeometry->isDiagram() )
{
//render diagram

View File

@ -552,8 +552,8 @@ void QgsAttributeDialog::dialogDestroyed()
if ( !mReturnvarname.isEmpty() )
{
QString expr = QString( "if locals().has_key('%1'): del %1\n" ).arg( mReturnvarname );
QgsPythonRunner::run( expr );
QString expr = QString( "if locals().has_key('%1'): del %1\n" ).arg( mReturnvarname );
QgsPythonRunner::run( expr );
}
mDialog = NULL;

View File

@ -36,7 +36,7 @@ QgsMessageBarItem::QgsMessageBarItem( const QString &text, QgsMessageBar::Messag
writeContent();
}
QgsMessageBarItem::QgsMessageBarItem(const QString &title, const QString &text, QgsMessageBar::MessageLevel level, int duration , QWidget *parent ) :
QgsMessageBarItem::QgsMessageBarItem( const QString &title, const QString &text, QgsMessageBar::MessageLevel level, int duration , QWidget *parent ) :
QWidget( parent )
, mTitle( title )
, mText( text )

View File

@ -153,11 +153,11 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin
connect( mClear, SIGNAL( clicked( bool ) ), this, SLOT( clear() ) );
mrbFrontPoint = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Polygon );
mrbFrontPoint->setColor( QColor(0, 255, 0, 65) );
mrbFrontPoint->setColor( QColor( 0, 255, 0, 65 ) );
mrbFrontPoint->setWidth( 2 );
mrbBackPoint = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Polygon );
mrbBackPoint->setColor( QColor(255, 0, 0, 65) );
mrbBackPoint->setColor( QColor( 255, 0, 0, 65 ) );
mrbBackPoint->setWidth( 2 );
mrbPath = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Line );

View File

@ -71,9 +71,9 @@ checkDock::checkDock( QgisInterface* qIface, QWidget* parent )
mRBFeature2 = new QgsRubberBand( canvas );
mRBConflict = new QgsRubberBand( canvas );
mRBFeature1->setColor( QColor(0, 0, 255, 65) );
mRBFeature2->setColor( QColor(0, 255, 0, 65) );
mRBConflict->setColor( QColor(255, 0, 0, 65) );
mRBFeature1->setColor( QColor( 0, 0, 255, 65 ) );
mRBFeature2->setColor( QColor( 0, 255, 0, 65 ) );
mRBConflict->setColor( QColor( 255, 0, 0, 65 ) );
mRBFeature1->setWidth( 5 );
mRBFeature2->setWidth( 5 );

View File

@ -870,7 +870,7 @@ QgsFeatureIterator QgsDelimitedTextProvider::getFeatures( const QgsFeatureReques
{
// If the file has become invalid, rescan to check that it is still invalid.
//
if ( (mLayerValid && ! mValid) || mRescanRequired ) rescanFile();
if (( mLayerValid && ! mValid ) || mRescanRequired ) rescanFile();
return QgsFeatureIterator( new QgsDelimitedTextFeatureIterator( this, request ) );
}
@ -1055,7 +1055,7 @@ void QgsDelimitedTextProvider::setUriParameter( QString parameter, QString value
void QgsDelimitedTextProvider::onFileUpdated()
{
if( ! mRescanRequired )
if ( ! mRescanRequired )
{
QStringList messages;
messages.append( tr( "The file has been updated by another application - reloading" ) );
@ -1091,7 +1091,7 @@ bool QgsDelimitedTextProvider::nextFeature( QgsFeature& feature, QgsDelimitedTex
// feature.
feature.setValid( false );
if( ! mValid ) break;
if ( ! mValid ) break;
QgsDelimitedTextFile::Status status = file->nextRecord( tokens );
if ( status == QgsDelimitedTextFile::RecordEOF ) break;
@ -1261,7 +1261,7 @@ void QgsDelimitedTextProvider::fetchAttribute( QgsFeature& feature, int fieldIdx
// Return the extent of the layer
QgsRectangle QgsDelimitedTextProvider::extent()
{
if( mRescanRequired ) rescanFile();
if ( mRescanRequired ) rescanFile();
return mExtent;
}
@ -1278,7 +1278,7 @@ QGis::WkbType QgsDelimitedTextProvider::geometryType() const
*/
long QgsDelimitedTextProvider::featureCount() const
{
if( mRescanRequired ) const_cast<QgsDelimitedTextProvider *>(this)->rescanFile();
if ( mRescanRequired ) const_cast<QgsDelimitedTextProvider *>( this )->rescanFile();
return mNumberFeatures;
}

View File

@ -144,7 +144,7 @@ void GRASS_LIB_EXPORT QgsGrass::init( void )
QgsDebugMsg( QString( "GRASS gisBase = %1" ).arg( gisBase ) );
#elif defined(Q_OS_MACX)
// check for bundled GRASS, fall back to configured path
gisBase = QCoreApplication::applicationDirPath().append("/grass") ;
gisBase = QCoreApplication::applicationDirPath().append( "/grass" ) ;
if ( !isValidGrassBaseDir( gisBase ) )
{
gisBase = GRASS_BASE;