mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
[processing] Fix file format combo showing formats in random orders
This commit is contained in:
parent
1e661e37b9
commit
d44bc112e0
@ -70,22 +70,26 @@ def resetLoadedLayers():
|
|||||||
|
|
||||||
def getSupportedOutputVectorLayerExtensions():
|
def getSupportedOutputVectorLayerExtensions():
|
||||||
formats = QgsVectorFileWriter.supportedFiltersAndFormats()
|
formats = QgsVectorFileWriter.supportedFiltersAndFormats()
|
||||||
exts = ['shp'] # shp is the default, should be the first
|
exts = []
|
||||||
for extension in list(formats.keys()):
|
for extension in list(formats.keys()):
|
||||||
extension = str(extension)
|
extension = str(extension)
|
||||||
extension = extension[extension.find('*.') + 2:]
|
extension = extension[extension.find('*.') + 2:]
|
||||||
extension = extension[:extension.find(' ')]
|
extension = extension[:extension.find(' ')]
|
||||||
if extension.lower() != 'shp':
|
if extension.lower() != 'shp':
|
||||||
exts.append(extension)
|
exts.append(extension)
|
||||||
|
exts.sort()
|
||||||
|
exts.insert(0, 'shp') # shp is the default, should be the first
|
||||||
return exts
|
return exts
|
||||||
|
|
||||||
|
|
||||||
def getSupportedOutputRasterLayerExtensions():
|
def getSupportedOutputRasterLayerExtensions():
|
||||||
allexts = ['tif']
|
allexts = []
|
||||||
for exts in list(GdalUtils.getSupportedRasters().values()):
|
for exts in list(GdalUtils.getSupportedRasters().values()):
|
||||||
for ext in exts:
|
for ext in exts:
|
||||||
if ext not in allexts:
|
if ext != 'tif' and ext not in allexts:
|
||||||
allexts.append(ext)
|
allexts.append(ext)
|
||||||
|
allexts.sort()
|
||||||
|
allexts.insert(0, 'tif') # tif is the default, should be the first
|
||||||
return allexts
|
return allexts
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user