Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 10, 2024
1 parent 7216121 commit 162b3cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/core/labeling/rules/qgslabelingenginerule_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
#include "qgslabelingenginerule_impl.h"
#include "qgsunittypes.h"
#include "qgssymbollayerutils.h"
#include "labelposition.h"
#include "feature.h"
#include "qgsvectorlayerfeatureiterator.h"
#include "qgsthreadingutils.h"
#include "qgsspatialindex.h"
#include "qgsgeos.h"
#include "labelposition.h"
#include "feature.h"
#if GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR < 10
#include "qgsmessagelog.h"
#endif

//
// QgsAbstractLabelingEngineRuleDistanceFromFeature
Expand Down Expand Up @@ -210,7 +213,7 @@ bool QgsAbstractLabelingEngineRuleDistanceFromFeature::candidateExceedsTolerance
return mMustBeDistant;
}
#else
QgsDebugError( QStringLiteral( "This rule requires GEOS 3.10+" ) );
QgsMessageLog::logMessage( QStringLiteral( "The %1 labeling rule requires GEOS 3.10+" ).arg( name().isEmpty() ? displayType() : name() ) );
return false;
#endif
}
Expand Down Expand Up @@ -288,7 +291,7 @@ QString QgsLabelingEngineRuleMaximumDistanceLabelToFeature::id() const

QString QgsLabelingEngineRuleMaximumDistanceLabelToFeature::displayType() const
{
return QObject::tr( "Pull Labels toward Features" );
return QObject::tr( "Pull Labels Toward Features" );
}

QString QgsLabelingEngineRuleMaximumDistanceLabelToFeature::description() const
Expand Down Expand Up @@ -432,7 +435,7 @@ bool QgsLabelingEngineRuleMinimumDistanceLabelToLabel::candidatesAreConflicting(
return true;
}
#else
QgsDebugError( QStringLiteral( "This rule requires GEOS 3.10+" ) );
QgsMessageLog::logMessage( QStringLiteral( "The %1 labeling rule requires GEOS 3.10+" ).arg( name().isEmpty() ? displayType() : name() ) );
return false;
#endif
}
Expand Down
3 changes: 0 additions & 3 deletions src/core/labeling/rules/qgslabelingengineruleregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@

QgsLabelingEngineRuleRegistry::QgsLabelingEngineRuleRegistry()
{
#if GEOS_VERSION_MAJOR>3 || ( GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR>=10 )
addRule( new QgsLabelingEngineRuleMinimumDistanceLabelToFeature() );
addRule( new QgsLabelingEngineRuleMaximumDistanceLabelToFeature() );
addRule( new QgsLabelingEngineRuleMinimumDistanceLabelToLabel() );
#endif

addRule( new QgsLabelingEngineRuleAvoidLabelOverlapWithFeature() );
}

Expand Down

0 comments on commit 162b3cb

Please sign in to comment.