diff --git a/scripts/astyle-all.sh b/scripts/astyle-all.sh index 6410c6e3707..b4ea80821f7 100755 --- a/scripts/astyle-all.sh +++ b/scripts/astyle-all.sh @@ -8,7 +8,7 @@ export elcr="$(tput el)$(tput cr)" find src -type f -print | while read f; do case "$f" in - src/app/gps/qwtpolar-*|src/core/spatialite/*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/pyspatialite/*|src/providers/sqlanywhere/sqlanyconnection/*) + src/app/gps/qwtpolar-*|src/app/qtmain_android.cpp|src/core/spatialite/*|src/core/spatialindex/src/*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/pyspatialite/*|src/providers/sqlanywhere/sqlanyconnection/*) echo $f skipped continue ;; @@ -22,7 +22,7 @@ find src -type f -print | while read f; do ;; *) - echo $f skipped + echo -ne "$f skipped $elcr" continue ;; esac diff --git a/src/analysis/raster/qgshillshadefilter.cpp b/src/analysis/raster/qgshillshadefilter.cpp index a35b4b0aa31..5d72d044d49 100644 --- a/src/analysis/raster/qgshillshadefilter.cpp +++ b/src/analysis/raster/qgshillshadefilter.cpp @@ -18,8 +18,10 @@ #include "qgshillshadefilter.h" QgsHillshadeFilter::QgsHillshadeFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat, double lightAzimuth, - double lightAngle): \ - QgsDerivativeFilter( inputFile, outputFile, outputFormat ), mLightAzimuth( lightAzimuth ), mLightAngle( lightAngle ) + double lightAngle ) + : QgsDerivativeFilter( inputFile, outputFile, outputFormat ) + , mLightAzimuth( lightAzimuth ) + , mLightAngle( lightAngle ) { } @@ -27,8 +29,9 @@ QgsHillshadeFilter::~QgsHillshadeFilter() { } -float QgsHillshadeFilter::processNineCellWindow( float* x11, float* x21, float* x31, \ - float* x12, float* x22, float* x32, float* x13, float* x23, float* x33 ) +float QgsHillshadeFilter::processNineCellWindow( float* x11, float* x21, float* x31, + float* x12, float* x22, float* x32, + float* x13, float* x23, float* x33 ) { float derX = calcFirstDerX( x11, x21, x31, x12, x22, x32, x13, x23, x33 ); float derY = calcFirstDerY( x11, x21, x31, x12, x22, x32, x13, x23, x33 ); @@ -42,7 +45,7 @@ float QgsHillshadeFilter::processNineCellWindow( float* x11, float* x21, float* float slope_rad = atan( sqrt( derX * derX + derY * derY ) ); float azimuth_rad = mLightAzimuth * M_PI / 180.0; float aspect_rad = 0; - if( derX == 0 && derY == 0 ) //aspect undefined, take a neutral value. Better solutions? + if ( derX == 0 && derY == 0 ) //aspect undefined, take a neutral value. Better solutions? { aspect_rad = azimuth_rad / 2.0; } @@ -50,5 +53,5 @@ float QgsHillshadeFilter::processNineCellWindow( float* x11, float* x21, float* { aspect_rad = M_PI + atan2( derX, derY ); } - return qMax( 0.0, 255.0 * ( ( cos( zenith_rad ) * cos( slope_rad ) ) + ( sin( zenith_rad ) * sin( slope_rad ) * cos( azimuth_rad - aspect_rad ) ) ) ); + return qMax( 0.0, 255.0 * (( cos( zenith_rad ) * cos( slope_rad ) ) + ( sin( zenith_rad ) * sin( slope_rad ) * cos( azimuth_rad - aspect_rad ) ) ) ); } diff --git a/src/analysis/raster/qgshillshadefilter.h b/src/analysis/raster/qgshillshadefilter.h index 87e64b764a5..d3f25b1a23a 100644 --- a/src/analysis/raster/qgshillshadefilter.h +++ b/src/analysis/raster/qgshillshadefilter.h @@ -24,18 +24,19 @@ class ANALYSIS_EXPORT QgsHillshadeFilter: public QgsDerivativeFilter { public: QgsHillshadeFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat, double lightAzimuth = 300, - double lightAngle = 40 ); + double lightAngle = 40 ); ~QgsHillshadeFilter(); - /**Calculates output value from nine input values. The input values and the output value can be equal to the \ + /**Calculates output value from nine input values. The input values and the output value can be equal to the nodata value if not present or outside of the border. Must be implemented by subclasses*/ - float processNineCellWindow( float* x11, float* x21, float* x31, \ - float* x12, float* x22, float* x32, float* x13, float* x23, float* x33 ); + float processNineCellWindow( float* x11, float* x21, float* x31, + float* x12, float* x22, float* x32, + float* x13, float* x23, float* x33 ); float lightAzimuth() const { return mLightAzimuth; } - void setLightAzimuth( float azimuth ){ mLightAzimuth = azimuth; } + void setLightAzimuth( float azimuth ) { mLightAzimuth = azimuth; } float lightAngle() const { return mLightAngle; } - void setLightAngle( float angle ){ mLightAngle = angle; } + void setLightAngle( float angle ) { mLightAngle = angle; } private: float mLightAzimuth; diff --git a/src/analysis/raster/qgsrelief.cpp b/src/analysis/raster/qgsrelief.cpp index b7905f253fc..38adbb13d01 100644 --- a/src/analysis/raster/qgsrelief.cpp +++ b/src/analysis/raster/qgsrelief.cpp @@ -2,7 +2,7 @@ qgsrelief.cpp - description --------------------------- begin : November 2011 - copyright : (C) 20011 by Marco Hugentobler + copyright : (C) 2011 by Marco Hugentobler email : marco dot hugentobler at sourcepole dot ch ***************************************************************************/ diff --git a/src/analysis/raster/qgsrelief.h b/src/analysis/raster/qgsrelief.h index 62bbfbe499e..0bf4008bf2b 100644 --- a/src/analysis/raster/qgsrelief.h +++ b/src/analysis/raster/qgsrelief.h @@ -2,7 +2,7 @@ qgsrelief.h - description --------------------------- begin : November 2011 - copyright : (C) 20011 by Marco Hugentobler + copyright : (C) 2011 by Marco Hugentobler email : marco dot hugentobler at sourcepole dot ch ***************************************************************************/ diff --git a/src/app/qgsmaptoolcapture.cpp b/src/app/qgsmaptoolcapture.cpp index 6910dd15908..2f3a221b5c1 100644 --- a/src/app/qgsmaptoolcapture.cpp +++ b/src/app/qgsmaptoolcapture.cpp @@ -55,7 +55,7 @@ QgsMapToolCapture::~QgsMapToolCapture() stopCapturing(); - if( mValidator ) + if ( mValidator ) { mValidator->deleteLater(); mValidator = 0; @@ -283,7 +283,7 @@ void QgsMapToolCapture::validateGeometry() if ( settings.value( "/qgis/digitizing/validate_geometries", 1 ).toInt() == 0 ) return; - if( mValidator ) + if ( mValidator ) { mValidator->deleteLater(); mValidator = 0; @@ -311,7 +311,7 @@ void QgsMapToolCapture::validateGeometry() case CapturePolygon: if ( mCaptureList.size() < 3 ) return; - g = QgsGeometry::fromPolygon( QgsPolygon() << ( QgsPolyline () << mCaptureList.toVector() << mCaptureList[0] ) ); + g = QgsGeometry::fromPolygon( QgsPolygon() << ( QgsPolyline() << mCaptureList.toVector() << mCaptureList[0] ) ); break; } diff --git a/src/core/qgsattributeaction.cpp b/src/core/qgsattributeaction.cpp index 3c20b918a7e..f934d1c41a9 100644 --- a/src/core/qgsattributeaction.cpp +++ b/src/core/qgsattributeaction.cpp @@ -202,7 +202,7 @@ QString QgsAttributeAction::expandAction( QString action, QgsFeature &feat, cons int start = index; index = pos + rx.matchedLength(); - QString to_replace = rx.cap(1).trimmed(); + QString to_replace = rx.cap( 1 ).trimmed(); QgsDebugMsg( "Found expression:" + to_replace ); if ( substitutionMap && substitutionMap->contains( to_replace ) ) diff --git a/src/core/qgsattributeaction.h b/src/core/qgsattributeaction.h index 63c6e3dc3e7..3278f60dd47 100644 --- a/src/core/qgsattributeaction.h +++ b/src/core/qgsattributeaction.h @@ -188,7 +188,7 @@ class CORE_EXPORT QgsAttributeAction static void ( *smPythonExecute )( const QString & ); void runAction( const QgsAction &action, - void ( *executePython )( const QString & ) = 0 ); + void ( *executePython )( const QString & ) = 0 ); int mDefaultAction; }; diff --git a/src/core/qgsexpression.cpp b/src/core/qgsexpression.cpp index df0b4d1761b..d960b3ff418 100644 --- a/src/core/qgsexpression.cpp +++ b/src/core/qgsexpression.cpp @@ -138,7 +138,7 @@ static double getDoubleValue( const QVariant& value, QgsExpression* parent ) static int getIntValue( const QVariant& value, QgsExpression* parent ) { bool ok; - qint64 x = value.toLongLong(&ok); + qint64 x = value.toLongLong( &ok ); if ( ok && x >= std::numeric_limits::min() && x <= std::numeric_limits::max() ) { return x; diff --git a/src/core/qgsvectorlayerimport.cpp b/src/core/qgsvectorlayerimport.cpp index 1eedcbf23d8..c1ac5b5fb98 100644 --- a/src/core/qgsvectorlayerimport.cpp +++ b/src/core/qgsvectorlayerimport.cpp @@ -40,12 +40,12 @@ typedef QgsVectorLayerImport::ImportError createEmptyLayer_t( QgsVectorLayerImport::QgsVectorLayerImport( const QString &uri, - const QString &providerKey, - const QgsFieldMap& fields, - QGis::WkbType geometryType, - const QgsCoordinateReferenceSystem* crs, - bool overwrite, - const QMap *options ) + const QString &providerKey, + const QgsFieldMap& fields, + QGis::WkbType geometryType, + const QgsCoordinateReferenceSystem* crs, + bool overwrite, + const QMap *options ) : mErrorCount( 0 ) { mProvider = NULL; diff --git a/src/gui/qgsexpressionbuilderwidget.cpp b/src/gui/qgsexpressionbuilderwidget.cpp index 2686031e0ae..ce6a0707008 100644 --- a/src/gui/qgsexpressionbuilderwidget.cpp +++ b/src/gui/qgsexpressionbuilderwidget.cpp @@ -43,9 +43,9 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent ) expressionTree->setContextMenuPolicy( Qt::CustomContextMenu ); connect( expressionTree, SIGNAL( customContextMenuRequested( const QPoint & ) ), this, SLOT( showContextMenu( const QPoint & ) ) ); - foreach (QPushButton* button, this->mOperatorsGroupBox->findChildren()) + foreach( QPushButton* button, this->mOperatorsGroupBox->findChildren() ) { - connect( button, SIGNAL( pressed() ), this, SLOT( operatorButtonClicked() ) ); + connect( button, SIGNAL( pressed() ), this, SLOT( operatorButtonClicked() ) ); } // TODO Can we move this stuff to QgsExpression, like the functions? @@ -155,7 +155,7 @@ void QgsExpressionBuilderWidget::loadFieldNames() void QgsExpressionBuilderWidget::loadFieldNames( QgsFieldMap fields ) { if ( fields.isEmpty() ) - return; + return; QStringList fieldNames; foreach( QgsField field, fields ) diff --git a/src/gui/qgsprojectionselector.cpp b/src/gui/qgsprojectionselector.cpp index 8fb1b2c201f..844a33d6400 100644 --- a/src/gui/qgsprojectionselector.cpp +++ b/src/gui/qgsprojectionselector.cpp @@ -857,10 +857,10 @@ void QgsProjectionSelector::on_cbxHideDeprecated_stateChanged() hideDeprecated( lstCoordinateSystems->topLevelItem( i ) ); } -void QgsProjectionSelector::on_lstRecent_itemClicked(QTreeWidgetItem * item) +void QgsProjectionSelector::on_lstRecent_itemClicked( QTreeWidgetItem * item ) { setSelectedCrsId( item->text( QGIS_CRS_ID_COLUMN ).toLong() ); - item->setSelected(true); + item->setSelected( true ); } void QgsProjectionSelector::on_leSearch_textChanged( const QString & theFilterTxt ) diff --git a/src/gui/qgsprojectionselector.h b/src/gui/qgsprojectionselector.h index cff23a76821..dcc9446e73e 100644 --- a/src/gui/qgsprojectionselector.h +++ b/src/gui/qgsprojectionselector.h @@ -113,7 +113,7 @@ class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProjectio * \warning This function's behaviour is undefined if it is called after the widget is shown. */ void setOgcWmsCrsFilter( QSet crsFilter ); - void on_lstRecent_itemClicked(QTreeWidgetItem * ); + void on_lstRecent_itemClicked( QTreeWidgetItem * ); void on_cbxHideDeprecated_stateChanged(); void on_leSearch_textChanged( const QString & ); diff --git a/src/gui/qgsscalecombobox.cpp b/src/gui/qgsscalecombobox.cpp index faa055a27b6..5d9e5ebadd9 100644 --- a/src/gui/qgsscalecombobox.cpp +++ b/src/gui/qgsscalecombobox.cpp @@ -57,7 +57,7 @@ void QgsScaleComboBox::showPopup() parts = itemText( i ).split( ':' ); nextScale = parts.at( 1 ).toLong( &ok ); delta = qAbs( currScale - nextScale ); - if( delta < min ) + if ( delta < min ) { min = delta; idx = i; diff --git a/src/plugins/gps_importer/qgsgpsplugingui.cpp b/src/plugins/gps_importer/qgsgpsplugingui.cpp index e770cceeeef..e3302d24303 100644 --- a/src/plugins/gps_importer/qgsgpsplugingui.cpp +++ b/src/plugins/gps_importer/qgsgpsplugingui.cpp @@ -89,14 +89,15 @@ void QgsGPSPluginGui::on_buttonBox_accepted() // what should we do? switch ( tabWidget->currentIndex() ) { - // add a GPX layer? case 0: + // add a GPX layer? emit loadGPXFile( leGPXFile->text(), cbGPXWaypoints->isChecked(), cbGPXRoutes->isChecked(), cbGPXTracks->isChecked() ); break; - // or import other file? + case 1: { + // or import other file? const QString& typeString( cmbIMPFeature->currentText() ); emit importGPSFile( leIMPInput->text(), mImporters.find( mImpFormat )->second, @@ -107,9 +108,10 @@ void QgsGPSPluginGui::on_buttonBox_accepted() leIMPLayer->text() ); break; } - // or download GPS data from a device? + case 2: { + // or download GPS data from a device? int featureType = cmbDLFeatureType->currentIndex(); QString fileName = leDLOutput->text(); @@ -124,17 +126,19 @@ void QgsGPSPluginGui::on_buttonBox_accepted() fileName, leDLBasename->text() ); break; } - // or upload GPS data to a device? + case 3: { + // or upload GPS data to a device? emit uploadToGPS( mGPXLayers[cmbULLayer->currentIndex()], cmbULDevice->currentText(), cmbULPort->itemData( cmbULPort->currentIndex() ).toString() ); break; } - // or convert between waypoints/tracks= + case 4: { + // or convert between waypoints/tracks= int convertType = cmbCONVType->itemData( cmbCONVType->currentIndex() ).toInt(); emit convertGPSFile( leCONVInput->text(),