Skip to content

Commit

Permalink
Cleanup some constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 11, 2017
1 parent 871f713 commit c97fa5b
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 26 deletions.
3 changes: 3 additions & 0 deletions python/core/effects/qgspainteffect.sip
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ class QgsDrawSourceEffect : QgsPaintEffect
public:

QgsDrawSourceEffect();
%Docstring
Constructor for QgsDrawSourceEffect
%End

static QgsPaintEffect *create( const QgsStringMap &map ) /Factory/;
%Docstring
Expand Down
4 changes: 4 additions & 0 deletions python/core/qgsdiagramrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,11 @@ class QgsSingleCategoryDiagramRenderer : QgsDiagramRenderer
#include "qgsdiagramrenderer.h"
%End
public:

QgsSingleCategoryDiagramRenderer();
%Docstring
Constructor for QgsSingleCategoryDiagramRenderer
%End

virtual QgsSingleCategoryDiagramRenderer *clone() const /Factory/;

Expand Down
5 changes: 0 additions & 5 deletions src/core/effects/qgspainteffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@ QRectF QgsPaintEffect::imageBoundingRect( const QgsRenderContext &context ) cons
// QgsDrawSourceEffect
//

QgsDrawSourceEffect::QgsDrawSourceEffect()
: QgsPaintEffect()
{
}

QgsPaintEffect *QgsDrawSourceEffect::create( const QgsStringMap &map )
{
QgsDrawSourceEffect *effect = new QgsDrawSourceEffect();
Expand Down
3 changes: 2 additions & 1 deletion src/core/effects/qgspainteffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ class CORE_EXPORT QgsDrawSourceEffect : public QgsPaintEffect
{
public:

QgsDrawSourceEffect();
//! Constructor for QgsDrawSourceEffect
QgsDrawSourceEffect() = default;

/**
* Creates a new QgsDrawSource effect from a properties string map.
Expand Down
4 changes: 1 addition & 3 deletions src/core/layout/qgslayoutundostack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include <QUndoStack>

QgsLayoutUndoStack::QgsLayoutUndoStack( QgsLayout *layout )
: QObject()
, mLayout( layout )
: mLayout( layout )
, mUndoStack( new QUndoStack( layout ) )
{
connect( mUndoStack.get(), &QUndoStack::indexChanged, this, &QgsLayoutUndoStack::indexChanged );
Expand Down Expand Up @@ -75,7 +74,6 @@ void QgsLayoutUndoStack::cancelCommand()
QUndoStack *QgsLayoutUndoStack::stack()
{
return mUndoStack.get();

}

void QgsLayoutUndoStack::notifyUndoRedoOccurred( QgsLayoutItem *item )
Expand Down
3 changes: 1 addition & 2 deletions src/core/qgscolorscheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ bool QgsGplColorScheme::setColors( const QgsNamedColorList &colors, const QStrin
//

QgsUserColorScheme::QgsUserColorScheme( const QString &filename )
: QgsGplColorScheme()
, mFilename( filename )
: mFilename( filename )
{
QFile sourceFile( gplFilePath() );

Expand Down
5 changes: 0 additions & 5 deletions src/core/qgsdiagramrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,6 @@ void QgsDiagramRenderer::_writeXml( QDomElement &rendererElem, QDomDocument &doc
rendererElem.setAttribute( QStringLiteral( "attributeLegend" ), mShowAttributeLegend );
}

QgsSingleCategoryDiagramRenderer::QgsSingleCategoryDiagramRenderer(): QgsDiagramRenderer()
{
}

QgsSingleCategoryDiagramRenderer *QgsSingleCategoryDiagramRenderer::clone() const
{
return new QgsSingleCategoryDiagramRenderer( *this );
Expand Down Expand Up @@ -589,7 +585,6 @@ void QgsSingleCategoryDiagramRenderer::writeXml( QDomElement &layerElem, QDomDoc


QgsLinearlyInterpolatedDiagramRenderer::QgsLinearlyInterpolatedDiagramRenderer()
: QgsDiagramRenderer()
{
mInterpolationSettings.classificationAttributeIsExpression = false;
}
Expand Down
4 changes: 3 additions & 1 deletion src/core/qgsdiagramrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,9 @@ class CORE_EXPORT QgsDiagramRenderer
class CORE_EXPORT QgsSingleCategoryDiagramRenderer : public QgsDiagramRenderer
{
public:
QgsSingleCategoryDiagramRenderer();

//! Constructor for QgsSingleCategoryDiagramRenderer
QgsSingleCategoryDiagramRenderer() = default;

QgsSingleCategoryDiagramRenderer *clone() const override SIP_FACTORY;

Expand Down
6 changes: 2 additions & 4 deletions src/core/qgsmultirenderchecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ QString QgsMultiRenderChecker::controlImagePath() const
///@cond PRIVATE

QgsCompositionChecker::QgsCompositionChecker( const QString &testName, QgsComposition *composition )
: QgsMultiRenderChecker()
, mTestName( testName )
: mTestName( testName )
, mComposition( composition )
, mSize( 1122, 794 )
, mDotsPerMeter( 96 / 25.4 * 1000 )
Expand Down Expand Up @@ -178,8 +177,7 @@ bool QgsCompositionChecker::testComposition( QString &checkedReport, int page, i
//

QgsLayoutChecker::QgsLayoutChecker( const QString &testName, QgsLayout *layout )
: QgsMultiRenderChecker()
, mTestName( testName )
: mTestName( testName )
, mLayout( layout )
, mSize( 1122, 794 )
, mDotsPerMeter( 96 / 25.4 * 1000 )
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/grass/qgsgrassmapcalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,6 @@ void QgsGrassMapcalc::clear()
/**************************** OBJECT ************************/
QgsGrassMapcalcObject::QgsGrassMapcalcObject( int type )
: QGraphicsRectItem( -1000, -1000, 50, 20, 0 )
, QgsGrassMapcalcItem()
, mType( type )
, mRound( 0. )
, mCenter( -1000, -1000 )
Expand Down Expand Up @@ -1794,10 +1793,7 @@ QString QgsGrassMapcalcObject::expression()

/************************* CONNECTOR **********************************/
QgsGrassMapcalcConnector::QgsGrassMapcalcConnector( QGraphicsScene *canvas )
: QgsGrassMapcalcItem()
, mSelectedEnd( -1 )
{

canvas->addItem( this );

QGraphicsLineItem::setZValue( 10 );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmapcalc.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class QgsGrassMapcalcConnector: public QGraphicsLineItem, public QgsGrassMapcalc
std::vector<QPoint> mPoints;

// Selected end, -1 for whole connector
int mSelectedEnd;
int mSelectedEnd = -1;

// Connected objects
std::vector<QgsGrassMapcalcObject *> mSocketObjects;
Expand Down

0 comments on commit c97fa5b

Please sign in to comment.