Skip to content

Commit

Permalink
[processing] Fix file format combo showing formats in random orders
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 23, 2016
1 parent 1e661e3 commit d44bc11
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/plugins/processing/tools/dataobjects.py
Expand Up @@ -70,22 +70,26 @@ def resetLoadedLayers():

def getSupportedOutputVectorLayerExtensions():
formats = QgsVectorFileWriter.supportedFiltersAndFormats()
exts = ['shp'] # shp is the default, should be the first
exts = []
for extension in list(formats.keys()):
extension = str(extension)
extension = extension[extension.find('*.') + 2:]
extension = extension[:extension.find(' ')]
if extension.lower() != 'shp':
exts.append(extension)
exts.sort()
exts.insert(0, 'shp') # shp is the default, should be the first
return exts


def getSupportedOutputRasterLayerExtensions():
allexts = ['tif']
allexts = []
for exts in list(GdalUtils.getSupportedRasters().values()):
for ext in exts:
if ext not in allexts:
if ext != 'tif' and ext not in allexts:
allexts.append(ext)
allexts.sort()
allexts.insert(0, 'tif') # tif is the default, should be the first
return allexts


Expand Down

0 comments on commit d44bc11

Please sign in to comment.