Skip to content

Commit d44bc11

Browse files
committed
[processing] Fix file format combo showing formats in random orders
1 parent 1e661e3 commit d44bc11

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

python/plugins/processing/tools/dataobjects.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,26 @@ def resetLoadedLayers():
7070

7171
def getSupportedOutputVectorLayerExtensions():
7272
formats = QgsVectorFileWriter.supportedFiltersAndFormats()
73-
exts = ['shp'] # shp is the default, should be the first
73+
exts = []
7474
for extension in list(formats.keys()):
7575
extension = str(extension)
7676
extension = extension[extension.find('*.') + 2:]
7777
extension = extension[:extension.find(' ')]
7878
if extension.lower() != 'shp':
7979
exts.append(extension)
80+
exts.sort()
81+
exts.insert(0, 'shp') # shp is the default, should be the first
8082
return exts
8183

8284

8385
def getSupportedOutputRasterLayerExtensions():
84-
allexts = ['tif']
86+
allexts = []
8587
for exts in list(GdalUtils.getSupportedRasters().values()):
8688
for ext in exts:
87-
if ext not in allexts:
89+
if ext != 'tif' and ext not in allexts:
8890
allexts.append(ext)
91+
allexts.sort()
92+
allexts.insert(0, 'tif') # tif is the default, should be the first
8993
return allexts
9094

9195

0 commit comments

Comments
 (0)