Skip to content

Commit 2716127

Browse files
committed
Remove more unnecessary destructors, flip empty constructors to =default
1 parent c179780 commit 2716127

21 files changed

+9
-62
lines changed

python/core/gps/qgsgpsdconnection.sip

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class QgsGpsdConnection: QgsNMEAConnection
2121
%End
2222
public:
2323
QgsGpsdConnection( const QString &host, qint16 port, const QString &device );
24-
~QgsGpsdConnection();
2524

2625
};
2726

python/core/gps/qgsnmeaconnection.sip

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class QgsNMEAConnection: QgsGPSConnection
2020
%End
2121
public:
2222
QgsNMEAConnection( QIODevice *dev );
23-
~QgsNMEAConnection();
2423

2524
protected slots:
2625
virtual void parseData();

python/core/gps/qgsqtlocationconnection.sip

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class QgsQtLocationConnection: QgsGPSConnection
2828
%End
2929
public:
3030
QgsQtLocationConnection();
31-
~QgsQtLocationConnection();
3231

3332
protected slots:
3433
void broadcastConnectionAvailable();

src/analysis/interpolation/CloughTocherInterpolator.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ CloughTocherInterpolator::CloughTocherInterpolator( NormVecDecorator *tin )
4444

4545
}
4646

47-
CloughTocherInterpolator::~CloughTocherInterpolator()
48-
{
49-
//nothing to do
50-
}
51-
5247
void CloughTocherInterpolator::setTriangulation( NormVecDecorator *tin )
5348
{
5449
mTIN = tin;

src/analysis/interpolation/CloughTocherInterpolator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class ANALYSIS_EXPORT CloughTocherInterpolator : public TriangleInterpolator
102102
CloughTocherInterpolator();
103103
//! Constructor with a pointer to the triangulation as argument
104104
CloughTocherInterpolator( NormVecDecorator *tin );
105-
virtual ~CloughTocherInterpolator();
105+
106106
//! Calculates the normal vector and assigns it to vec (not implemented at the moment)
107107
virtual bool calcNormVec( double x, double y, Vector3D *result SIP_OUT ) override;
108108
//! Performs a linear interpolation in a triangle and assigns the x-,y- and z-coordinates to point

src/app/qgspluginregistry.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ QgsPluginRegistry *QgsPluginRegistry::instance()
5454
return sInstance;
5555
}
5656

57-
QgsPluginRegistry::QgsPluginRegistry()
58-
59-
{
60-
// constructor does nothing
61-
}
62-
6357
void QgsPluginRegistry::setQgisInterface( QgisInterface *iface )
6458
{
6559
mQgisInterface = iface;

src/app/qgspluginregistry.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class APP_EXPORT QgsPluginRegistry
9696

9797
protected:
9898
//! protected constructor
99-
QgsPluginRegistry();
99+
QgsPluginRegistry() = default;
100100

101101
//! Try to load and get metadata from c++ plugin, return true on success
102102
bool checkCppPlugin( const QString &pluginFullPath );

src/core/geometry/qgsgeos.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ class GEOSInit
9595
finishGEOS_r( ctxt );
9696
}
9797

98-
private:
99-
10098
GEOSInit( const GEOSInit &rh ) = delete;
10199
GEOSInit &operator=( const GEOSInit &rh ) = delete;
102100
};
@@ -115,6 +113,10 @@ class GEOSGeomScopedPtr
115113
public:
116114
explicit GEOSGeomScopedPtr( GEOSGeometry *geom = nullptr ) : mGeom( geom ) {}
117115
~GEOSGeomScopedPtr() { GEOSGeom_destroy_r( geosinit.ctxt, mGeom ); }
116+
117+
GEOSGeomScopedPtr( const GEOSGeomScopedPtr &rh ) = delete;
118+
GEOSGeomScopedPtr &operator=( const GEOSGeomScopedPtr &rh ) = delete;
119+
118120
GEOSGeometry *get() const { return mGeom; }
119121
operator bool() const { return nullptr != mGeom; }
120122
void reset( GEOSGeometry *geom )
@@ -126,9 +128,6 @@ class GEOSGeomScopedPtr
126128
private:
127129
GEOSGeometry *mGeom = nullptr;
128130

129-
private:
130-
GEOSGeomScopedPtr( const GEOSGeomScopedPtr &rh ) = delete;
131-
GEOSGeomScopedPtr &operator=( const GEOSGeomScopedPtr &rh ) = delete;
132131
};
133132

134133
QgsGeos::QgsGeos( const QgsAbstractGeometry *geometry, double precision )

src/core/gps/qgsgpsdconnection.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ QgsGpsdConnection::QgsGpsdConnection( const QString &host, qint16 port, const QS
3131
socket->connectToHost( host, port );
3232
}
3333

34-
QgsGpsdConnection::~QgsGpsdConnection()
35-
{
36-
//connection will be closed by base class
37-
}
38-
3934
void QgsGpsdConnection::connected()
4035
{
4136
QgsDebugMsg( "connected!" );

src/core/gps/qgsgpsdconnection.h

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class CORE_EXPORT QgsGpsdConnection: public QgsNMEAConnection
3030
Q_OBJECT
3131
public:
3232
QgsGpsdConnection( const QString &host, qint16 port, const QString &device );
33-
~QgsGpsdConnection();
3433

3534
private slots:
3635
void connected();

src/core/gps/qgsnmeaconnection.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ QgsNMEAConnection::QgsNMEAConnection( QIODevice *dev ): QgsGPSConnection( dev )
3535
{
3636
}
3737

38-
QgsNMEAConnection::~QgsNMEAConnection()
39-
{
40-
//connection will be closed by base class
41-
}
42-
4338
void QgsNMEAConnection::parseData()
4439
{
4540
if ( !mSource )

src/core/gps/qgsnmeaconnection.h

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class CORE_EXPORT QgsNMEAConnection: public QgsGPSConnection
2929
Q_OBJECT
3030
public:
3131
QgsNMEAConnection( QIODevice *dev );
32-
~QgsNMEAConnection();
3332

3433
protected slots:
3534
//! Parse available data source content

src/core/gps/qgsqtlocationconnection.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ QgsQtLocationConnection::QgsQtLocationConnection(): QgsGPSConnection( new QLocal
3434
QTimer::singleShot( 500, this, SLOT( broadcastConnectionAvailable() ) );
3535
}
3636

37-
QgsQtLocationConnection::~QgsQtLocationConnection()
38-
{
39-
//connection will be closed by base class
40-
}
41-
4237
//Needed to make connection detectable (half HACK)
4338
//this signals that the device has started the GPS successfully,
4439
//not that it has a fix yet.

src/core/gps/qgsqtlocationconnection.h

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class CORE_EXPORT QgsQtLocationConnection: public QgsGPSConnection
5252
Q_OBJECT
5353
public:
5454
QgsQtLocationConnection();
55-
~QgsQtLocationConnection();
5655

5756
protected slots:
5857
//! Needed to make QtLocation detected

src/core/qgsrulebasedlabeling.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ QgsRuleBasedLabelProvider::QgsRuleBasedLabelProvider( const QgsRuleBasedLabeling
2222
mRules->rootRule()->createSubProviders( layer, mSubProviders, this );
2323
}
2424

25-
QgsRuleBasedLabelProvider::~QgsRuleBasedLabelProvider()
26-
{
27-
// sub-providers owned by labeling engine
28-
}
29-
3025
QgsVectorLayerLabelProvider *QgsRuleBasedLabelProvider::createProvider( QgsVectorLayer *layer, const QString &providerId, bool withFeatureLoop, const QgsPalLayerSettings *settings )
3126
{
3227
return new QgsVectorLayerLabelProvider( layer, providerId, withFeatureLoop, settings );

src/core/qgsrulebasedlabeling.h

-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ class CORE_EXPORT QgsRuleBasedLabelProvider : public QgsVectorLayerLabelProvider
358358
{
359359
public:
360360
QgsRuleBasedLabelProvider( const QgsRuleBasedLabeling &rules, QgsVectorLayer *layer, bool withFeatureLoop = true );
361-
~QgsRuleBasedLabelProvider();
362361

363362
// reimplemented
364363

src/core/qgsspatialindex.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ class QgsSpatialIndexData : public QSharedData
195195
delete mStorage;
196196
}
197197

198+
QgsSpatialIndexData &operator=( const QgsSpatialIndexData &rh ) = delete;
199+
198200
void initTree( IDataStream *inputStream = nullptr )
199201
{
200202
// for now only memory manager
@@ -224,9 +226,6 @@ class QgsSpatialIndexData : public QSharedData
224226
//! R-tree containing spatial index
225227
SpatialIndex::ISpatialIndex *mRTree = nullptr;
226228

227-
private:
228-
229-
QgsSpatialIndexData &operator=( const QgsSpatialIndexData &rh ) = delete;
230229
};
231230

232231
// -------------------------------------------------------------------------

src/gui/qgssourceselectproviderregistry.cpp

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

2222
typedef QList<QgsSourceSelectProvider *> *sourceSelectProviders_t();
2323

24-
25-
QgsSourceSelectProviderRegistry::QgsSourceSelectProviderRegistry()
26-
{
27-
// Initialization is delayed
28-
}
29-
3024
QgsSourceSelectProviderRegistry::~QgsSourceSelectProviderRegistry()
3125
{
3226
qDeleteAll( mProviders );

src/gui/qgssourceselectproviderregistry.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class QgsSourceSelectProvider;
3737
class GUI_EXPORT QgsSourceSelectProviderRegistry
3838
{
3939
public:
40-
QgsSourceSelectProviderRegistry();
40+
QgsSourceSelectProviderRegistry() = default;
4141

4242
~QgsSourceSelectProviderRegistry();
4343

src/providers/ogr/qgsogrdbconnection.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ QgsOgrDbConnection::QgsOgrDbConnection( const QString &connName, const QString &
3434
mPath = settings.value( key ).toString();
3535
}
3636

37-
QgsOgrDbConnection::~QgsOgrDbConnection()
38-
{
39-
40-
}
41-
4237
QgsDataSourceUri QgsOgrDbConnection::uri()
4338
{
4439
QgsDataSourceUri uri;

src/providers/ogr/qgsogrdbconnection.h

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class QgsOgrDbConnection : public QObject
3333
//! Constructor
3434
explicit QgsOgrDbConnection( const QString &connName, const QString &settingsKey );
3535

36-
~QgsOgrDbConnection();
37-
3836
static const QStringList connectionList( const QString &settingsKey );
3937
static void deleteConnection( const QString &connName, const QString &settingsKey );
4038
static QString selectedConnection( const QString &settingsKey );

0 commit comments

Comments
 (0)