fix warnings and extra semicolons

This commit is contained in:
Juergen E. Fischer 2015-02-07 13:38:35 +01:00
parent dc93261ce5
commit 198d8fe58f
19 changed files with 34 additions and 27 deletions

View File

@ -75,7 +75,7 @@ class Ogr2OgrClip(OgrAlgorithm):
arguments.append(output)
arguments.append(ogrLayer)
arguments.append(self.ogrLayerName(inLayer))
commands = []
if isWindows():
commands = ['cmd.exe', '/C ', 'ogr2ogr.exe',

View File

@ -118,7 +118,7 @@ class rasterize(OgrAlgorithm):
bigtiff = self.BIGTIFFTYPE[self.getParameterValue(self.BIGTIFF)]
tfw = str(self.getParameterValue(self.TFW))
out = self.getOutputValue(self.OUTPUT)
arguments = []
arguments.append('-a')
arguments.append(str(self.getParameterValue(self.FIELD)))

View File

@ -128,7 +128,7 @@ class translate(GdalAlgorithm):
compress = self.COMPRESSTYPE[self.getParameterValue(self.COMPRESS)]
bigtiff = self.BIGTIFFTYPE[self.getParameterValue(self.BIGTIFF)]
tfw = str(self.getParameterValue(self.TFW))
arguments = []
arguments.append('-of')
arguments.append(GdalUtils.getFormatShortNameFromFilename(out))

View File

@ -113,7 +113,7 @@ class warp(GdalAlgorithm):
arguments = []
arguments.append('-ot')
arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)])
if len(srccrs) > 0:
if len(srccrs) > 0:
arguments.append('-s_srs')
arguments.append(srccrs)
if len(dstcrs) > 0:

View File

@ -73,6 +73,10 @@ for f in "$@"; do
cmd=:
;;
python/ext-libs/*)
cmd=:
;;
*.py|*.sip)
cmd="perl -i.prepare -pe 's/[\r\t ]+$//;'"
;;

View File

@ -42,7 +42,7 @@ class ANALYSIS_EXPORT QgsGraphDirector : public QObject
public:
//! Destructor
virtual ~QgsGraphDirector() { };
virtual ~QgsGraphDirector() { }
/**
* Make a graph using RgGraphBuilder

View File

@ -700,19 +700,19 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
html += QString( "<table bgcolor=\"#FFFFAA\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">"
" <tr><td width=\"100%\" style=\"color:#880000\"><b>%1</b></td></tr>"
"</table>" ).arg( tr( "There is a new version available" ) );
};
}
if ( metadata->value( "status" ) == "new" )
{
html += QString( "<table bgcolor=\"#CCFFCC\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">"
" <tr><td width=\"100%\" style=\"color:#008800\"><b>%1</b></td></tr>"
"</table>" ).arg( tr( "This is a new plugin" ) );
};
}
if ( metadata->value( "status" ) == "newer" )
{
html += QString( "<table bgcolor=\"#FFFFCC\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">"
" <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" ) );
};
}
if ( metadata->value( "experimental" ) == "true" )
{
html += QString( "<table bgcolor=\"#EEEEBB\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">"
@ -720,7 +720,7 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
" <img src=\"qrc:/images/themes/default/pluginExperimental.png\" width=\"32\"><b>%1</b>"
" </td></tr>"
"</table>" ).arg( tr( "This plugin is experimental" ) );
};
}
if ( metadata->value( "deprecated" ) == "true" )
{
html += QString( "<table bgcolor=\"#EEBBCC\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">"
@ -728,7 +728,7 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
" <img src=\"qrc:/images/themes/default/pluginDeprecated.png\" width=\"32\"><b>%1</b>"
" </td></tr>"
"</table>" ).arg( tr( "This plugin is deprecated" ) );
};
}
// Now the metadata

View File

@ -151,13 +151,13 @@ void QgsDecorationScaleBar::render( QPainter * theQPainter )
{
myScaleBarWidth = myCanvasWidth / 4.0; // pixels
myActualSize = myScaleBarWidth * myMapUnitsPerPixelDouble; // map units
};
}
//if scale bar is more than half the canvas wide keep halving until not
while ( myScaleBarWidth > myCanvasWidth / 3.0 )
{
myScaleBarWidth = myScaleBarWidth / 3;
};
}
myActualSize = myScaleBarWidth * myMapUnitsPerPixelDouble;
// Work out the exponent for the number - e.g, 1234 will give 3,
@ -235,7 +235,7 @@ void QgsDecorationScaleBar::render( QPainter * theQPainter )
myScaleBarUnitLabel = tr( " unknown" );
default:
QgsDebugMsg( QString( "Error: not picked up map units - actual value = %1" ).arg( myMapUnits ) );
};
}
//Set font and calculate width of unit label
int myFontSize = 10; //we use this later for buffering

View File

@ -35,6 +35,8 @@ bool QgsLayerDefinition::loadLayerDefinition( const QString &path, QgsLayerTreeG
bool QgsLayerDefinition::loadLayerDefinition( QDomDocument doc, QgsLayerTreeGroup *rootGroup, QString &errorMessage )
{
Q_UNUSED( errorMessage );
QgsLayerTreeGroup* root = new QgsLayerTreeGroup;
// We have to replace the IDs before we load them because it's too late once they are loaded
QDomNodeList ids = doc.elementsByTagName( "id" );

View File

@ -272,7 +272,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod );
Q_UNUSED( theFormat ); Q_UNUSED( theConfigOptions );
return "FAILED_NOT_SUPPORTED";
};
}
/** \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.
@ -282,7 +282,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
* list.
*/
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. */
bool hasPyramids();

View File

@ -438,7 +438,7 @@ void QgsRelationReferenceWidget::init()
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 );

View File

@ -177,7 +177,7 @@ namespace QgisGui
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 )

View File

@ -74,8 +74,8 @@ CoordinateCapture::CoordinateCapture( QgisInterface * theQgisInterface )
, mypUserCrsToolButton( NULL )
, mypCRSLabel( NULL )
, mCanvasDisplayPrecision( 5 )
, mQGisIface( theQgisInterface )
, mUserCrsDisplayPrecision( 5 )
, mQGisIface( theQgisInterface )
, mQActionPointer( NULL )
{
}

View File

@ -122,17 +122,17 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
, mQActionUnload( 0 )
, mOsgViewer( 0 )
, mViewerWidget( 0 )
, mRootNode( 0 )
, mMapNode( 0 )
, mBaseLayer( 0 )
, mQgisMapLayer( 0 )
, mTileSource( 0 )
, mControlCanvas( 0 )
, mElevationManager( 0 )
, mObjectPlacer( 0 )
, mControlCanvas( 0 )
, mSelectedLat( 0. )
, mSelectedLon( 0. )
, mSelectedElevation( 0. )
, mRootNode( 0 )
{
mIsGlobeRunning = false;
//needed to be "seen" by other plugins by doing

View File

@ -286,9 +286,9 @@ QgsGrassModuleOptions::QgsGrassModuleOptions(
: mIface( iface )
, mTools( tools )
, mModule( module )
, mDirect( direct )
, mParent( 0 )
, mRegionModeComboBox( 0 )
, mDirect( direct )
{
QgsDebugMsg( "called." );

View File

@ -67,13 +67,13 @@ bool QgsGrassUtils::itemExists( QString element, QString item )
QgsGrassElementDialog::QgsGrassElementDialog( QWidget *parent )
: QObject()
, mParent( parent )
, mDialog( 0 )
, mLineEdit( 0 )
, mLabel( 0 )
, mErrorLabel( 0 )
, mOkButton( 0 )
, mCancelButton( 0 )
, mParent( parent )
{
}

View File

@ -68,8 +68,8 @@ static const QString sPluginIcon = ":/heatmap/heatmap.png";
*/
Heatmap::Heatmap( QgisInterface * theQgisInterface )
: QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType )
, mQGisIface( theQgisInterface )
, mDecay( 1. )
, mQGisIface( theQgisInterface )
, mQActionPointer( 0 )
{
}

View File

@ -28,7 +28,7 @@ class TestQgsGui : public QObject
void TestQgsGui::createFileFilterForFormat()
{
QString expected = "FOO format (*.foo *.FOO)";
QString actual = QgisGui::createFileFilter_("foo");
QString actual = QgisGui::createFileFilter_( "foo" );
QCOMPARE( actual, expected );
}
@ -36,7 +36,7 @@ void TestQgsGui::createFileFilterForFormat()
void TestQgsGui::createFileFilter()
{
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 );
}

View File

@ -8,9 +8,10 @@
namespace QTest
{
template<>
char* toString( const QgsRectangle& r ) {
char* toString( const QgsRectangle& r )
{
QByteArray ba = r.toString().toLocal8Bit();
return qstrdup(ba.data());
return qstrdup( ba.data() );
}
}