Skip to content

Commit

Permalink
GdalTools: use int to compare versions (fixes #8323)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 19, 2013
1 parent 51074d7 commit e9e1530
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions python/plugins/GdalTools/tools/doBuildVRT.py
Expand Up @@ -52,10 +52,10 @@ def __init__(self, iface):
(self.inSelector, SIGNAL("filenameChanged()")),
(self.outSelector, SIGNAL("filenameChanged()")),
(self.resolutionComboBox, SIGNAL("currentIndexChanged(int)"), self.resolutionCheck),
(self.srcNoDataSpin, SIGNAL("valueChanged(int)"), self.srcNoDataCheck, "1.7.0"),
(self.srcNoDataSpin, SIGNAL("valueChanged(int)"), self.srcNoDataCheck, 1700),
(self.inputDirCheck, SIGNAL("stateChanged(int)")),
(self.separateCheck, SIGNAL("stateChanged(int)"), None, "1.7.0"),
(self.allowProjDiffCheck, SIGNAL("stateChanged(int)"), None, "1.7.0"),
(self.separateCheck, SIGNAL("stateChanged(int)"), None, 1700),
(self.allowProjDiffCheck, SIGNAL("stateChanged(int)"), None, 1700),
(self.recurseCheck, SIGNAL("stateChanged(int)"), self.inputDirCheck),
(self.inputSelLayersCheck, SIGNAL("stateChanged(int)"))
]
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/GdalTools/tools/doClipper.py
Expand Up @@ -50,8 +50,8 @@ def __init__(self, iface):
[
(self.inSelector, SIGNAL("filenameChanged()") ),
(self.outSelector, SIGNAL("filenameChanged()") ),
(self.noDataSpin, SIGNAL("valueChanged(int)"), self.noDataCheck, "1.7.0"),
(self.maskSelector, SIGNAL("filenameChanged()"), self.maskModeRadio, "1.6.0"),
(self.noDataSpin, SIGNAL("valueChanged(int)"), self.noDataCheck, 1700),
(self.maskSelector, SIGNAL("filenameChanged()"), self.maskModeRadio, 1600),
(self.alphaBandCheck, SIGNAL( "stateChanged( int )") ),
(self.extentSelector, [SIGNAL("selectionStarted()"), SIGNAL("newExtentDefined()")], self.extentModeRadio),
(self.modeStackedWidget, SIGNAL("currentIndexChanged(int)"))
Expand Down Expand Up @@ -168,7 +168,7 @@ def getArgsModeMask(self):
arguments.append("-q")
arguments.append("-cutline")
arguments.append(mask)
if Utils.GdalConfig.version() >= "1.8.0":
if Utils.GdalConfig.versionNum() >= 1800:
arguments.append("-crop_to_cutline")
if self.alphaBandCheck.isChecked():
arguments.append("-dstalpha")
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/GdalTools/tools/doContour.py
Expand Up @@ -41,8 +41,8 @@ def __init__(self, iface):
self.setupUi(self)
BasePluginWidget.__init__(self, self.iface, "gdal_contour")

gdalVersion = Utils.GdalConfig.version()
self.useDirAsOutput = gdalVersion < "1.7.0"
gdalVersion = Utils.GdalConfig.versionNum()
self.useDirAsOutput = gdalVersion < 1700
if self.useDirAsOutput:
self.label_2.setText( QApplication.translate("GdalToolsWidget", "&Output directory for contour lines (shapefile)") )

Expand Down
6 changes: 3 additions & 3 deletions python/plugins/GdalTools/tools/doRasterize.py
Expand Up @@ -93,8 +93,8 @@ def fillOutputFileEdit(self):
lastUsedFilter = Utils.FileFilter.lastUsedRasterFilter()

# rasterize supports output file creation for GDAL 1.8
gdalVersion = Utils.GdalConfig.version()
if gdalVersion >= "1.8.0":
gdalVersion = Utils.GdalConfig.versionNum()
if gdalVersion >= 1800:
fileDialogFunc = Utils.FileDialog.getSaveFileName
else:
fileDialogFunc = Utils.FileDialog.getOpenFileName
Expand All @@ -107,7 +107,7 @@ def fillOutputFileEdit(self):
self.outSelector.setFilename(outputFile)

# required either -ts or -tr to create the output file
if gdalVersion >= "1.8.0":
if gdalVersion >= 1800:
if not QFileInfo(outputFile).exists():
QMessageBox.information( self, self.tr( "Output size or resolution required" ), self.tr( "The output file doesn't exist. You must set up the output size or resolution to create it." ) )
self.radioSetSize.setChecked(True)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/GdalTools/tools/doTileIndex.py
Expand Up @@ -52,8 +52,8 @@ def __init__( self, iface ):
#( self.recurseCheck, SIGNAL( "stateChanged( int )" ),
( self.outSelector, SIGNAL( "filenameChanged()" ) ),
( self.indexFieldEdit, SIGNAL( "textChanged( const QString & )" ), self.indexFieldCheck),
( self.absolutePathCheck, SIGNAL( "stateChanged( int )" ), None, "1.5.0" ),
( self.skipDifferentProjCheck, SIGNAL( "stateChanged( int )" ), None, "1.5.0" )
( self.absolutePathCheck, SIGNAL( "stateChanged( int )" ), None, 1500 ),
( self.skipDifferentProjCheck, SIGNAL( "stateChanged( int )" ), None, 1500 )
]
)

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/tools/doTranslate.py
Expand Up @@ -56,7 +56,7 @@ def __init__(self, iface):
self.formatLabel.hide()
self.formatCombo.hide()

if Utils.Version( Utils.GdalConfig.version() ) < "1.7":
if Utils.GdalConfig.versionNum() < 1700:
index = self.expandCombo.findText('gray', Qt.MatchFixedString)
if index >= 0:
self.expandCombo.removeItem(index)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/GdalTools/tools/doWarp.py
Expand Up @@ -67,7 +67,7 @@ def __init__(self, iface):
( [self.widthSpin, self.heightSpin], SIGNAL( "valueChanged(int)" ), self.resizeGroupBox ),
(self.multithreadCheck, SIGNAL("stateChanged(int)")),
(self.noDataEdit, SIGNAL( "textChanged( const QString & )" ), self.noDataCheck),
(self.maskSelector, SIGNAL("filenameChanged()"), self.maskCheck, "1.6.0"),
(self.maskSelector, SIGNAL("filenameChanged()"), self.maskCheck, 1600),
]
)

Expand Down

0 comments on commit e9e1530

Please sign in to comment.