Skip to content
Permalink
Browse files

Remove more unnecessary destructors, flip empty constructors to =default

  • Loading branch information
nyalldawson committed Sep 11, 2017
1 parent c179780 commit 27161279692a80903ee86f9766a4465b1ce658fa
@@ -21,7 +21,6 @@ class QgsGpsdConnection: QgsNMEAConnection
%End
public:
QgsGpsdConnection( const QString &host, qint16 port, const QString &device );
~QgsGpsdConnection();

};

@@ -20,7 +20,6 @@ class QgsNMEAConnection: QgsGPSConnection
%End
public:
QgsNMEAConnection( QIODevice *dev );
~QgsNMEAConnection();

protected slots:
virtual void parseData();
@@ -28,7 +28,6 @@ class QgsQtLocationConnection: QgsGPSConnection
%End
public:
QgsQtLocationConnection();
~QgsQtLocationConnection();

protected slots:
void broadcastConnectionAvailable();
@@ -44,11 +44,6 @@ CloughTocherInterpolator::CloughTocherInterpolator( NormVecDecorator *tin )

}

CloughTocherInterpolator::~CloughTocherInterpolator()
{
//nothing to do
}

void CloughTocherInterpolator::setTriangulation( NormVecDecorator *tin )
{
mTIN = tin;
@@ -102,7 +102,7 @@ class ANALYSIS_EXPORT CloughTocherInterpolator : public TriangleInterpolator
CloughTocherInterpolator();
//! Constructor with a pointer to the triangulation as argument
CloughTocherInterpolator( NormVecDecorator *tin );
virtual ~CloughTocherInterpolator();

//! Calculates the normal vector and assigns it to vec (not implemented at the moment)
virtual bool calcNormVec( double x, double y, Vector3D *result SIP_OUT ) override;
//! Performs a linear interpolation in a triangle and assigns the x-,y- and z-coordinates to point
@@ -54,12 +54,6 @@ QgsPluginRegistry *QgsPluginRegistry::instance()
return sInstance;
}

QgsPluginRegistry::QgsPluginRegistry()

{
// constructor does nothing
}

void QgsPluginRegistry::setQgisInterface( QgisInterface *iface )
{
mQgisInterface = iface;
@@ -96,7 +96,7 @@ class APP_EXPORT QgsPluginRegistry

protected:
//! protected constructor
QgsPluginRegistry();
QgsPluginRegistry() = default;

//! Try to load and get metadata from c++ plugin, return true on success
bool checkCppPlugin( const QString &pluginFullPath );
@@ -95,8 +95,6 @@ class GEOSInit
finishGEOS_r( ctxt );
}

private:

GEOSInit( const GEOSInit &rh ) = delete;
GEOSInit &operator=( const GEOSInit &rh ) = delete;
};
@@ -115,6 +113,10 @@ class GEOSGeomScopedPtr
public:
explicit GEOSGeomScopedPtr( GEOSGeometry *geom = nullptr ) : mGeom( geom ) {}
~GEOSGeomScopedPtr() { GEOSGeom_destroy_r( geosinit.ctxt, mGeom ); }

GEOSGeomScopedPtr( const GEOSGeomScopedPtr &rh ) = delete;
GEOSGeomScopedPtr &operator=( const GEOSGeomScopedPtr &rh ) = delete;

GEOSGeometry *get() const { return mGeom; }
operator bool() const { return nullptr != mGeom; }
void reset( GEOSGeometry *geom )
@@ -126,9 +128,6 @@ class GEOSGeomScopedPtr
private:
GEOSGeometry *mGeom = nullptr;

private:
GEOSGeomScopedPtr( const GEOSGeomScopedPtr &rh ) = delete;
GEOSGeomScopedPtr &operator=( const GEOSGeomScopedPtr &rh ) = delete;
};

QgsGeos::QgsGeos( const QgsAbstractGeometry *geometry, double precision )
@@ -31,11 +31,6 @@ QgsGpsdConnection::QgsGpsdConnection( const QString &host, qint16 port, const QS
socket->connectToHost( host, port );
}

QgsGpsdConnection::~QgsGpsdConnection()
{
//connection will be closed by base class
}

void QgsGpsdConnection::connected()
{
QgsDebugMsg( "connected!" );
@@ -30,7 +30,6 @@ class CORE_EXPORT QgsGpsdConnection: public QgsNMEAConnection
Q_OBJECT
public:
QgsGpsdConnection( const QString &host, qint16 port, const QString &device );
~QgsGpsdConnection();

private slots:
void connected();
@@ -35,11 +35,6 @@ QgsNMEAConnection::QgsNMEAConnection( QIODevice *dev ): QgsGPSConnection( dev )
{
}

QgsNMEAConnection::~QgsNMEAConnection()
{
//connection will be closed by base class
}

void QgsNMEAConnection::parseData()
{
if ( !mSource )
@@ -29,7 +29,6 @@ class CORE_EXPORT QgsNMEAConnection: public QgsGPSConnection
Q_OBJECT
public:
QgsNMEAConnection( QIODevice *dev );
~QgsNMEAConnection();

protected slots:
//! Parse available data source content
@@ -34,11 +34,6 @@ QgsQtLocationConnection::QgsQtLocationConnection(): QgsGPSConnection( new QLocal
QTimer::singleShot( 500, this, SLOT( broadcastConnectionAvailable() ) );
}

QgsQtLocationConnection::~QgsQtLocationConnection()
{
//connection will be closed by base class
}

//Needed to make connection detectable (half HACK)
//this signals that the device has started the GPS successfully,
//not that it has a fix yet.
@@ -52,7 +52,6 @@ class CORE_EXPORT QgsQtLocationConnection: public QgsGPSConnection
Q_OBJECT
public:
QgsQtLocationConnection();
~QgsQtLocationConnection();

protected slots:
//! Needed to make QtLocation detected
@@ -22,11 +22,6 @@ QgsRuleBasedLabelProvider::QgsRuleBasedLabelProvider( const QgsRuleBasedLabeling
mRules->rootRule()->createSubProviders( layer, mSubProviders, this );
}

QgsRuleBasedLabelProvider::~QgsRuleBasedLabelProvider()
{
// sub-providers owned by labeling engine
}

QgsVectorLayerLabelProvider *QgsRuleBasedLabelProvider::createProvider( QgsVectorLayer *layer, const QString &providerId, bool withFeatureLoop, const QgsPalLayerSettings *settings )
{
return new QgsVectorLayerLabelProvider( layer, providerId, withFeatureLoop, settings );
@@ -358,7 +358,6 @@ class CORE_EXPORT QgsRuleBasedLabelProvider : public QgsVectorLayerLabelProvider
{
public:
QgsRuleBasedLabelProvider( const QgsRuleBasedLabeling &rules, QgsVectorLayer *layer, bool withFeatureLoop = true );
~QgsRuleBasedLabelProvider();

// reimplemented

@@ -195,6 +195,8 @@ class QgsSpatialIndexData : public QSharedData
delete mStorage;
}

QgsSpatialIndexData &operator=( const QgsSpatialIndexData &rh ) = delete;

void initTree( IDataStream *inputStream = nullptr )
{
// for now only memory manager
@@ -224,9 +226,6 @@ class QgsSpatialIndexData : public QSharedData
//! R-tree containing spatial index
SpatialIndex::ISpatialIndex *mRTree = nullptr;

private:

QgsSpatialIndexData &operator=( const QgsSpatialIndexData &rh ) = delete;
};

// -------------------------------------------------------------------------
@@ -21,12 +21,6 @@

typedef QList<QgsSourceSelectProvider *> *sourceSelectProviders_t();


QgsSourceSelectProviderRegistry::QgsSourceSelectProviderRegistry()
{
// Initialization is delayed
}

QgsSourceSelectProviderRegistry::~QgsSourceSelectProviderRegistry()
{
qDeleteAll( mProviders );
@@ -37,7 +37,7 @@ class QgsSourceSelectProvider;
class GUI_EXPORT QgsSourceSelectProviderRegistry
{
public:
QgsSourceSelectProviderRegistry();
QgsSourceSelectProviderRegistry() = default;

~QgsSourceSelectProviderRegistry();

@@ -34,11 +34,6 @@ QgsOgrDbConnection::QgsOgrDbConnection( const QString &connName, const QString &
mPath = settings.value( key ).toString();
}

QgsOgrDbConnection::~QgsOgrDbConnection()
{

}

QgsDataSourceUri QgsOgrDbConnection::uri()
{
QgsDataSourceUri uri;
@@ -33,8 +33,6 @@ class QgsOgrDbConnection : public QObject
//! Constructor
explicit QgsOgrDbConnection( const QString &connName, const QString &settingsKey );

~QgsOgrDbConnection();

static const QStringList connectionList( const QString &settingsKey );
static void deleteConnection( const QString &connName, const QString &settingsKey );
static QString selectedConnection( const QString &settingsKey );

0 comments on commit 2716127

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