Skip to content

Commit b80829c

Browse files
committedJan 10, 2019
Remove leftover QObject inheritance
1 parent 93bfbd0 commit b80829c

File tree

5 files changed

+12
-19
lines changed

5 files changed

+12
-19
lines changed
 

‎python/core/auto_generated/validity/qgsabstractvaliditycheck.sip.in

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ result will be communicated to users, but not prevent them from proceeding.
4141

4242
};
4343

44-
45-
class QgsAbstractValidityCheck : QObject
44+
class QgsAbstractValidityCheck
4645
{
4746
%Docstring
4847
Abstract base class for individual validity checks.
@@ -77,6 +76,8 @@ Checks must be registered in the application's :py:class:`QgsValidityCheckRegist
7776
TypeUserCheck,
7877
};
7978

79+
virtual ~QgsAbstractValidityCheck();
80+
8081
virtual QgsAbstractValidityCheck *create() const = 0 /Factory/;
8182
%Docstring
8283
Creates a new instance of the check and returns it.
@@ -126,9 +127,6 @@ The ``context`` argument gives the wider in which the check is being run.
126127

127128
};
128129

129-
130-
131-
132130
/************************************************************************
133131
* This file has been generated automatically from *
134132
* *

‎src/app/layout/qgslayoutvaliditychecks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ bool QgsLayoutScaleBarValidityCheck::prepareCheck( const QgsValidityCheckContext
5151
{
5252
QgsValidityCheckResult res;
5353
res.type = QgsValidityCheckResult::Warning;
54-
res.title = tr( "Scalebar is not linked to a map" );
54+
res.title = QObject::tr( "Scalebar is not linked to a map" );
5555
const QString name = bar->displayName().toHtmlEscaped();
56-
res.detailedDescription = tr( "The scalebar “%1” is not linked to a map item. This scale will be misleading." ).arg( name );
56+
res.detailedDescription = QObject::tr( "The scalebar “%1” is not linked to a map item. This scale will be misleading." ).arg( name );
5757
mResults.append( res );
5858
}
5959
}

‎src/core/validity/qgsabstractvaliditycheck.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ class CORE_EXPORT QgsValidityCheckResult
6666

6767
};
6868

69-
// note -- this is a QObject so that we can store just weak pointers to it -- avoiding crashes
70-
// if a Python plugin doesn't correctly remove checks on plugin unload
71-
7269
/**
7370
* \class QgsAbstractValidityCheck
7471
* \ingroup core
@@ -92,7 +89,7 @@ class CORE_EXPORT QgsValidityCheckResult
9289
*
9390
* \since QGIS 3.6
9491
*/
95-
class CORE_EXPORT QgsAbstractValidityCheck : public QObject
92+
class CORE_EXPORT QgsAbstractValidityCheck
9693
{
9794

9895
public:
@@ -104,6 +101,8 @@ class CORE_EXPORT QgsAbstractValidityCheck : public QObject
104101
TypeUserCheck = 10000, //!< Starting point for custom user types
105102
};
106103

104+
virtual ~QgsAbstractValidityCheck() = default;
105+
107106
/**
108107
* Creates a new instance of the check and returns it.
109108
*/
@@ -158,7 +157,4 @@ class CORE_EXPORT QgsAbstractValidityCheck : public QObject
158157

159158
};
160159

161-
162-
163-
164160
#endif // QGSABSTRACTVALIDITYCHECK_H

‎src/core/validity/qgsvaliditycheckregistry.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ QgsValidityCheckRegistry::~QgsValidityCheckRegistry()
2828
QList<const QgsAbstractValidityCheck *> QgsValidityCheckRegistry::checks() const
2929
{
3030
QList<const QgsAbstractValidityCheck *> results;
31-
for ( const QPointer< QgsAbstractValidityCheck > &check : mChecks )
31+
for ( const QgsAbstractValidityCheck *check : mChecks )
3232
{
3333
if ( check )
34-
results.append( check.data() );
34+
results.append( check );
3535
}
3636
return results;
3737
}
3838

3939
QList<const QgsAbstractValidityCheck *> QgsValidityCheckRegistry::checks( int type ) const
4040
{
4141
QList< const QgsAbstractValidityCheck * > results;
42-
for ( const QPointer< QgsAbstractValidityCheck > &check : mChecks )
42+
for ( const QgsAbstractValidityCheck *check : mChecks )
4343
{
4444
if ( check && check->checkType() == type )
45-
results << check.data();
45+
results << check;
4646
}
4747
return results;
4848
}

‎src/core/validity/qgsvaliditycheckregistry.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "qgis_sip.h"
2020
#include "qgsabstractvaliditycheck.h"
2121
#include <QList>
22-
#include <QPointer>
2322
#include <memory>
2423
#include <vector>
2524

0 commit comments

Comments
 (0)
Please sign in to comment.