Skip to content

Commit

Permalink
Remove some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 6, 2017
1 parent a27c22d commit 2f28736
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 64 deletions.
30 changes: 0 additions & 30 deletions python/plugins/processing/core/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,36 +585,6 @@ class ParameterRaster(ParameterDataObject):
def __init__(self, name='', description='', optional=False, showSublayersDialog=True):
ParameterDataObject.__init__(self, name, description, None, optional)
self.showSublayersDialog = parseBool(showSublayersDialog)
self.exported = None

def getSafeExportedLayer(self):
"""Returns not the value entered by the user, but a string with
a filename which contains the data of this layer, but saved in
a standard format (currently always a geotiff file) so that it
can be opened by most external applications.
Works only if the layer represented by the parameter value is
currently loaded in QGIS. Otherwise, it will not perform any
export and return the current value string.
If the current value represents a layer in a suitable format,
it does not export at all and returns that value.
The layer is exported just the first time the method is called.
The method can be called several times and it will always
return the same file, performing the export only the first
time.
"""
context = dataobjects.createContext()

if self.exported:
return self.exported
layer = QgsProcessingUtils.mapLayerFromString(self.value, context, False)
if layer:
self.exported = dataobjects.exportRasterLayer(layer)
else:
self.exported = self.value
return self.exported

def getAsScriptCode(self):
param_type = ''
Expand Down
34 changes: 0 additions & 34 deletions python/plugins/processing/gui/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,40 +1232,6 @@ def validator(v):
return self.comboValue(validator)


def getFileFilter(param):
"""
Returns a suitable file filter pattern for the specified parameter definition
:param param:
:return:
"""
if param.type() == 'multilayer':
if param.layerType() == QgsProcessingParameterDefinition.TypeRaster:
exts = dataobjects.getSupportedOutputRasterLayerExtensions()
elif param.layerType() == QgsProcessingParameterDefinition.TypeFile:
return self.tr('All files (*.*)', 'QgsProcessingParameterMultipleLayers')
else:
exts = QgsVectorFileWriter.supportedFormatExtensions()
for i in range(len(exts)):
exts[i] = self.tr('{0} files (*.{1})', 'QgsProcessingParameterMultipleLayers').format(exts[i].upper(), exts[i].lower())
return ';;'.join(exts)
elif param.type() == 'raster':
exts = dataobjects.getSupportedOutputRasterLayerExtensions()
for i in range(len(exts)):
exts[i] = self.tr('{0} files (*.{1})', 'ParameterRaster').format(exts[i].upper(), exts[i].lower())
return ';;'.join(exts)
elif param.type() == 'table':
exts = ['csv', 'dbf']
for i in range(len(exts)):
exts[i] = self.tr('{0} files (*.{1})', 'ParameterTable').format(exts[i].upper(), exts[i].lower())
return ';;'.join(exts)
elif param.type() == 'sink':
exts = QgsVectorFileWriter.supportedFormatExtensions()
for i in range(len(exts)):
exts[i] = self.tr('{0} files (*.{1})', 'ParameterVector').format(exts[i].upper(), exts[i].lower())
return ';;'.join(exts)
return ''


class WidgetWrapperFactory:

"""
Expand Down

0 comments on commit 2f28736

Please sign in to comment.