mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
Disable some more algs
This commit is contained in:
parent
e01449f5c5
commit
0626a0ff5d
@ -79,6 +79,9 @@ class FieldsMapper(QgisFeatureBasedAlgorithm):
|
||||
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:
|
||||
|
@ -77,6 +77,9 @@ class TextToFloat(QgisFeatureBasedAlgorithm):
|
||||
self.field_name = self.parameterAsString(parameters, self.FIELD, context)
|
||||
return True
|
||||
|
||||
def supportInPlaceEdit(self, layer):
|
||||
return False
|
||||
|
||||
def sourceFlags(self):
|
||||
return QgsProcessingFeatureSource.FlagSkipGeometryValidityChecks
|
||||
|
||||
|
@ -143,14 +143,7 @@ class InPlaceAlgorithmLocatorFilter(QgsLocatorFilter):
|
||||
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 \
|
||||
|
@ -229,8 +229,7 @@ class ProcessingToolbox(QgsDockWidget, WIDGET):
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -53,6 +53,7 @@ class QgsAddIncrementalFieldAlgorithm : public QgsProcessingFeatureBasedAlgorith
|
||||
bool prepareAlgorithm( const QVariantMap ¶meters, 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:
|
||||
|
||||
@ -68,7 +69,6 @@ class QgsAddIncrementalFieldAlgorithm : public QgsProcessingFeatureBasedAlgorith
|
||||
bool mSortAscending = true;
|
||||
bool mSortNullsFirst = false;
|
||||
|
||||
|
||||
};
|
||||
|
||||
///@endcond PRIVATE
|
||||
|
Loading…
x
Reference in New Issue
Block a user