@@ -80,7 +80,7 @@ def fillFieldsCombo(self):
80
80
def fillInputFileEdit (self ):
81
81
lastUsedFilter = Utils .FileFilter .lastUsedVectorFilter ()
82
82
inputFile , encoding = Utils .FileDialog .getOpenFileName (self , self .tr ( "Select the input file for Rasterize" ), Utils .FileFilter .allVectorsFilter (), lastUsedFilter , True )
83
- if inputFile . isEmpty () :
83
+ if not inputFile :
84
84
return
85
85
Utils .FileFilter .setLastUsedVectorFilter (lastUsedFilter )
86
86
@@ -100,7 +100,7 @@ def fillOutputFileEdit(self):
100
100
fileDialogFunc = Utils .FileDialog .getOpenFileName
101
101
102
102
outputFile = fileDialogFunc (self , self .tr ( "Select the raster file to save the results to" ), Utils .FileFilter .allRastersFilter (), lastUsedFilter )
103
- if outputFile . isEmpty () :
103
+ if not outputFile :
104
104
return
105
105
Utils .FileFilter .setLastUsedRasterFilter (lastUsedFilter )
106
106
@@ -113,24 +113,24 @@ def fillOutputFileEdit(self):
113
113
self .radioSetSize .setChecked (True )
114
114
115
115
def getArguments (self ):
116
- arguments = QStringList ()
116
+ arguments = []
117
117
if self .attributeComboBox .currentIndex () >= 0 :
118
- arguments << "-a"
119
- arguments << self .attributeComboBox .currentText ()
118
+ arguments . append ( "-a" )
119
+ arguments . append ( self .attributeComboBox .currentText () )
120
120
if self .radioSetSize .isChecked ():
121
- arguments << "-ts"
122
- arguments << str ( self .widthSpin .value () )
123
- arguments << str ( self .heightSpin .value () )
121
+ arguments . append ( "-ts" )
122
+ arguments . append ( self .widthSpin .value () )
123
+ arguments . append ( self .heightSpin .value () )
124
124
if self .radioSetResolution .isChecked ():
125
- arguments << "-tr"
126
- arguments << str ( self .horizresSpin .value () )
127
- arguments << str ( self .vertresSpin .value () )
125
+ arguments . append ( "-tr" )
126
+ arguments . append ( self .horizresSpin .value () )
127
+ arguments . append ( self .vertresSpin .value () )
128
128
inputFn = self .getInputFileName ()
129
- if not inputFn . isEmpty () :
130
- arguments << "-l"
131
- arguments << QFileInfo ( inputFn ).baseName ()
132
- arguments << inputFn
133
- arguments << self .getOutputFileName ()
129
+ if inputFn :
130
+ arguments . append ( "-l" )
131
+ arguments . append ( QFileInfo ( inputFn ).baseName () )
132
+ arguments . append ( inputFn )
133
+ arguments . append ( self .getOutputFileName () )
134
134
return arguments
135
135
136
136
def getInputFileName (self ):
@@ -145,7 +145,7 @@ def addLayerIntoCanvas(self, fileInfo):
145
145
def loadFields (self , vectorFile ):
146
146
self .attributeComboBox .clear ()
147
147
148
- if vectorFile . isEmpty () :
148
+ if not vectorFile :
149
149
return
150
150
151
151
try :
0 commit comments