Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] Port Refactor Fields to c++
Having this core algorithm in Python has proved just too unreliable

Refs #36706, refs #36843
  • Loading branch information
nyalldawson committed Jun 1, 2020
1 parent 191e362 commit dbe9aa0
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 160 deletions.
Expand Up @@ -297,6 +297,8 @@ their acceptable ranges, defaults, etc.
sipType = sipType_QgsProcessingParameterDatabaseSchema;
else if ( sipCpp->type() == QgsProcessingParameterDatabaseTable::typeName() )
sipType = sipType_QgsProcessingParameterDatabaseTable;
else if ( sipCpp->type() == QgsProcessingParameterFieldMapping::typeName() )
sipType = sipType_QgsProcessingParameterFieldMapping;
else
sipType = nullptr;
%End
Expand Down
7 changes: 0 additions & 7 deletions python/plugins/processing/algs/help/qgis.yaml
Expand Up @@ -316,13 +316,6 @@ qgis:rastersampling: >

If the raster layer has more than one band, all the band values are sampled.

qgis:refactorfields: >
This algorithm allows editing the structure of the attributes table of a vector layer. Fields can be modified in their type and name, using a fields mapping.

The original layer is not modified. A new layer is generated, which contains a modified attribute table, according to the provided fields mapping.

Rows in orange have constraints in the template layer from which these fields were loaded. Treat this information as a hint during configuration. No constraints will be added on an output layer nor will they be checked or enforced by the algorithm.

qgis:regularpoints: >
This algorithm creates a point layer with a given number of regular points, all of them within a given extent.

Expand Down
147 changes: 0 additions & 147 deletions python/plugins/processing/algs/qgis/FieldsMapper.py

This file was deleted.

2 changes: 0 additions & 2 deletions python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py
Expand Up @@ -44,7 +44,6 @@
from .ExportGeometryInfo import ExportGeometryInfo
from .FieldPyculator import FieldsPyculator
from .FieldsCalculator import FieldsCalculator
from .FieldsMapper import FieldsMapper
from .FindProjection import FindProjection
from .GeometryConvert import GeometryConvert
from .Heatmap import Heatmap
Expand Down Expand Up @@ -117,7 +116,6 @@ def getAlgs(self):
ExecuteSQL(),
ExportGeometryInfo(),
FieldsCalculator(),
FieldsMapper(),
FieldsPyculator(),
FindProjection(),
GeometryConvert(),
Expand Down
7 changes: 3 additions & 4 deletions python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py
Expand Up @@ -52,7 +52,6 @@

from processing.gui.wrappers import WidgetWrapper, DIALOG_STANDARD, DIALOG_MODELER
from processing.tools import dataobjects
from processing.algs.qgis.FieldsMapper import FieldsMapper


pluginPath = os.path.dirname(__file__)
Expand Down Expand Up @@ -192,9 +191,9 @@ def createWidget(self):
if self.dialogType == DIALOG_MODELER:
self.combobox = QComboBox()
self.combobox.addItem(QCoreApplication.translate('Processing', '[Preconfigure]'), None)
fieldsMappingInputs = self.dialog.getAvailableValuesOfType(FieldsMapper.ParameterFieldsMapping)
for input in fieldsMappingInputs:
self.combobox.addItem(self.dialog.resolveValueDescription(input), input)
#fieldsMappingInputs = self.dialog.getAvailableValuesOfType(FieldsMapper.ParameterFieldsMapping)
#for input in fieldsMappingInputs:
# self.combobox.addItem(self.dialog.resolveValueDescription(input), input)

def updatePanelEnabledState():
if self.combobox.currentData() is None:
Expand Down
1 change: 1 addition & 0 deletions src/analysis/CMakeLists.txt
Expand Up @@ -128,6 +128,7 @@ SET(QGIS_ANALYSIS_SRCS
processing/qgsalgorithmrasterzonalstats.cpp
processing/qgsalgorithmreclassifybylayer.cpp
processing/qgsalgorithmrectanglesovalsdiamonds.cpp
processing/qgsalgorithmrefactorfields.cpp
processing/qgsalgorithmremoveduplicatesbyattribute.cpp
processing/qgsalgorithmremoveduplicatevertices.cpp
processing/qgsalgorithmremoveholes.cpp
Expand Down

0 comments on commit dbe9aa0

Please sign in to comment.