Skip to content
Permalink
Browse files

fix GdalTools contour

  • Loading branch information
etiennesky committed Jun 14, 2013
1 parent 684aa98 commit 07ea0aa10739a42d64eca040553ea21f6a0c8ecf
Showing with 11 additions and 11 deletions.
  1. +11 −11 python/plugins/GdalTools/tools/doContour.py
@@ -69,7 +69,7 @@ def onLayersChanged(self):
def fillInputFileEdit(self):
lastUsedFilter = Utils.FileFilter.lastUsedRasterFilter()
inputFile = Utils.FileDialog.getOpenFileName(self, self.tr( "Select the input file for Contour" ), Utils.FileFilter.allRastersFilter(), lastUsedFilter)
if inputFile.isEmpty():
if not inputFile:
return
Utils.FileFilter.setLastUsedRasterFilter(lastUsedFilter)

@@ -82,7 +82,7 @@ def fillOutputFileEdit(self):
else:
outputFile, encoding = Utils.FileDialog.getExistingDirectory(self, self.tr( "Select where to save the Contour output" ), True)

if outputFile.isEmpty():
if not outputFile:
return

if not self.useDirAsOutput:
@@ -92,15 +92,15 @@ def fillOutputFileEdit(self):
self.lastEncoding = encoding

def getArguments(self):
arguments = QStringList()
if self.attributeCheck.isChecked() and not self.attributeEdit.text().isEmpty():
arguments << "-a"
arguments << self.attributeEdit.text()
arguments = []
if self.attributeCheck.isChecked() and self.attributeEdit.text():
arguments.append("-a")
arguments.append(self.attributeEdit.text())
if True: # XXX in this moment the -i argument is not optional
arguments << "-i"
arguments << unicode(self.intervalDSpinBox.value())
arguments << self.getInputFileName()
arguments << self.outSelector.filename()
arguments.append("-i")
arguments.append(str(self.intervalDSpinBox.value()))
arguments.append(self.getInputFileName())
arguments.append(self.outSelector.filename())
return arguments

def getInputFileName(self):
@@ -109,7 +109,7 @@ def getInputFileName(self):
def getOutputFileName(self):
if self.useDirAsOutput:
fn = self.outSelector.filename()
return fn if fn.isEmpty() else fn + QDir.separator() + "contour.shp"
return fn if not fn else fn + QDir.separator() + "contour.shp"
return self.outSelector.filename()

def addLayerIntoCanvas(self, fileInfo):

0 comments on commit 07ea0aa

Please sign in to comment.
You can’t perform that action at this time.