Skip to content

Commit

Permalink
fix warnings and extra semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 7, 2015
1 parent dc93261 commit 198d8fe
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 27 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ogr2ogrclip.py
Expand Up @@ -75,7 +75,7 @@ def processAlgorithm(self, progress):
arguments.append(output) arguments.append(output)
arguments.append(ogrLayer) arguments.append(ogrLayer)
arguments.append(self.ogrLayerName(inLayer)) arguments.append(self.ogrLayerName(inLayer))

commands = [] commands = []
if isWindows(): if isWindows():
commands = ['cmd.exe', '/C ', 'ogr2ogr.exe', commands = ['cmd.exe', '/C ', 'ogr2ogr.exe',
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/rasterize.py
Expand Up @@ -118,7 +118,7 @@ def processAlgorithm(self, progress):
bigtiff = self.BIGTIFFTYPE[self.getParameterValue(self.BIGTIFF)] bigtiff = self.BIGTIFFTYPE[self.getParameterValue(self.BIGTIFF)]
tfw = str(self.getParameterValue(self.TFW)) tfw = str(self.getParameterValue(self.TFW))
out = self.getOutputValue(self.OUTPUT) out = self.getOutputValue(self.OUTPUT)

arguments = [] arguments = []
arguments.append('-a') arguments.append('-a')
arguments.append(str(self.getParameterValue(self.FIELD))) arguments.append(str(self.getParameterValue(self.FIELD)))
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/translate.py
Expand Up @@ -128,7 +128,7 @@ def processAlgorithm(self, progress):
compress = self.COMPRESSTYPE[self.getParameterValue(self.COMPRESS)] compress = self.COMPRESSTYPE[self.getParameterValue(self.COMPRESS)]
bigtiff = self.BIGTIFFTYPE[self.getParameterValue(self.BIGTIFF)] bigtiff = self.BIGTIFFTYPE[self.getParameterValue(self.BIGTIFF)]
tfw = str(self.getParameterValue(self.TFW)) tfw = str(self.getParameterValue(self.TFW))

arguments = [] arguments = []
arguments.append('-of') arguments.append('-of')
arguments.append(GdalUtils.getFormatShortNameFromFilename(out)) arguments.append(GdalUtils.getFormatShortNameFromFilename(out))
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/warp.py
Expand Up @@ -113,7 +113,7 @@ def processAlgorithm(self, progress):
arguments = [] arguments = []
arguments.append('-ot') arguments.append('-ot')
arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)]) arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)])
if len(srccrs) > 0: if len(srccrs) > 0:
arguments.append('-s_srs') arguments.append('-s_srs')
arguments.append(srccrs) arguments.append(srccrs)
if len(dstcrs) > 0: if len(dstcrs) > 0:
Expand Down
4 changes: 4 additions & 0 deletions scripts/astyle.sh
Expand Up @@ -73,6 +73,10 @@ for f in "$@"; do
cmd=: cmd=:
;; ;;


python/ext-libs/*)
cmd=:
;;

*.py|*.sip) *.py|*.sip)
cmd="perl -i.prepare -pe 's/[\r\t ]+$//;'" cmd="perl -i.prepare -pe 's/[\r\t ]+$//;'"
;; ;;
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsgraphdirector.h
Expand Up @@ -42,7 +42,7 @@ class ANALYSIS_EXPORT QgsGraphDirector : public QObject


public: public:
//! Destructor //! Destructor
virtual ~QgsGraphDirector() { }; virtual ~QgsGraphDirector() { }


/** /**
* Make a graph using RgGraphBuilder * Make a graph using RgGraphBuilder
Expand Down
10 changes: 5 additions & 5 deletions src/app/pluginmanager/qgspluginmanager.cpp
Expand Up @@ -700,35 +700,35 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
html += QString( "<table bgcolor=\"#FFFFAA\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">" html += QString( "<table bgcolor=\"#FFFFAA\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">"
" <tr><td width=\"100%\" style=\"color:#880000\"><b>%1</b></td></tr>" " <tr><td width=\"100%\" style=\"color:#880000\"><b>%1</b></td></tr>"
"</table>" ).arg( tr( "There is a new version available" ) ); "</table>" ).arg( tr( "There is a new version available" ) );
}; }
if ( metadata->value( "status" ) == "new" ) if ( metadata->value( "status" ) == "new" )
{ {
html += QString( "<table bgcolor=\"#CCFFCC\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">" html += QString( "<table bgcolor=\"#CCFFCC\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">"
" <tr><td width=\"100%\" style=\"color:#008800\"><b>%1</b></td></tr>" " <tr><td width=\"100%\" style=\"color:#008800\"><b>%1</b></td></tr>"
"</table>" ).arg( tr( "This is a new plugin" ) ); "</table>" ).arg( tr( "This is a new plugin" ) );
}; }
if ( metadata->value( "status" ) == "newer" ) if ( metadata->value( "status" ) == "newer" )
{ {
html += QString( "<table bgcolor=\"#FFFFCC\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">" html += QString( "<table bgcolor=\"#FFFFCC\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">"
" <tr><td width=\"100%\" style=\"color:#550000\"><b>%1</b></td></tr>" " <tr><td width=\"100%\" style=\"color:#550000\"><b>%1</b></td></tr>"
"</table>" ).arg( tr( "Installed version of this plugin is higher than any version found in repository" ) ); "</table>" ).arg( tr( "Installed version of this plugin is higher than any version found in repository" ) );
}; }
if ( metadata->value( "experimental" ) == "true" ) if ( metadata->value( "experimental" ) == "true" )
{ {
html += QString( "<table bgcolor=\"#EEEEBB\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">" html += QString( "<table bgcolor=\"#EEEEBB\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">"
" <tr><td width=\"100%\" style=\"color:#660000\">" " <tr><td width=\"100%\" style=\"color:#660000\">"
" <img src=\"qrc:/images/themes/default/pluginExperimental.png\" width=\"32\"><b>%1</b>" " <img src=\"qrc:/images/themes/default/pluginExperimental.png\" width=\"32\"><b>%1</b>"
" </td></tr>" " </td></tr>"
"</table>" ).arg( tr( "This plugin is experimental" ) ); "</table>" ).arg( tr( "This plugin is experimental" ) );
}; }
if ( metadata->value( "deprecated" ) == "true" ) if ( metadata->value( "deprecated" ) == "true" )
{ {
html += QString( "<table bgcolor=\"#EEBBCC\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">" html += QString( "<table bgcolor=\"#EEBBCC\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">"
" <tr><td width=\"100%\" style=\"color:#660000\">" " <tr><td width=\"100%\" style=\"color:#660000\">"
" <img src=\"qrc:/images/themes/default/pluginDeprecated.png\" width=\"32\"><b>%1</b>" " <img src=\"qrc:/images/themes/default/pluginDeprecated.png\" width=\"32\"><b>%1</b>"
" </td></tr>" " </td></tr>"
"</table>" ).arg( tr( "This plugin is deprecated" ) ); "</table>" ).arg( tr( "This plugin is deprecated" ) );
}; }


// Now the metadata // Now the metadata


Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsdecorationscalebar.cpp
Expand Up @@ -151,13 +151,13 @@ void QgsDecorationScaleBar::render( QPainter * theQPainter )
{ {
myScaleBarWidth = myCanvasWidth / 4.0; // pixels myScaleBarWidth = myCanvasWidth / 4.0; // pixels
myActualSize = myScaleBarWidth * myMapUnitsPerPixelDouble; // map units myActualSize = myScaleBarWidth * myMapUnitsPerPixelDouble; // map units
}; }


//if scale bar is more than half the canvas wide keep halving until not //if scale bar is more than half the canvas wide keep halving until not
while ( myScaleBarWidth > myCanvasWidth / 3.0 ) while ( myScaleBarWidth > myCanvasWidth / 3.0 )
{ {
myScaleBarWidth = myScaleBarWidth / 3; myScaleBarWidth = myScaleBarWidth / 3;
}; }
myActualSize = myScaleBarWidth * myMapUnitsPerPixelDouble; myActualSize = myScaleBarWidth * myMapUnitsPerPixelDouble;


// Work out the exponent for the number - e.g, 1234 will give 3, // Work out the exponent for the number - e.g, 1234 will give 3,
Expand Down Expand Up @@ -235,7 +235,7 @@ void QgsDecorationScaleBar::render( QPainter * theQPainter )
myScaleBarUnitLabel = tr( " unknown" ); myScaleBarUnitLabel = tr( " unknown" );
default: default:
QgsDebugMsg( QString( "Error: not picked up map units - actual value = %1" ).arg( myMapUnits ) ); QgsDebugMsg( QString( "Error: not picked up map units - actual value = %1" ).arg( myMapUnits ) );
}; }


//Set font and calculate width of unit label //Set font and calculate width of unit label
int myFontSize = 10; //we use this later for buffering int myFontSize = 10; //we use this later for buffering
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgslayerdefinition.cpp
Expand Up @@ -35,6 +35,8 @@ bool QgsLayerDefinition::loadLayerDefinition( const QString &path, QgsLayerTreeG


bool QgsLayerDefinition::loadLayerDefinition( QDomDocument doc, QgsLayerTreeGroup *rootGroup, QString &errorMessage ) bool QgsLayerDefinition::loadLayerDefinition( QDomDocument doc, QgsLayerTreeGroup *rootGroup, QString &errorMessage )
{ {
Q_UNUSED( errorMessage );

QgsLayerTreeGroup* root = new QgsLayerTreeGroup; QgsLayerTreeGroup* root = new QgsLayerTreeGroup;
// We have to replace the IDs before we load them because it's too late once they are loaded // We have to replace the IDs before we load them because it's too late once they are loaded
QDomNodeList ids = doc.elementsByTagName( "id" ); QDomNodeList ids = doc.elementsByTagName( "id" );
Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsrasterdataprovider.h
Expand Up @@ -272,7 +272,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod ); Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod );
Q_UNUSED( theFormat ); Q_UNUSED( theConfigOptions ); Q_UNUSED( theFormat ); Q_UNUSED( theConfigOptions );
return "FAILED_NOT_SUPPORTED"; return "FAILED_NOT_SUPPORTED";
}; }


/** \brief Accessor for ths raster layers pyramid list. /** \brief Accessor for ths raster layers pyramid list.
* @param overviewList used to construct the pyramid list (optional), when empty the list is defined by the provider. * @param overviewList used to construct the pyramid list (optional), when empty the list is defined by the provider.
Expand All @@ -282,7 +282,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
* list. * list.
*/ */
virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() ) virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() )
{ Q_UNUSED( overviewList ); return QList<QgsRasterPyramid>(); }; { Q_UNUSED( overviewList ); return QList<QgsRasterPyramid>(); }


/** \brief Returns true if raster has at least one populated histogram. */ /** \brief Returns true if raster has at least one populated histogram. */
bool hasPyramids(); bool hasPyramids();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -438,7 +438,7 @@ void QgsRelationReferenceWidget::init()


qSort( cache.begin(), cache.end(), orderByLessThan ); qSort( cache.begin(), cache.end(), orderByLessThan );


Q_FOREACH( const ValueRelationItem& item, cache ) Q_FOREACH ( const ValueRelationItem& item, cache )
{ {
mComboBox->addItem( item.first.toString(), item.second ); mComboBox->addItem( item.first.toString(), item.second );


Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgisgui.cpp
Expand Up @@ -177,7 +177,7 @@ namespace QgisGui


QString createFileFilter_( QString const &longName, QString const &glob ) QString createFileFilter_( QString const &longName, QString const &glob )
{ {
return QString("%1 (%2 %3)").arg( longName ).arg( glob.toLower() ).arg( glob.toUpper() ); return QString( "%1 (%2 %3)" ).arg( longName ).arg( glob.toLower() ).arg( glob.toUpper() );
} }


QString createFileFilter_( QString const &format ) QString createFileFilter_( QString const &format )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/coordinate_capture/coordinatecapture.cpp
Expand Up @@ -74,8 +74,8 @@ CoordinateCapture::CoordinateCapture( QgisInterface * theQgisInterface )
, mypUserCrsToolButton( NULL ) , mypUserCrsToolButton( NULL )
, mypCRSLabel( NULL ) , mypCRSLabel( NULL )
, mCanvasDisplayPrecision( 5 ) , mCanvasDisplayPrecision( 5 )
, mQGisIface( theQgisInterface )
, mUserCrsDisplayPrecision( 5 ) , mUserCrsDisplayPrecision( 5 )
, mQGisIface( theQgisInterface )
, mQActionPointer( NULL ) , mQActionPointer( NULL )
{ {
} }
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/globe/globe_plugin.cpp
Expand Up @@ -122,17 +122,17 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
, mQActionUnload( 0 ) , mQActionUnload( 0 )
, mOsgViewer( 0 ) , mOsgViewer( 0 )
, mViewerWidget( 0 ) , mViewerWidget( 0 )
, mRootNode( 0 )
, mMapNode( 0 ) , mMapNode( 0 )
, mBaseLayer( 0 ) , mBaseLayer( 0 )
, mQgisMapLayer( 0 ) , mQgisMapLayer( 0 )
, mTileSource( 0 ) , mTileSource( 0 )
, mControlCanvas( 0 )
, mElevationManager( 0 ) , mElevationManager( 0 )
, mObjectPlacer( 0 ) , mObjectPlacer( 0 )
, mControlCanvas( 0 )
, mSelectedLat( 0. ) , mSelectedLat( 0. )
, mSelectedLon( 0. ) , mSelectedLon( 0. )
, mSelectedElevation( 0. ) , mSelectedElevation( 0. )
, mRootNode( 0 )
{ {
mIsGlobeRunning = false; mIsGlobeRunning = false;
//needed to be "seen" by other plugins by doing //needed to be "seen" by other plugins by doing
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -286,9 +286,9 @@ QgsGrassModuleOptions::QgsGrassModuleOptions(
: mIface( iface ) : mIface( iface )
, mTools( tools ) , mTools( tools )
, mModule( module ) , mModule( module )
, mDirect( direct )
, mParent( 0 ) , mParent( 0 )
, mRegionModeComboBox( 0 ) , mRegionModeComboBox( 0 )
, mDirect( direct )
{ {
QgsDebugMsg( "called." ); QgsDebugMsg( "called." );


Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassutils.cpp
Expand Up @@ -67,13 +67,13 @@ bool QgsGrassUtils::itemExists( QString element, QString item )


QgsGrassElementDialog::QgsGrassElementDialog( QWidget *parent ) QgsGrassElementDialog::QgsGrassElementDialog( QWidget *parent )
: QObject() : QObject()
, mParent( parent )
, mDialog( 0 ) , mDialog( 0 )
, mLineEdit( 0 ) , mLineEdit( 0 )
, mLabel( 0 ) , mLabel( 0 )
, mErrorLabel( 0 ) , mErrorLabel( 0 )
, mOkButton( 0 ) , mOkButton( 0 )
, mCancelButton( 0 ) , mCancelButton( 0 )
, mParent( parent )
{ {
} }


Expand Down
2 changes: 1 addition & 1 deletion src/plugins/heatmap/heatmap.cpp
Expand Up @@ -68,8 +68,8 @@ static const QString sPluginIcon = ":/heatmap/heatmap.png";
*/ */
Heatmap::Heatmap( QgisInterface * theQgisInterface ) Heatmap::Heatmap( QgisInterface * theQgisInterface )
: QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ) : QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType )
, mQGisIface( theQgisInterface )
, mDecay( 1. ) , mDecay( 1. )
, mQGisIface( theQgisInterface )
, mQActionPointer( 0 ) , mQActionPointer( 0 )
{ {
} }
Expand Down
4 changes: 2 additions & 2 deletions tests/src/gui/testqgsgui.cpp
Expand Up @@ -28,15 +28,15 @@ class TestQgsGui : public QObject
void TestQgsGui::createFileFilterForFormat() void TestQgsGui::createFileFilterForFormat()
{ {
QString expected = "FOO format (*.foo *.FOO)"; QString expected = "FOO format (*.foo *.FOO)";
QString actual = QgisGui::createFileFilter_("foo"); QString actual = QgisGui::createFileFilter_( "foo" );


QCOMPARE( actual, expected ); QCOMPARE( actual, expected );
} }


void TestQgsGui::createFileFilter() void TestQgsGui::createFileFilter()
{ {
QString expected = "My Description (my_regex MY_REGEX)"; QString expected = "My Description (my_regex MY_REGEX)";
QString actual = QgisGui::createFileFilter_("My Description", "my_regex"); QString actual = QgisGui::createFileFilter_( "My Description", "my_regex" );


QCOMPARE( actual, expected ); QCOMPARE( actual, expected );
} }
Expand Down
5 changes: 3 additions & 2 deletions tests/src/gui/testqgsmapcanvas.cpp
Expand Up @@ -8,9 +8,10 @@
namespace QTest namespace QTest
{ {
template<> template<>
char* toString( const QgsRectangle& r ) { char* toString( const QgsRectangle& r )
{
QByteArray ba = r.toString().toLocal8Bit(); QByteArray ba = r.toString().toLocal8Bit();
return qstrdup(ba.data()); return qstrdup( ba.data() );
} }
} }


Expand Down

0 comments on commit 198d8fe

Please sign in to comment.