Skip to content
Permalink
Browse files

Run clang-tidy modernization checks

  • Loading branch information
nyalldawson committed Jun 5, 2018
1 parent 8f55093 commit b69389b6503e94834c4027dd95cbbf849ccbe83e
Showing with 279 additions and 448 deletions.
  1. +0 −1 python/gui/auto_generated/qgsnewgeopackagelayerdialog.sip.in
  2. +0 −3 python/gui/auto_generated/qgsprojectionselectiondialog.sip.in
  3. +0 −2 src/3d/chunks/qgschunkedentity_p.cpp
  4. +1 −1 src/3d/qgs3dmapsettings.cpp
  5. +1 −1 src/3d/qgsaabb.h
  6. +0 −4 src/3d/qgstessellatedpolygongeometry.cpp
  7. +0 −1 src/3d/qgstessellatedpolygongeometry.h
  8. +1 −1 src/3d/qgstilingscheme.cpp
  9. +1 −6 src/analysis/interpolation/Bezier3D.h
  10. +1 −2 src/analysis/interpolation/NormVecDecorator.h
  11. +1 −1 src/analysis/vector/mersenne-twister.h
  12. +1 −1 src/app/layout/qgslayoutimageexportoptionsdialog.h
  13. +1 −1 src/app/layout/qgsreportsectionmodel.cpp
  14. +4 −5 src/app/main.cpp
  15. +1 −3 src/app/qgsattributesformproperties.cpp
  16. +0 −3 src/app/qgsattributesformproperties.h
  17. +0 −4 src/app/qgscustomization.cpp
  18. +0 −1 src/app/qgscustomization.h
  19. +0 −5 src/app/qgscustomprojectiondialog.cpp
  20. +0 −1 src/app/qgscustomprojectiondialog.h
  21. +0 −5 src/app/qgsdatumtransformtablewidget.cpp
  22. +1 −2 src/app/qgsdatumtransformtablewidget.h
  23. +1 −1 src/app/qgsfirstrundialog.h
  24. +1 −2 src/app/qgsmaptoolselectionhandler.cpp
  25. +0 −5 src/app/qgsnewspatialitelayerdialog.cpp
  26. +0 −1 src/app/qgsnewspatialitelayerdialog.h
  27. +0 −5 src/app/qgsrasterlayerproperties.cpp
  28. +0 −2 src/app/qgsrasterlayerproperties.h
  29. +0 −5 src/app/qgssnappingwidget.cpp
  30. +1 −1 src/auth/basic/qgsauthbasicedit.h
  31. +1 −1 src/auth/identcert/qgsauthidentcertedit.h
  32. +1 −1 src/auth/pkipaths/qgsauthpkipathsedit.h
  33. +1 −1 src/auth/pkipkcs12/qgsauthpkcs12edit.h
  34. +1 −1 src/core/layout/qgslayoutexporter.cpp
  35. +4 −4 src/core/layout/qgslayoutexporter.h
  36. +0 −4 src/core/mesh/qgsmeshmemorydataprovider.cpp
  37. +0 −1 src/core/mesh/qgsmeshmemorydataprovider.h
  38. +3 −3 src/core/mesh/qgsmeshvectorrenderer.cpp
  39. +1 −1 src/core/qgscoordinatereferencesystem_p.h
  40. +0 −1 src/core/qgsnetworkcontentfetcherregistry.cpp
  41. +1 −2 src/core/qgsnetworkcontentfetcherregistry.h
  42. +1 −2 src/core/qgsvirtuallayertask.cpp
  43. +0 −2 src/core/symbology/qgsrulebasedrenderer.cpp
  44. +1 −1 src/gui/editorwidgets/core/qgseditorwidgetautoconf.h
  45. +0 −5 src/gui/layout/qgslayoutreportsectionlabel.cpp
  46. +0 −2 src/gui/layout/qgslayoutreportsectionlabel.h
  47. +0 −4 src/gui/ogr/qgsvectorlayersaveasdialog.cpp
  48. +0 −1 src/gui/ogr/qgsvectorlayersaveasdialog.h
  49. +0 −1 src/gui/processing/qgsprocessingalgorithmdialogbase.cpp
  50. +0 −1 src/gui/qgsattributeformwidget.cpp
  51. +0 −6 src/gui/qgsmaplayeractionregistry.cpp
  52. +0 −4 src/gui/qgsnewgeopackagelayerdialog.cpp
  53. +0 −1 src/gui/qgsnewgeopackagelayerdialog.h
  54. +0 −4 src/gui/qgsprojectionselectiondialog.cpp
  55. +0 −3 src/gui/qgsprojectionselectiondialog.h
  56. +4 −4 src/providers/db2/qgsdb2dataitems.cpp
  57. +1 −1 src/providers/db2/qgsdb2sourceselect.h
  58. +0 −4 src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.cpp
  59. +0 −1 src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.h
  60. +1 −3 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  61. +0 −1 src/providers/delimitedtext/qgsdelimitedtextprovider.h
  62. +1 −1 src/providers/mssql/qgsmssqldataitems.cpp
  63. +1 −1 src/providers/ogr/qgsogrprovider.cpp
  64. +1 −2 src/providers/oracle/ocispatial/main.cpp
  65. +1 −1 src/providers/oracle/ocispatial/main.h
  66. +110 −132 src/providers/oracle/ocispatial/qsql_ocispatial.cpp
  67. +5 −5 src/providers/oracle/ocispatial/qsql_ocispatial.h
  68. +7 −12 src/providers/oracle/ocispatial/wkbptr.h
  69. +1 −3 src/providers/oracle/qgsoraclecolumntypethread.cpp
  70. +1 −1 src/providers/oracle/qgsoraclecolumntypethread.h
  71. +3 −5 src/providers/oracle/qgsoracleconn.h
  72. +1 −1 src/providers/oracle/qgsoracleconnpool.h
  73. +0 −9 src/providers/oracle/qgsoracledataitems.cpp
  74. +1 −3 src/providers/oracle/qgsoracledataitems.h
  75. +2 −2 src/providers/oracle/qgsoraclefeatureiterator.h
  76. +3 −9 src/providers/oracle/qgsoracleprovider.cpp
  77. +7 −7 src/providers/oracle/qgsoracleprovider.h
  78. +5 −6 src/providers/oracle/qgsoraclesourceselect.h
  79. +4 −4 src/providers/oracle/qgsoracletablecache.cpp
  80. +1 −7 src/providers/oracle/qgsoracletablemodel.cpp
  81. +2 −3 src/providers/oracle/qgsoracletablemodel.h
  82. +0 −2 src/providers/spatialite/qgsspatialitefeatureiterator.cpp
  83. +1 −1 src/providers/virtual/qgsvirtuallayerblob.cpp
  84. +1 −1 src/providers/virtual/qgsvirtuallayerblob.h
  85. +1 −1 src/providers/virtual/qgsvirtuallayersqlitemodule.cpp
  86. +1 −1 src/providers/wms/qgswmscapabilities.cpp
  87. +1 −1 src/server/qgsfeaturefilter.h
  88. +1 −1 src/server/qgsfeaturefilterprovidergroup.h
  89. +1 −1 src/server/qgsserver.cpp
  90. +18 −19 tests/bench/main.cpp
  91. +3 −3 tests/bench/qgsbench.cpp
  92. +6 −6 tests/src/analysis/testqgsprocessing.cpp
  93. +3 −3 tests/src/analysis/testqgsrastercalculator.cpp
  94. +1 −1 tests/src/app/testqgsmaptoolidentifyaction.cpp
  95. +2 −2 tests/src/core/testqgsdiagram.cpp
  96. +6 −6 tests/src/core/testqgsgeometry.cpp
  97. +1 −1 tests/src/core/testqgsgeometryimport.cpp
  98. +1 −1 tests/src/core/testqgshistogram.cpp
  99. +3 −3 tests/src/core/testqgslabelingengine.cpp
  100. +1 −1 tests/src/core/testqgslayoutcontext.cpp
  101. +1 −1 tests/src/core/testqgslayoutmap.cpp
  102. +6 −6 tests/src/core/testqgslayoutmodel.cpp
  103. +1 −1 tests/src/core/testqgslayoututils.cpp
  104. +1 −1 tests/src/core/testqgsmaplayer.cpp
  105. +1 −1 tests/src/core/testqgsmapsettings.cpp
  106. +2 −2 tests/src/core/testqgsstatisticalsummary.cpp
  107. +1 −1 tests/src/core/testqgstaskmanager.cpp
  108. +2 −2 tests/src/core/testqgsvectordataprovider.cpp
  109. +3 −3 tests/src/gui/testqgsmaptoolzoom.cpp
  110. +1 −1 tests/src/gui/testqgsrubberband.cpp
  111. +4 −4 tests/src/providers/testqgsogrprovider.cpp
  112. +9 −9 tests/src/providers/testqgswcspublicservers.cpp
@@ -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();

@@ -47,11 +47,6 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
, mProject( project )
, mConfig( project )
, mCanvas( canvas )
, mModeAction( nullptr )
, mTypeAction( nullptr )
, mToleranceAction( nullptr )
, mUnitAction( nullptr )

{
// detect the type of display
QToolBar *tb = qobject_cast<QToolBar *>( parent );
@@ -49,7 +49,7 @@ class QgsAuthBasicEdit : public QgsAuthMethodEdit, private Ui::QgsAuthBasicEdit

private:
QgsStringMap mConfigMap;
bool mValid = 0;
bool mValid = false;
};

#endif // QGSAUTHBASICEDIT_H
@@ -49,7 +49,7 @@ class QgsAuthIdentCertEdit : public QgsAuthMethodEdit, private Ui::QgsAuthIdentC

private:
QgsStringMap mConfigMap;
bool mValid = 0;
bool mValid = false;
};

#endif // QGSAUTHIDENTCERTEDIT_H
@@ -67,7 +67,7 @@ class QgsAuthPkiPathsEdit : public QgsAuthMethodEdit, private Ui::QgsAuthPkiPath
bool validityChange( bool curvalid );
bool populateCas();
QgsStringMap mConfigMap;
bool mValid = 0;
bool mValid = false;
};

#endif // QGSAUTHPKIPATHSEDIT_H
@@ -67,7 +67,7 @@ class QgsAuthPkcs12Edit : public QgsAuthMethodEdit, private Ui::QgsAuthPkcs12Edi
bool populateCas( );

QgsStringMap mConfigMap;
bool mValid = 0;
bool mValid = false;
};

#endif // QGSAUTHPKCS12EDIT_H
@@ -289,7 +289,7 @@ class LayoutContextSettingsRestorer
private:
QgsLayout *mLayout = nullptr;
double mPreviousDpi = 0;
QgsLayoutRenderContext::Flags mPreviousFlags = 0;
QgsLayoutRenderContext::Flags mPreviousFlags = nullptr;
int mPreviousExportLayer = 0;
};
///@endcond PRIVATE
@@ -203,7 +203,7 @@ class CORE_EXPORT QgsLayoutExporter
/**
* Layout context flags, which control how the export will be created.
*/
QgsLayoutRenderContext::Flags flags = 0;
QgsLayoutRenderContext::Flags flags = nullptr;

};

@@ -273,7 +273,7 @@ class CORE_EXPORT QgsLayoutExporter
/**
* Layout context flags, which control how the export will be created.
*/
QgsLayoutRenderContext::Flags flags = 0;
QgsLayoutRenderContext::Flags flags = nullptr;

};

@@ -338,7 +338,7 @@ class CORE_EXPORT QgsLayoutExporter
/**
* Layout context flags, which control how the export will be created.
*/
QgsLayoutRenderContext::Flags flags = 0;
QgsLayoutRenderContext::Flags flags = nullptr;

};

@@ -412,7 +412,7 @@ class CORE_EXPORT QgsLayoutExporter
/**
* Layout context flags, which control how the export will be created.
*/
QgsLayoutRenderContext::Flags flags = 0;
QgsLayoutRenderContext::Flags flags = nullptr;

};

0 comments on commit b69389b

Please sign in to comment.
You can’t perform that action at this time.