Skip to content

Commit ba64e3e

Browse files
committed
Remove redundant initializations
Fixes when a member is initialized both in the header and source to the same initial value (via clang-tidy modernize-use-default-member-init fixit)
1 parent 32dee44 commit ba64e3e

File tree

273 files changed

+207
-825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+207
-825
lines changed

src/analysis/interpolation/CloughTocherInterpolator.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
#include "NormVecDecorator.h"
2121

2222
CloughTocherInterpolator::CloughTocherInterpolator()
23-
: mTIN( nullptr )
24-
, mEdgeTolerance( 0.00001 )
23+
: mEdgeTolerance( 0.00001 )
2524
, der1X( 0.0 )
2625
, der1Y( 0.0 )
2726
, der2X( 0.0 )

src/analysis/interpolation/qgsgridfilewriter.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ QgsGridFileWriter::QgsGridFileWriter( QgsInterpolator *i, const QString &outputP
3535
}
3636

3737
QgsGridFileWriter::QgsGridFileWriter()
38-
: mInterpolator( nullptr )
39-
, mNumColumns( 0 )
38+
: mNumColumns( 0 )
4039
, mNumRows( 0 )
4140
, mCellSizeX( 0 )
4241
, mCellSizeY( 0 )

src/analysis/interpolation/qgstininterpolator.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131

3232
QgsTINInterpolator::QgsTINInterpolator( const QList<LayerData> &inputData, TINInterpolation interpolation, QgsFeedback *feedback )
3333
: QgsInterpolator( inputData )
34-
, mTriangulation( nullptr )
35-
, mTriangleInterpolator( nullptr )
3634
, mIsInitialized( false )
3735
, mFeedback( feedback )
3836
, mInterpolation( interpolation )

src/analysis/openstreetmap/qgsosmdatabase.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@
2121

2222
QgsOSMDatabase::QgsOSMDatabase( const QString &dbFileName )
2323
: mDbFileName( dbFileName )
24-
, mDatabase( nullptr )
25-
, mStmtNode( nullptr )
26-
, mStmtNodeTags( nullptr )
27-
, mStmtWay( nullptr )
28-
, mStmtWayNode( nullptr )
29-
, mStmtWayNodePoints( nullptr )
30-
, mStmtWayTags( nullptr )
3124
{
3225
}
3326

@@ -547,7 +540,6 @@ QString QgsOSMDatabase::quotedValue( QString value )
547540

548541

549542
QgsOSMNodeIterator::QgsOSMNodeIterator( sqlite3 *handle )
550-
: mStmt( nullptr )
551543
{
552544
const char *sql = "SELECT id,lon,lat FROM nodes";
553545
if ( sqlite3_prepare_v2( handle, sql, -1, &mStmt, nullptr ) != SQLITE_OK )
@@ -593,7 +585,6 @@ void QgsOSMNodeIterator::close()
593585

594586

595587
QgsOSMWayIterator::QgsOSMWayIterator( sqlite3 *handle )
596-
: mStmt( nullptr )
597588
{
598589
const char *sql = "SELECT id FROM ways";
599590
if ( sqlite3_prepare_v2( handle, sql, -1, &mStmt, nullptr ) != SQLITE_OK )

src/analysis/openstreetmap/qgsosmdownload.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ QString QgsOSMDownload::queryFromRect( const QgsRectangle &rect )
3939

4040
QgsOSMDownload::QgsOSMDownload()
4141
: mServiceUrl( defaultServiceUrl() )
42-
, mReply( nullptr )
4342
{
4443
}
4544

4645
QgsOSMDownload::QgsOSMDownload( const QString &query )
4746
: mServiceUrl( defaultServiceUrl() )
4847
, mQuery( query )
49-
, mReply( nullptr )
5048
{
5149
}
5250

src/analysis/openstreetmap/qgsosmimport.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
QgsOSMXmlImport::QgsOSMXmlImport( const QString &xmlFilename, const QString &dbFilename )
2424
: mXmlFileName( xmlFilename )
2525
, mDbFileName( dbFilename )
26-
, mDatabase( nullptr )
27-
, mStmtInsertNode( nullptr )
28-
, mStmtInsertNodeTag( nullptr )
29-
, mStmtInsertWay( nullptr )
30-
, mStmtInsertWayNode( nullptr )
31-
, mStmtInsertWayTag( nullptr )
3226
{
3327

3428
}

src/analysis/raster/qgsalignraster.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ static CPLErr rescalePostWarpChunkProcessor( void *pKern, void *pArg )
116116

117117

118118
QgsAlignRaster::QgsAlignRaster()
119-
: mProgressHandler( nullptr )
120119
{
121120
// parameters
122121
mCellSizeX = mCellSizeY = 0;

src/analysis/raster/qgsrastercalcnode.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,20 @@
1919

2020
QgsRasterCalcNode::QgsRasterCalcNode()
2121
: mType( tNumber )
22-
, mLeft( nullptr )
23-
, mRight( nullptr )
2422
, mNumber( 0 )
25-
, mMatrix( nullptr )
2623
, mOperator( opNONE )
2724
{
2825
}
2926

3027
QgsRasterCalcNode::QgsRasterCalcNode( double number )
3128
: mType( tNumber )
32-
, mLeft( nullptr )
33-
, mRight( nullptr )
3429
, mNumber( number )
35-
, mMatrix( nullptr )
3630
, mOperator( opNONE )
3731
{
3832
}
3933

4034
QgsRasterCalcNode::QgsRasterCalcNode( QgsRasterMatrix *matrix )
4135
: mType( tMatrix )
42-
, mLeft( nullptr )
43-
, mRight( nullptr )
4436
, mNumber( 0 )
4537
, mMatrix( matrix )
4638
, mOperator( opNONE )
@@ -53,18 +45,14 @@ QgsRasterCalcNode::QgsRasterCalcNode( Operator op, QgsRasterCalcNode *left, QgsR
5345
, mLeft( left )
5446
, mRight( right )
5547
, mNumber( 0 )
56-
, mMatrix( nullptr )
5748
, mOperator( op )
5849
{
5950
}
6051

6152
QgsRasterCalcNode::QgsRasterCalcNode( const QString &rasterName )
6253
: mType( tRasterRef )
63-
, mLeft( nullptr )
64-
, mRight( nullptr )
6554
, mNumber( 0 )
6655
, mRasterName( rasterName )
67-
, mMatrix( nullptr )
6856
, mOperator( opNONE )
6957
{
7058
if ( mRasterName.startsWith( '"' ) && mRasterName.endsWith( '"' ) )

src/analysis/raster/qgsrastermatrix.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
QgsRasterMatrix::QgsRasterMatrix()
2323
: mColumns( 0 )
2424
, mRows( 0 )
25-
, mData( nullptr )
2625
, mNodataValue( -1 )
2726
{
2827
}
@@ -38,7 +37,6 @@ QgsRasterMatrix::QgsRasterMatrix( int nCols, int nRows, double *data, double nod
3837
QgsRasterMatrix::QgsRasterMatrix( const QgsRasterMatrix &m )
3938
: mColumns( 0 )
4039
, mRows( 0 )
41-
, mData( nullptr )
4240
{
4341
operator=( m );
4442
}

src/app/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,14 @@ if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
656656
SET_TARGET_PROPERTIES(qgis_app PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
657657
ENDIF(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
658658

659+
# clang-tidy
660+
IF(CLANG_TIDY_EXE)
661+
SET_TARGET_PROPERTIES(
662+
qgis_app PROPERTIES
663+
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
664+
)
665+
ENDIF(CLANG_TIDY_EXE)
666+
659667
IF(NOT WIN32)
660668
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME} qgis_app)
661669
ENDIF(NOT WIN32)

src/app/composer/qgsattributeselectiondialog.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,7 @@ QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTa
272272
: QDialog( parent, f )
273273
, mComposerTable( table )
274274
, mVectorLayer( vLayer )
275-
, mColumnModel( nullptr )
276-
, mSortedProxyModel( nullptr )
277-
, mAvailableSortProxyModel( nullptr )
278-
, mColumnAlignmentDelegate( nullptr )
279-
, mColumnSourceDelegate( nullptr )
280-
, mColumnSortOrderDelegate( nullptr )
281-
, mColumnWidthDelegate( nullptr )
275+
282276
{
283277
setupUi( this );
284278

src/app/composer/qgscomposerhtmlwidget.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@ QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml *html, QgsComposer
7272

7373
QgsComposerHtmlWidget::QgsComposerHtmlWidget()
7474
: QgsComposerItemBaseWidget( nullptr, nullptr )
75-
, mHtml( nullptr )
76-
, mFrame( nullptr )
77-
, mHtmlEditor( nullptr )
78-
, mStylesheetEditor( nullptr )
75+
7976
{
8077
}
8178

src/app/composer/qgscomposerlegendwidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend *legend )
119119
connect( mItemFontButton, &QgsFontButton::changed, this, &QgsComposerLegendWidget::itemFontChanged );
120120
}
121121

122-
QgsComposerLegendWidget::QgsComposerLegendWidget(): QgsComposerItemBaseWidget( nullptr, nullptr ), mLegend( nullptr )
122+
QgsComposerLegendWidget::QgsComposerLegendWidget(): QgsComposerItemBaseWidget( nullptr, nullptr )
123123
{
124124
setupUi( this );
125125
}

src/app/composer/qgscompositionwidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget *parent, QgsComposition *c )
125125

126126
QgsCompositionWidget::QgsCompositionWidget()
127127
: QgsPanelWidget( nullptr )
128-
, mComposition( nullptr )
128+
129129
{
130130
setupUi( this );
131131
}

src/app/gps/qgsgpsinformationwidget.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262

6363
QgsGPSInformationWidget::QgsGPSInformationWidget( QgsMapCanvas *thepCanvas, QWidget *parent, Qt::WindowFlags f )
6464
: QWidget( parent, f )
65-
, mNmea( nullptr )
6665
, mpCanvas( thepCanvas )
6766
{
6867
setupUi( this );

src/app/nodetool/qgsselectedfeature.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ QgsSelectedFeature::QgsSelectedFeature( QgsFeatureId featureId,
3333
QgsVectorLayer *vlayer,
3434
QgsMapCanvas *canvas )
3535
: mFeatureId( featureId )
36-
, mGeometry( nullptr )
3736
, mChangingGeometry( false )
38-
, mValidator( nullptr )
3937
{
4038
setSelectedFeature( featureId, vlayer, canvas );
4139
}

src/app/nodetool/qgsvertexentry.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ QgsVertexEntry::QgsVertexEntry( QgsMapCanvas *canvas, QgsMapLayer *layer, const
2222
, mPenWidth( penWidth )
2323
, mToolTip( tooltip )
2424
, mType( type )
25-
, mMarker( nullptr )
2625
, mCanvas( canvas )
2726
, mLayer( layer )
2827
{

src/app/qgisapp.cpp

-104
Original file line numberDiff line numberDiff line change
@@ -605,39 +605,9 @@ QgisApp *QgisApp::sInstance = nullptr;
605605
// constructor starts here
606606
QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCheck, const QString rootProfileLocation, const QString activeProfile, QWidget *parent, Qt::WindowFlags fl )
607607
: QMainWindow( parent, fl )
608-
, mNonEditMapTool( nullptr )
609-
, mScaleWidget( nullptr )
610-
, mMagnifierWidget( nullptr )
611-
, mCoordsEdit( nullptr )
612-
, mRotationLabel( nullptr )
613-
, mRotationEdit( nullptr )
614-
, mRotationEditValidator( nullptr )
615-
, mProgressBar( nullptr )
616-
, mRenderSuppressionCBox( nullptr )
617-
, mOnTheFlyProjectionStatusLabel( nullptr )
618-
, mOnTheFlyProjectionStatusButton( nullptr )
619-
, mMessageButton( nullptr )
620-
, mFeatureActionMenu( nullptr )
621-
, mPopupMenu( nullptr )
622-
, mDatabaseMenu( nullptr )
623-
, mWebMenu( nullptr )
624-
, mToolPopupOverviews( nullptr )
625-
, mToolPopupDisplay( nullptr )
626-
, mLayerTreeCanvasBridge( nullptr )
627608
, mSplash( splash )
628-
, mInternalClipboard( nullptr )
629609
, mShowProjectionTab( false )
630-
, mPythonUtils( nullptr )
631-
, mSnappingWidget( nullptr )
632-
, mMapStylingDock( nullptr )
633-
, mComposerManager( nullptr )
634-
, mpTileScaleWidget( nullptr )
635-
, mpGpsWidget( nullptr )
636-
, mTracer( nullptr )
637-
, mSnappingUtils( nullptr )
638610
, mProjectLastModified()
639-
, mWelcomePage( nullptr )
640-
, mCentralContainer( nullptr )
641611
{
642612
if ( sInstance )
643613
{
@@ -1240,90 +1210,16 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
12401210

12411211
QgisApp::QgisApp()
12421212
: QMainWindow( nullptr, 0 )
1243-
, mStyleSheetBuilder( nullptr )
1244-
, mActionPluginSeparator1( nullptr )
1245-
, mActionPluginSeparator2( nullptr )
1246-
, mActionRasterSeparator( nullptr )
1247-
, mMapToolGroup( nullptr )
1248-
, mPreviewGroup( nullptr )
12491213
#ifdef Q_OS_MAC
12501214
, mWindowMenu( nullptr )
12511215
#endif
1252-
, mPanelMenu( nullptr )
1253-
, mToolbarMenu( nullptr )
1254-
, mLayerTreeDock( nullptr )
1255-
, mLayerOrderDock( nullptr )
1256-
, mOverviewDock( nullptr )
1257-
, mpGpsDock( nullptr )
1258-
, mLogDock( nullptr )
1259-
, mNonEditMapTool( nullptr )
1260-
, mTaskManagerWidget( nullptr )
1261-
, mScaleWidget( nullptr )
1262-
, mMagnifierWidget( nullptr )
1263-
, mCoordsEdit( nullptr )
1264-
, mRotationLabel( nullptr )
1265-
, mRotationEdit( nullptr )
1266-
, mRotationEditValidator( nullptr )
1267-
, mProgressBar( nullptr )
1268-
, mRenderSuppressionCBox( nullptr )
1269-
, mOnTheFlyProjectionStatusLabel( nullptr )
1270-
, mOnTheFlyProjectionStatusButton( nullptr )
1271-
, mMessageButton( nullptr )
1272-
, mFeatureActionMenu( nullptr )
1273-
, mPopupMenu( nullptr )
1274-
, mDatabaseMenu( nullptr )
1275-
, mWebMenu( nullptr )
1276-
, mConfigMenu( nullptr )
1277-
, mToolPopupOverviews( nullptr )
1278-
, mToolPopupDisplay( nullptr )
1279-
, mMapCanvas( nullptr )
1280-
, mOverviewCanvas( nullptr )
1281-
, mLayerTreeView( nullptr )
1282-
, mLayerTreeCanvasBridge( nullptr )
1283-
, mMapLayerOrder( nullptr )
1284-
, mOverviewMapCursor( nullptr )
1285-
, mMapWindow( nullptr )
1286-
, mQgisInterface( nullptr )
1287-
, mSplash( nullptr )
1288-
, mInternalClipboard( nullptr )
12891216
, mShowProjectionTab( false )
1290-
, mpMapTipsTimer( nullptr )
1291-
, mpMaptip( nullptr )
12921217
, mMapTipsVisible( false )
12931218
, mFullScreenMode( false )
12941219
, mPrevScreenModeMaximized( false )
12951220
, mSaveRollbackInProgress( false )
1296-
, mPythonUtils( nullptr )
1297-
, mUndoWidget( nullptr )
1298-
, mUndoDock( nullptr )
1299-
, mBrowserWidget( nullptr )
1300-
, mBrowserWidget2( nullptr )
1301-
, mAdvancedDigitizingDockWidget( nullptr )
1302-
, mStatisticalSummaryDockWidget( nullptr )
1303-
, mBookMarksDockWidget( nullptr )
1304-
, mSnappingWidget( nullptr )
1305-
, mSnappingDialogContainer( nullptr )
1306-
, mSnappingDialog( nullptr )
1307-
, mPluginManager( nullptr )
1308-
, mMapStylingDock( nullptr )
1309-
, mMapStyleWidget( nullptr )
1310-
, mComposerManager( nullptr )
1311-
, mpTileScaleWidget( nullptr )
1312-
, mpGpsWidget( nullptr )
1313-
, mLastMapToolMessage( nullptr )
1314-
, mLogViewer( nullptr )
13151221
, mTrustedMacros( false )
1316-
, mMacrosWarn( nullptr )
1317-
, mUserInputDockWidget( nullptr )
1318-
, mVectorLayerTools( nullptr )
1319-
, mTracer( nullptr )
1320-
, mActionFilterLegend( nullptr )
1321-
, mActionStyleDock( nullptr )
1322-
, mLegendExpressionFilterButton( nullptr )
1323-
, mSnappingUtils( nullptr )
13241222
, mProjectLastModified()
1325-
, mWelcomePage( nullptr )
1326-
, mCentralContainer( nullptr )
13271223
, mProjOpen( 0 )
13281224
{
13291225
sInstance = this;

src/app/qgisappinterface.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151

5252
QgisAppInterface::QgisAppInterface( QgisApp *_qgis )
5353
: qgis( _qgis )
54-
, mTimer( nullptr )
5554
, pluginManagerIface( _qgis->pluginManager() )
5655
{
5756
// connect signals

src/app/qgsattributetabledialog.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ void QgsAttributeTableDialog::updateMultiEditButtonState()
8282

8383
QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QWidget *parent, Qt::WindowFlags flags )
8484
: QDialog( parent, flags )
85-
, mDock( nullptr )
8685
, mLayer( layer )
87-
, mCurrentSearchWidgetWrapper( nullptr )
86+
8887
{
8988
setObjectName( QStringLiteral( "QgsAttributeTableDialog/" ) + layer->id() );
9089
setupUi( this );

0 commit comments

Comments
 (0)