Skip to content

Commit c32611b

Browse files
committed
[processing] Remove unused code
1 parent 3643219 commit c32611b

File tree

2 files changed

+2
-52
lines changed

2 files changed

+2
-52
lines changed

python/plugins/processing/core/ProcessingConfig.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class ProcessingConfig:
6161
POST_EXECUTION_SCRIPT = 'POST_EXECUTION_SCRIPT'
6262
SHOW_CRS_DEF = 'SHOW_CRS_DEF'
6363
WARN_UNMATCHING_CRS = 'WARN_UNMATCHING_CRS'
64-
WARN_UNMATCHING_EXTENT_CRS = 'WARN_UNMATCHING_EXTENT_CRS'
6564
DEFAULT_OUTPUT_RASTER_LAYER_EXT = 'DEFAULT_OUTPUT_RASTER_LAYER_EXT'
6665
DEFAULT_OUTPUT_VECTOR_LAYER_EXT = 'DEFAULT_OUTPUT_VECTOR_LAYER_EXT'
6766
SHOW_PROVIDERS_TOOLTIP = 'SHOW_PROVIDERS_TOOLTIP'
@@ -106,11 +105,7 @@ def initialize():
106105
ProcessingConfig.addSetting(Setting(
107106
ProcessingConfig.tr('General'),
108107
ProcessingConfig.WARN_UNMATCHING_CRS,
109-
ProcessingConfig.tr("Warn before executing if layer CRS's do not match"), True))
110-
ProcessingConfig.addSetting(Setting(
111-
ProcessingConfig.tr('General'),
112-
ProcessingConfig.WARN_UNMATCHING_EXTENT_CRS,
113-
ProcessingConfig.tr("Warn before executing if extent CRS might not match layers CRS"), True))
108+
ProcessingConfig.tr("Warn before executing if parameter CRS's do not match"), True))
114109
ProcessingConfig.addSetting(Setting(
115110
ProcessingConfig.tr('General'),
116111
ProcessingConfig.RASTER_STYLE,

python/plugins/processing/gui/AlgorithmDialog.py

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -118,39 +118,6 @@ def getParameterValues(self):
118118

119119
return self.algorithm().preprocessParameters(parameters)
120120

121-
def checkExtentCRS(self):
122-
unmatchingCRS = False
123-
hasExtent = False
124-
context = dataobjects.createContext()
125-
projectCRS = iface.mapCanvas().mapSettings().destinationCrs()
126-
layers = QgsProcessingUtils.compatibleLayers(QgsProject.instance())
127-
for param in self.algorithm().parameterDefinitions():
128-
if isinstance(param, (ParameterRaster, ParameterVector, ParameterMultipleInput)):
129-
if param.value:
130-
if isinstance(param, ParameterMultipleInput):
131-
inputlayers = param.value.split(';')
132-
else:
133-
inputlayers = [param.value]
134-
for inputlayer in inputlayers:
135-
for layer in layers:
136-
if layer.source() == inputlayer:
137-
if layer.crs() != projectCRS:
138-
unmatchingCRS = True
139-
140-
p = QgsProcessingUtils.mapLayerFromString(inputlayer, context)
141-
if p is not None:
142-
if p.crs() != projectCRS:
143-
unmatchingCRS = True
144-
if isinstance(param, ParameterExtent):
145-
if param.skip_crs_check:
146-
continue
147-
148-
value = self.mainWidget().wrappers[param.name()].widget.leText.text().strip()
149-
if value:
150-
hasExtent = True
151-
152-
return hasExtent and unmatchingCRS
153-
154121
def accept(self):
155122
feedback = self.createFeedback()
156123
context = dataobjects.createContext(feedback)
@@ -161,25 +128,13 @@ def accept(self):
161128

162129
if checkCRS and not self.algorithm().validateInputCrs(parameters, context):
163130
reply = QMessageBox.question(self, self.tr("Unmatching CRS's"),
164-
self.tr('Layers do not all use the same CRS. This can '
131+
self.tr('Parameters do not all use the same CRS. This can '
165132
'cause unexpected results.\nDo you want to '
166133
'continue?'),
167134
QMessageBox.Yes | QMessageBox.No,
168135
QMessageBox.No)
169136
if reply == QMessageBox.No:
170137
return
171-
checkExtentCRS = ProcessingConfig.getSetting(ProcessingConfig.WARN_UNMATCHING_EXTENT_CRS)
172-
# TODO
173-
if False and checkExtentCRS and self.checkExtentCRS():
174-
reply = QMessageBox.question(self, self.tr("Extent CRS"),
175-
self.tr('Extent parameters must use the same CRS as the input layers.\n'
176-
'Your input layers do not have the same extent as the project, '
177-
'so the extent might be in a wrong CRS if you have selected it from the canvas.\n'
178-
'Do you want to continue?'),
179-
QMessageBox.Yes | QMessageBox.No,
180-
QMessageBox.No)
181-
if reply == QMessageBox.No:
182-
return
183138
ok, msg = self.algorithm().checkParameterValues(parameters, context)
184139
if msg:
185140
QMessageBox.warning(

0 commit comments

Comments
 (0)