Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix GdalTools contour
  • Loading branch information
etiennesky committed Jun 14, 2013
1 parent 684aa98 commit 07ea0aa
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions python/plugins/GdalTools/tools/doContour.py
Expand Up @@ -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)

Expand All @@ -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:
Expand All @@ -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):
Expand All @@ -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):
Expand Down

0 comments on commit 07ea0aa

Please sign in to comment.