Skip to content

Commit 0626a0f

Browse files
elpasonyalldawson
authored andcommitted
Disable some more algs
1 parent e01449f commit 0626a0f

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

python/plugins/processing/algs/qgis/FieldsMapper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def inputLayerTypes(self):
7979
def parameterAsFieldsMapping(self, parameters, name, context):
8080
return parameters[name]
8181

82+
def supportInPlaceEdit(self, layer):
83+
return False
84+
8285
def prepareAlgorithm(self, parameters, context, feedback):
8386
source = self.parameterAsSource(parameters, 'INPUT', context)
8487
if source is None:

python/plugins/processing/algs/qgis/TextToFloat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ def prepareAlgorithm(self, parameters, context, feedback):
7777
self.field_name = self.parameterAsString(parameters, self.FIELD, context)
7878
return True
7979

80+
def supportInPlaceEdit(self, layer):
81+
return False
82+
8083
def sourceFlags(self):
8184
return QgsProcessingFeatureSource.FlagSkipGeometryValidityChecks
8285

python/plugins/processing/gui/AlgorithmLocatorFilter.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,7 @@ def fetchResults(self, string, context, feedback):
143143
if not a.flags() & QgsProcessingAlgorithm.FlagSupportsInPlaceEdits:
144144
continue
145145

146-
if a.inputLayerTypes() and \
147-
QgsProcessing.TypeVector not in a.inputLayerTypes() \
148-
and QgsProcessing.TypeVectorAnyGeometry not in a.inputLayerTypes() \
149-
and (QgsWkbTypes.geometryType(iface.activeLayer().wkbType()) == QgsWkbTypes.PolygonGeometry and QgsProcessing.TypeVectorPolygon not in a.inputLayerTypes() or
150-
QgsWkbTypes.geometryType(
151-
iface.activeLayer().wkbType()) == QgsWkbTypes.LineGeometry and QgsProcessing.TypeVectorLine not in a.inputLayerTypes() or
152-
QgsWkbTypes.geometryType(
153-
iface.activeLayer().wkbType()) == QgsWkbTypes.PointGeometry and QgsProcessing.TypeVectorPoint not in a.inputLayerTypes()):
146+
if not a.supportInPlaceEdit(iface.activeLayer()):
154147
continue
155148

156149
if QgsLocatorFilter.stringMatches(a.displayName(), string) or [t for t in a.tags() if QgsLocatorFilter.stringMatches(t, string)] or \

python/plugins/processing/gui/ProcessingToolbox.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ def executeAlgorithm(self):
229229
dlg.exec_()
230230
return
231231

232-
if self.in_place_mode and len(alg.parameterDefinitions()) <= 2:
233-
# hack
232+
if self.in_place_mode and not [d for d in alg.parameterDefinitions() if d.name() not in ('INPUT', 'OUTPUT')]:
234233
parameters = {}
235234
execute_in_place(alg, parameters)
236235
return

src/analysis/processing/qgsalgorithmaddincrementalfield.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,10 @@ QgsFeatureList QgsAddIncrementalFieldAlgorithm::processFeature( const QgsFeature
162162
return QgsFeatureList() << f;
163163
}
164164

165+
bool QgsAddIncrementalFieldAlgorithm::supportInPlaceEdit( const QgsVectorLayer *layer ) const
166+
{
167+
Q_UNUSED( layer );
168+
return false;
169+
}
170+
165171
///@endcond

src/analysis/processing/qgsalgorithmaddincrementalfield.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class QgsAddIncrementalFieldAlgorithm : public QgsProcessingFeatureBasedAlgorith
5353
bool prepareAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
5454
QgsFeatureRequest request() const override;
5555
QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
56+
bool supportInPlaceEdit( const QgsVectorLayer *layer ) const override;
5657

5758
private:
5859

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

71-
7272
};
7373

7474
///@endcond PRIVATE

0 commit comments

Comments
 (0)