Skip to content
Permalink
Browse files
Run clang-tidy modernization checks
  • Loading branch information
nyalldawson committed Jun 5, 2018
1 parent 8f55093 commit b69389b6503e94834c4027dd95cbbf849ccbe83e
Show file tree
Hide file tree
Showing 112 changed files with 279 additions and 448 deletions.
@@ -31,7 +31,6 @@ Dialog to set up parameters to create a new GeoPackage layer, and on accept() to
%Docstring
Constructor
%End
~QgsNewGeoPackageLayerDialog();

void setCrs( const QgsCoordinateReferenceSystem &crs );
%Docstring
@@ -36,9 +36,6 @@ the you probably want to look at QgsProjectionSelectionWidget instead.
Constructor for QgsProjectionSelectionDialog.
%End


~QgsProjectionSelectionDialog();

QgsCoordinateReferenceSystem crs() const;
%Docstring
Returns the CRS currently selected in the widget.
@@ -64,11 +64,9 @@ static float screenSpaceError( QgsChunkNode *node, const QgsChunkedEntity::Scene

QgsChunkedEntity::QgsChunkedEntity( const QgsAABB &rootBbox, float rootError, float tau, int maxLevel, QgsChunkLoaderFactory *loaderFactory, Qt3DCore::QNode *parent )
: Qt3DCore::QEntity( parent )
, mNeedsUpdate( false )
, mTau( tau )
, mMaxLevel( maxLevel )
, mChunkLoaderFactory( loaderFactory )
, mMaxLoadedChunks( 512 )
{
mRootNode = new QgsChunkNode( 0, 0, 0, rootBbox, rootError );
mChunkLoaderQueue = new QgsChunkList;
@@ -27,7 +27,7 @@
#include "qgsrasterlayer.h"

Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
: QObject()
: QObject( nullptr )
, mOrigin( other.mOrigin )
, mCrs( other.mCrs )
, mBackgroundColor( other.mBackgroundColor )
@@ -18,7 +18,7 @@

#include "qgis_3d.h"

#include <math.h>
#include <cmath>
#include <QList>
#include <QVector3D>

@@ -56,10 +56,6 @@ QgsTessellatedPolygonGeometry::QgsTessellatedPolygonGeometry( QNode *parent )
}
}

QgsTessellatedPolygonGeometry::~QgsTessellatedPolygonGeometry()
{
}

void QgsTessellatedPolygonGeometry::setPolygons( const QList<QgsPolygon *> &polygons, const QgsPointXY &origin, float extrusionHeight, const QList<float> &extrusionHeightPerPolygon )
{
QgsTessellator tessellator( origin.x(), origin.y(), mWithNormals, mInvertNormals, mAddBackFaces );
@@ -39,7 +39,6 @@ class QgsTessellatedPolygonGeometry : public Qt3DRender::QGeometry
public:
//! Constructor
QgsTessellatedPolygonGeometry( QNode *parent = nullptr );
~QgsTessellatedPolygonGeometry() override;

//! Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)
bool invertNormals() const { return mInvertNormals; }
@@ -49,7 +49,7 @@ QgsRectangle QgsTilingScheme::tileToExtent( int x, int y, int z ) const
void QgsTilingScheme::extentToTile( const QgsRectangle &extent, int &x, int &y, int &z ) const
{
x = y = z = 0; // start with root tile
while ( 1 )
while ( true )
{
// try to see if any child tile fully contains our extent - if so, go deeper
if ( tileToExtent( x * 2, y * 2, z + 1 ).contains( extent ) )
@@ -34,7 +34,7 @@ class ANALYSIS_EXPORT Bezier3D: public ParametricLine

public:
//! Default constructor
Bezier3D();
Bezier3D() = default;
//! Constructor, par is a pointer to the parent, controlpoly a controlpolygon
Bezier3D( ParametricLine *par, QVector<QgsPoint *> *controlpoly );

@@ -72,11 +72,6 @@ class ANALYSIS_EXPORT Bezier3D: public ParametricLine

//-----------------------------------------------constructors, destructor and assignment operator------------------------------

inline Bezier3D::Bezier3D() : ParametricLine()//default constructor
{

}

inline Bezier3D::Bezier3D( ParametricLine *parent, QVector<QgsPoint *> *controlpoly ) : ParametricLine( parent, controlpoly )
{
mDegree = mControlPoly->count() - 1;
@@ -86,8 +86,7 @@ class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator
#ifndef SIP_RUN

inline NormVecDecorator::NormVecDecorator()
: TriDecorator()
, mNormVec( new QVector<Vector3D*>( DEFAULT_STORAGE_FOR_NORMALS ) )
: mNormVec( new QVector<Vector3D*>( DEFAULT_STORAGE_FOR_NORMALS ) )
, mPointState( new QVector<PointState>( DEFAULT_STORAGE_FOR_NORMALS ) )
{
alreadyestimated = false;
@@ -27,7 +27,7 @@
#define SIP_NO_FILE

#ifndef _MSC_VER
#include <stdint.h>
#include <cstdint>
#else
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
@@ -37,7 +37,7 @@ class QgsLayoutImageExportOptionsDialog: public QDialog, private Ui::QgsLayoutIm
* \param parent parent widget
* \param flags window flags
*/
QgsLayoutImageExportOptionsDialog( QWidget *parent = nullptr, Qt::WindowFlags flags = 0 );
QgsLayoutImageExportOptionsDialog( QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr );

/**
* Sets the initial resolution displayed in the dialog.
@@ -29,7 +29,7 @@ QgsReportSectionModel::QgsReportSectionModel( QgsReport *report, QObject *parent
Qt::ItemFlags QgsReportSectionModel::flags( const QModelIndex &index ) const
{
if ( !index.isValid() )
return 0;
return nullptr;

return QAbstractItemModel::flags( index );
}
@@ -36,9 +36,8 @@
#include <QMessageBox>

#include <cstdio>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <cstdlib>
#include <cstdarg>

#ifdef WIN32
// Open files in binary mode
@@ -72,9 +71,9 @@ typedef SInt32 SRefCon;
#if ((defined(linux) || defined(__linux__)) && !defined(ANDROID)) || defined(__FreeBSD__)
#include <unistd.h>
#include <execinfo.h>
#include <signal.h>
#include <csignal>
#include <sys/wait.h>
#include <errno.h>
#include <cerrno>
#endif

#include "qgscustomization.h"
@@ -747,9 +747,7 @@ QgsAttributesFormProperties::FieldConfig::operator QVariant()
/*
* RelationConfig implementation
*/
QgsAttributesFormProperties::RelationConfig::RelationConfig()
{
}
QgsAttributesFormProperties::RelationConfig::RelationConfig() = default;

QgsAttributesFormProperties::RelationConfig::RelationConfig( QgsVectorLayer *layer, const QString &relationId )
{
@@ -87,9 +87,6 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt
: mType( type )
, mName( name )
, mDisplayName( displayName )
, mColumnCount( 1 )
, mShowAsGroupBox( false )
, mShowLabel( true )
{}

QString name() const { return mName; }
@@ -72,10 +72,6 @@ QgsCustomizationDialog::QgsCustomizationDialog( QWidget * parent, QSettings * se

}

QgsCustomizationDialog::~QgsCustomizationDialog()
{
}

QTreeWidgetItem *QgsCustomizationDialog::item( const QString &path, QTreeWidgetItem *widgetItem )
{
QString pathCopy = path;
@@ -37,7 +37,6 @@ class APP_EXPORT QgsCustomizationDialog : public QMainWindow, private Ui::QgsCus
Q_OBJECT
public:
QgsCustomizationDialog( QWidget *parent, QSettings *settings );
~QgsCustomizationDialog() override;

// get item by path
QTreeWidgetItem *item( const QString &path, QTreeWidgetItem *widgetItem = nullptr );
@@ -82,11 +82,6 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog( QWidget *parent, Qt::Windo
connect( teParameters, &QPlainTextEdit::textChanged, this, &QgsCustomProjectionDialog::updateListFromCurrentItem );
}

QgsCustomProjectionDialog::~QgsCustomProjectionDialog()
{
}


void QgsCustomProjectionDialog::populateList()
{
//Setup connection to the existing custom CRS database:
@@ -33,7 +33,6 @@ class APP_EXPORT QgsCustomProjectionDialog : public QDialog, private Ui::QgsCust
Q_OBJECT
public:
QgsCustomProjectionDialog( QWidget *parent = nullptr, Qt::WindowFlags fl = nullptr );
~QgsCustomProjectionDialog() override;

public slots:
void pbnCalculate_clicked();
@@ -193,11 +193,6 @@ QgsDatumTransformTableWidget::QgsDatumTransformTableWidget( QWidget *parent )
connect( mEditButton, &QToolButton::clicked, this, &QgsDatumTransformTableWidget::editDatumTransform );
}

QgsDatumTransformTableWidget::~QgsDatumTransformTableWidget()
{
}


void QgsDatumTransformTableWidget::addDatumTransform()
{
QgsDatumTransformDialog dlg;
@@ -73,8 +73,7 @@ class APP_EXPORT QgsDatumTransformTableWidget : public QWidget, private Ui::QgsD
Q_OBJECT

public:
explicit QgsDatumTransformTableWidget( QWidget *parent = 0 );
~QgsDatumTransformTableWidget() override;
explicit QgsDatumTransformTableWidget( QWidget *parent = nullptr );

void setTransformContext( const QgsCoordinateTransformContext &context )
{
@@ -26,7 +26,7 @@ class APP_EXPORT QgsFirstRunDialog : public QDialog, private Ui::QgsFirstRunDial
{
Q_OBJECT
public:
QgsFirstRunDialog( QWidget *parent = 0 );
QgsFirstRunDialog( QWidget *parent = nullptr );

bool migrateSettings();

@@ -98,8 +98,7 @@ bool QgsDistanceWidget::eventFilter( QObject *obj, QEvent *ev )


QgsMapToolSelectionHandler::QgsMapToolSelectionHandler( QgsMapCanvas *canvas, QgsMapToolSelectionHandler::SelectionMode selectionMode )
: QObject()
, mCanvas( canvas )
: mCanvas( canvas )
, mSelectionMode( selectionMode )
, mSnapIndicator( qgis::make_unique< QgsSnapIndicator >( canvas ) )
{
@@ -112,11 +112,6 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W

}

QgsNewSpatialiteLayerDialog::~QgsNewSpatialiteLayerDialog()
{

}

void QgsNewSpatialiteLayerDialog::mGeometryTypeBox_currentIndexChanged( int index )
{
pbnFindSRID->setEnabled( index != 0 );
@@ -37,7 +37,6 @@ class APP_EXPORT QgsNewSpatialiteLayerDialog: public QDialog, private Ui::QgsNew

public:
QgsNewSpatialiteLayerDialog( QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, const QgsCoordinateReferenceSystem &defaultCrs = QgsCoordinateReferenceSystem() );
~QgsNewSpatialiteLayerDialog() override;

protected slots:
void mAddAttributeButton_clicked();
@@ -450,11 +450,6 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv
title += QStringLiteral( " (%1)" ).arg( mRasterLayer->styleManager()->currentStyle() );
restoreOptionsBaseUi( title );
optionsStackedWidget_CurrentChanged( mOptionsStackedWidget->currentIndex() );
} // QgsRasterLayerProperties ctor


QgsRasterLayerProperties::~QgsRasterLayerProperties()
{
}

void QgsRasterLayerProperties::setupTransparencyTable( int nBands )
@@ -53,8 +53,6 @@ class APP_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private
*/
QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );

~QgsRasterLayerProperties() override;

//! Synchronize state with associated raster layer
void sync();