Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix translation for geometry checks
Q_DECLARE_TR_FUNCTIONS must be used in the subclass. If used from the super class
it simply does not work.
  • Loading branch information
m-kuhn authored and nyalldawson committed Oct 23, 2020
1 parent 467cce7 commit d1abf1e
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 1 deletion.
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryAngleCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryAngleCheck )
public:
enum ResolutionMethod
{
Expand Down
Expand Up @@ -27,6 +27,7 @@ class QgsSurface;
*/
class ANALYSIS_EXPORT QgsGeometryAreaCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryAreaCheck )
public:
enum ResolutionMethod { MergeLongestEdge, MergeLargestArea, MergeIdenticalAttribute, Delete, NoChange };

Expand Down
1 change: 0 additions & 1 deletion src/analysis/vector/geometry_checker/qgsgeometrycheck.h
Expand Up @@ -125,7 +125,6 @@ class QgsFeaturePool;
class ANALYSIS_EXPORT QgsGeometryCheck
{
Q_GADGET
Q_DECLARE_TR_FUNCTIONS( QgsGeometryCheck )

public:

Expand Down
Expand Up @@ -54,6 +54,7 @@ class ANALYSIS_EXPORT QgsGeometryContainedCheckError : public QgsGeometryCheckEr
*/
class ANALYSIS_EXPORT QgsGeometryContainedCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryContainedCheck )
public:
enum ResolutionMethod { Delete, NoChange };

Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryDangleCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryDangleCheck )
public:
QgsGeometryDangleCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsGeometryCheck( context, configuration )
Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryDegeneratePolygonCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryDegeneratePolygonCheck )
public:
enum ResolutionMethod { DeleteRing, NoChange };

Expand Down
Expand Up @@ -58,6 +58,7 @@ class ANALYSIS_EXPORT QgsGeometryDuplicateCheckError : public QgsGeometryCheckEr
*/
class ANALYSIS_EXPORT QgsGeometryDuplicateCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryDuplicateCheck )
public:
explicit QgsGeometryDuplicateCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsGeometryCheck( context, configuration ) {}
Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryDuplicateNodesCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryDuplicateNodesCheck )
public:
explicit QgsGeometryDuplicateNodesCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsGeometryCheck( context, configuration ) {}
Expand Down
Expand Up @@ -28,6 +28,7 @@ class QgsSpatialIndex;
*/
class ANALYSIS_EXPORT QgsGeometryFollowBoundariesCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryFollowBoundariesCheck )
public:
QgsGeometryFollowBoundariesCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration, QgsVectorLayer *checkLayer );
~QgsGeometryFollowBoundariesCheck() override;
Expand Down
2 changes: 2 additions & 0 deletions src/analysis/vector/geometry_checker/qgsgeometrygapcheck.h
Expand Up @@ -89,6 +89,8 @@ class ANALYSIS_EXPORT QgsGeometryGapCheckError : public QgsGeometryCheckError
class ANALYSIS_EXPORT QgsGeometryGapCheck : public QgsGeometryCheck
{
Q_GADGET
Q_DECLARE_TR_FUNCTIONS( QgsGeometryGapCheck )

public:
//! Resolution methods for geometry gap checks
enum ResolutionMethod
Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryHoleCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryHoleCheck )
public:
explicit QgsGeometryHoleCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsGeometryCheck( context, configuration ) {}
Expand Down
Expand Up @@ -53,6 +53,7 @@ class ANALYSIS_EXPORT QgsGeometryIsValidCheckError : public QgsSingleGeometryChe
*/
class ANALYSIS_EXPORT QgsGeometryIsValidCheck : public QgsSingleGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryIsValidCheck )
public:

/**
Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryLineIntersectionCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryLineIntersectionCheck )
public:
QgsGeometryLineIntersectionCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsGeometryCheck( context, configuration )
Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryLineLayerIntersectionCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryLineLayerIntersectionCheck )
public:
QgsGeometryLineLayerIntersectionCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsGeometryCheck( context, configuration )
Expand Down
Expand Up @@ -85,6 +85,7 @@ class ANALYSIS_EXPORT QgsGeometryMissingVertexCheckError : public QgsGeometryChe
class ANALYSIS_EXPORT QgsGeometryMissingVertexCheck : public QgsGeometryCheck
{
Q_GADGET
Q_DECLARE_TR_FUNCTIONS( QgsGeometryMissingVertexCheck )

public:

Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryMultipartCheck : public QgsSingleGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryMultipartCheck )
public:
explicit QgsGeometryMultipartCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsSingleGeometryCheck( context,
Expand Down
Expand Up @@ -92,6 +92,7 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro
*/
class ANALYSIS_EXPORT QgsGeometryOverlapCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryOverlapCheck )
public:

/**
Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryPointCoveredByLineCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryPointCoveredByLineCheck )
public:
QgsGeometryPointCoveredByLineCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsGeometryCheck( context, configuration )
Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometryPointInPolygonCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryPointInPolygonCheck )
public:
QgsGeometryPointInPolygonCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsGeometryCheck( context, configuration )
Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometrySegmentLengthCheck : public QgsGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometrySegmentLengthCheck )
public:
QgsGeometrySegmentLengthCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsGeometryCheck( context, configuration )
Expand Down
Expand Up @@ -25,6 +25,7 @@
*/
class ANALYSIS_EXPORT QgsGeometrySelfContactCheck : public QgsSingleGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometrySelfContactCheck )
public:
QgsGeometrySelfContactCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration )
: QgsSingleGeometryCheck( context, configuration ) {}
Expand Down
Expand Up @@ -50,6 +50,7 @@ class ANALYSIS_EXPORT QgsGeometrySelfIntersectionCheckError : public QgsSingleGe
*/
class ANALYSIS_EXPORT QgsGeometrySelfIntersectionCheck : public QgsSingleGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometrySelfIntersectionCheck )
public:
enum ResolutionMethod
{
Expand Down
Expand Up @@ -48,6 +48,7 @@ class ANALYSIS_EXPORT QgsGeometryTypeCheckError : public QgsSingleGeometryCheckE
*/
class ANALYSIS_EXPORT QgsGeometryTypeCheck : public QgsSingleGeometryCheck
{
Q_DECLARE_TR_FUNCTIONS( QgsGeometryTypeCheck )
public:
QgsGeometryTypeCheck( QgsGeometryCheckContext *context, const QVariantMap &configuration, int allowedTypes )
: QgsSingleGeometryCheck( context, configuration )
Expand Down

0 comments on commit d1abf1e

Please sign in to comment.