Skip to content

Commit

Permalink
Disable some more algs
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Sep 14, 2018
1 parent e01449f commit 0626a0f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/qgis/FieldsMapper.py
Expand Up @@ -79,6 +79,9 @@ def inputLayerTypes(self):
def parameterAsFieldsMapping(self, parameters, name, context):
return parameters[name]

def supportInPlaceEdit(self, layer):
return False

def prepareAlgorithm(self, parameters, context, feedback):
source = self.parameterAsSource(parameters, 'INPUT', context)
if source is None:
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/qgis/TextToFloat.py
Expand Up @@ -77,6 +77,9 @@ def prepareAlgorithm(self, parameters, context, feedback):
self.field_name = self.parameterAsString(parameters, self.FIELD, context)
return True

def supportInPlaceEdit(self, layer):
return False

def sourceFlags(self):
return QgsProcessingFeatureSource.FlagSkipGeometryValidityChecks

Expand Down
9 changes: 1 addition & 8 deletions python/plugins/processing/gui/AlgorithmLocatorFilter.py
Expand Up @@ -143,14 +143,7 @@ def fetchResults(self, string, context, feedback):
if not a.flags() & QgsProcessingAlgorithm.FlagSupportsInPlaceEdits:
continue

if a.inputLayerTypes() and \
QgsProcessing.TypeVector not in a.inputLayerTypes() \
and QgsProcessing.TypeVectorAnyGeometry not in a.inputLayerTypes() \
and (QgsWkbTypes.geometryType(iface.activeLayer().wkbType()) == QgsWkbTypes.PolygonGeometry and QgsProcessing.TypeVectorPolygon not in a.inputLayerTypes() or
QgsWkbTypes.geometryType(
iface.activeLayer().wkbType()) == QgsWkbTypes.LineGeometry and QgsProcessing.TypeVectorLine not in a.inputLayerTypes() or
QgsWkbTypes.geometryType(
iface.activeLayer().wkbType()) == QgsWkbTypes.PointGeometry and QgsProcessing.TypeVectorPoint not in a.inputLayerTypes()):
if not a.supportInPlaceEdit(iface.activeLayer()):
continue

if QgsLocatorFilter.stringMatches(a.displayName(), string) or [t for t in a.tags() if QgsLocatorFilter.stringMatches(t, string)] or \
Expand Down
3 changes: 1 addition & 2 deletions python/plugins/processing/gui/ProcessingToolbox.py
Expand Up @@ -229,8 +229,7 @@ def executeAlgorithm(self):
dlg.exec_()
return

if self.in_place_mode and len(alg.parameterDefinitions()) <= 2:
# hack
if self.in_place_mode and not [d for d in alg.parameterDefinitions() if d.name() not in ('INPUT', 'OUTPUT')]:
parameters = {}
execute_in_place(alg, parameters)
return
Expand Down
6 changes: 6 additions & 0 deletions src/analysis/processing/qgsalgorithmaddincrementalfield.cpp
Expand Up @@ -162,4 +162,10 @@ QgsFeatureList QgsAddIncrementalFieldAlgorithm::processFeature( const QgsFeature
return QgsFeatureList() << f;
}

bool QgsAddIncrementalFieldAlgorithm::supportInPlaceEdit( const QgsVectorLayer *layer ) const
{
Q_UNUSED( layer );
return false;
}

///@endcond
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmaddincrementalfield.h
Expand Up @@ -53,6 +53,7 @@ class QgsAddIncrementalFieldAlgorithm : public QgsProcessingFeatureBasedAlgorith
bool prepareAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
QgsFeatureRequest request() const override;
QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
bool supportInPlaceEdit( const QgsVectorLayer *layer ) const override;

private:

Expand All @@ -68,7 +69,6 @@ class QgsAddIncrementalFieldAlgorithm : public QgsProcessingFeatureBasedAlgorith
bool mSortAscending = true;
bool mSortNullsFirst = false;


};

///@endcond PRIVATE
Expand Down

0 comments on commit 0626a0f

Please sign in to comment.