Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Drop the ugly hack in favor of sourceFlags
  • Loading branch information
elpaso committed Dec 21, 2018
1 parent f4d7506 commit 40fb2ce
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/plugins/processing/gui/AlgorithmExecutor.py
Expand Up @@ -34,6 +34,7 @@
QgsMessageLog,
QgsProcessingException,
QgsProcessingFeatureSourceDefinition,
QgsProcessingFeatureSource,
QgsProcessingParameters,
QgsProject,
QgsFeatureRequest,
Expand Down Expand Up @@ -94,9 +95,12 @@ def execute_in_place_run(alg, parameters, context=None, feedback=None, raise_exc
if context is None:
context = dataobjects.createContext(feedback)

# Ugly hack: the only invalid policy option that makes sense for fixgeometries is to not check
if alg.name() in ('fixgeometries', ):
context.setInvalidGeometryCheck(QgsFeatureRequest.GeometryNoCheck)
# Only feature based algs have sourceFlags
try:
if alg.sourceFlags() & QgsProcessingFeatureSource.FlagSkipGeometryValidityChecks:
context.setInvalidGeometryCheck(QgsFeatureRequest.GeometryNoCheck)
except AttributeError:
pass

active_layer = parameters['INPUT']

Expand Down

0 comments on commit 40fb2ce

Please sign in to comment.