Skip to content
Permalink
Browse files
add cppcheck fixes
  • Loading branch information
jef-n committed Oct 3, 2015
1 parent e694474 commit 1b4ca622c90b1d0a265ff1b1798285cb5401c1ba
Show file tree
Hide file tree
Showing 202 changed files with 348 additions and 343 deletions.
@@ -831,7 +831,7 @@ The class **must** inherit from QObject and include the Q_OBJECT macro.
```
class TestQgsRasterLayer: public QObject
{
Q_OBJECT;
Q_OBJECT
```

All our test methods are implemented as **private slots**. The QtTest framework
@@ -44,7 +44,7 @@ class QgsComposerColumnAlignmentDelegate : public QItemDelegate
Q_OBJECT

public:
QgsComposerColumnAlignmentDelegate( QObject *parent = 0 );
explicit QgsComposerColumnAlignmentDelegate( QObject *parent = 0 );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
@@ -81,7 +81,7 @@ class QgsComposerColumnWidthDelegate : public QItemDelegate
Q_OBJECT

public:
QgsComposerColumnWidthDelegate( QObject *parent = 0 );
explicit QgsComposerColumnWidthDelegate( QObject *parent = 0 );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
@@ -98,7 +98,7 @@ class QgsComposerColumnSortOrderDelegate : public QItemDelegate
Q_OBJECT

public:
QgsComposerColumnSortOrderDelegate( QObject *parent = 0 );
explicit QgsComposerColumnSortOrderDelegate( QObject *parent = 0 );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
@@ -27,7 +27,7 @@ class QgsComposerArrowWidget: public QgsComposerItemBaseWidget, private Ui::QgsC
{
Q_OBJECT
public:
QgsComposerArrowWidget( QgsComposerArrow* arrow );
explicit QgsComposerArrowWidget( QgsComposerArrow* arrow );
~QgsComposerArrowWidget();

private:
@@ -30,7 +30,7 @@ class QgsComposerLabelWidget: public QgsComposerItemBaseWidget, private Ui::QgsC
{
Q_OBJECT
public:
QgsComposerLabelWidget( QgsComposerLabel* label );
explicit QgsComposerLabelWidget( QgsComposerLabel* label );

public slots:
void on_mHtmlCheckBox_stateChanged( int i );
@@ -34,7 +34,7 @@ class QgsComposerLegendWidget: public QgsComposerItemBaseWidget, private Ui::Qgs
Q_OBJECT

public:
QgsComposerLegendWidget( QgsComposerLegend* legend );
explicit QgsComposerLegendWidget( QgsComposerLegend* legend );
~QgsComposerLegendWidget();

/** Updates the legend layers and groups*/
@@ -30,7 +30,7 @@ class QgsComposerNameDelegate : public QItemDelegate
Q_OBJECT

public:
QgsComposerNameDelegate( QObject *parent = 0 );
explicit QgsComposerNameDelegate( QObject *parent = 0 );

QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index ) const override;
@@ -33,8 +33,7 @@ class QgsComposerMapWidget: public QgsComposerItemBaseWidget, private Ui::QgsCom
Q_OBJECT

public:

QgsComposerMapWidget( QgsComposerMap* composerMap );
explicit QgsComposerMapWidget( QgsComposerMap* composerMap );
virtual ~QgsComposerMapWidget();

public slots:
@@ -31,8 +31,7 @@ class QgsComposerPictureWidget: public QgsComposerItemBaseWidget, private Ui::Qg
Q_OBJECT

public:

QgsComposerPictureWidget( QgsComposerPicture* picture );
explicit QgsComposerPictureWidget( QgsComposerPicture* picture );
~QgsComposerPictureWidget();

/** Add the icons of the standard directories to the preview*/
@@ -30,7 +30,7 @@ class QgsComposerScaleBarWidget: public QgsComposerItemBaseWidget, private Ui::Q
Q_OBJECT

public:
QgsComposerScaleBarWidget( QgsComposerScaleBar* scaleBar );
explicit QgsComposerScaleBarWidget( QgsComposerScaleBar* scaleBar );
~QgsComposerScaleBarWidget();

public slots:
@@ -28,7 +28,7 @@ class QgsComposerShapeWidget: public QgsComposerItemBaseWidget, private Ui::QgsC
{
Q_OBJECT
public:
QgsComposerShapeWidget( QgsComposerShape* composerShape );
explicit QgsComposerShapeWidget( QgsComposerShape* composerShape );
~QgsComposerShapeWidget();

private:
@@ -27,7 +27,7 @@ class QgsComposerTableWidget: public QgsComposerItemBaseWidget, private Ui::QgsC
{
Q_OBJECT
public:
QgsComposerTableWidget( QgsComposerAttributeTable* table );
explicit QgsComposerTableWidget( QgsComposerAttributeTable* table );
~QgsComposerTableWidget();

protected:
@@ -29,8 +29,7 @@ class QPainter;
class QgsGpsMarker : public QgsMapCanvasItem
{
public:

QgsGpsMarker( QgsMapCanvas* mapCanvas );
explicit QgsGpsMarker( QgsMapCanvas* mapCanvas );

void setCenter( const QgsPoint& point );

@@ -31,7 +31,7 @@ class QgsMapToolNodeTool: public QgsMapToolEdit
{
Q_OBJECT
public:
QgsMapToolNodeTool( QgsMapCanvas* canvas );
explicit QgsMapToolNodeTool( QgsMapCanvas* canvas );
virtual ~QgsMapToolNodeTool();

void canvasMoveEvent( QgsMapMouseEvent* e ) override;
@@ -26,7 +26,7 @@ class QgsPluginItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
QgsPluginItemDelegate( QObject * parent = 0 );
explicit QgsPluginItemDelegate( QObject * parent = 0 );
QSize sizeHint( const QStyleOptionViewItem & theOption, const QModelIndex & theIndex ) const override;
void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
};
@@ -42,7 +42,7 @@ class QgsPluginSortFilterProxyModel : public QSortFilterProxyModel
Q_OBJECT

public:
QgsPluginSortFilterProxyModel( QObject *parent = 0 );
explicit QgsPluginSortFilterProxyModel( QObject *parent = 0 );

//! (Re)configire the status filter
void setAcceptedStatuses( QStringList statuses );
@@ -7176,7 +7176,7 @@ QList<QgsMapLayer *> QgisApp::editableLayers( bool modified ) const
if ( !vl )
continue;

if ( vl->isEditable() && ( !modified || ( modified && vl->isModified() ) ) )
if ( vl->isEditable() && ( !modified || vl->isModified() ) )
editLayers << vl;
}
return editLayers;
@@ -7760,7 +7760,7 @@ void QgisApp::showPluginManager()
class QgsPythonRunnerImpl : public QgsPythonRunner
{
public:
QgsPythonRunnerImpl( QgsPythonUtils* pythonUtils ) : mPythonUtils( pythonUtils ) {}
explicit QgsPythonRunnerImpl( QgsPythonUtils* pythonUtils ) : mPythonUtils( pythonUtils ) {}

virtual bool runCommand( QString command, QString messageOnError = QString() ) override
{