Skip to content

Commit

Permalink
[ftools] More SIP API updates
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 16, 2013
1 parent c7a5e0f commit e3608db
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -892,7 +892,7 @@ def intersect( self ):
crs_match = crsA == crsB
fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
longNames = ftools_utils.checkFieldNameLength( fields )
if not longNames.isEmpty():
if longNames:
message = self.tr('Following field names are longer than 10 characters:\n%s') % ( '\n'.join(longNames) )
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message

Expand Down Expand Up @@ -1077,7 +1077,7 @@ def union( self ):

fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
longNames = ftools_utils.checkFieldNameLength( fields )
if not longNames.isEmpty():
if longNames:
message = self.tr( 'Following field names are longer than 10 characters:\n%s' ) % ( "\n".join(longNames) )
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message

Expand Down Expand Up @@ -1263,7 +1263,7 @@ def symetrical_difference( self ):

fields = ftools_utils.combineVectorFields( self.vlayerA, self.vlayerB )
longNames = ftools_utils.checkFieldNameLength( fields )
if not longNames.isEmpty():
if longNames:
message = self.tr( 'Following field names are longer than 10 characters:\n%s' ) % ( "\n".join(longNames) )
return GEOS_EXCEPT, FEATURE_EXCEPT, crs_match, message

Expand Down
6 changes: 3 additions & 3 deletions python/plugins/fTools/tools/doMergeShapes.py
Expand Up @@ -53,7 +53,7 @@ def inputDir( self ):
self.tr( "Select directory with shapefiles to merge" ),
lastDir )

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

workDir = QDir( inDir )
Expand Down Expand Up @@ -89,8 +89,8 @@ def inputFile( self ):
fileName = QFileInfo( f ).fileName()
self.inputFiles.append( fileName )

self.progressFiles.setRange( 0, self.inputFiles.count() )
self.leInputDir.setText( files.join( ";" ) )
self.progressFiles.setRange( 0, len( self.inputFiles ) )
self.leInputDir.setText( ";".join( files ) )

def changeMode( self ):
if self.chkListMode.isChecked():
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doPointDistance.py
Expand Up @@ -143,7 +143,7 @@ def saveFile(self):
fileCheck = QFile(outName)
filePath = QFileInfo(outName).absoluteFilePath()
if filePath.right(4) != ".csv": filePath = filePath + ".csv"
if not outName.isEmpty():
if outName:
self.outFile.insert(filePath)

def compute(self, line1, line2, field1, field2, outPath, matType, nearest, progressBar):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doSpatialIndex.py
Expand Up @@ -133,7 +133,7 @@ def processFinished( self, errors ):
self.stopProcessing()
self.restoreGui()

if not errors.isEmpty():
if errors:
msg = self.tr( "Processing of the following layers/files ended with error:<br><br>" ) + "<br>".join(errors)
QErrorMessage( self ).showMessage( msg )

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doValidate.py
Expand Up @@ -115,7 +115,7 @@ def keyPressEvent( self, e ):
for row in range( self.tblUnique.rowCount() ):
items.append( self.tblUnique.item( row, 0 ).text()
+ "," + self.tblUnique.item( row, 1 ).text() + "\n" )
if not items.isEmpty():
if items:
clip_board = QApplication.clipboard()
clip_board.setText( items )
else:
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doVectorSplit.py
Expand Up @@ -123,7 +123,7 @@ def processFinished(self, errors):
outPath = self.outShape.text()
self.restoreGui()

if not errors.isEmpty():
if errors:
msg = self.tr( "Processing of the following layers/files ended with error:<br><br>" ) + "<br>".join(errors)
QErrorMessage( self ).showMessage( msg )

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doVisual.py
Expand Up @@ -72,7 +72,7 @@ def keyPressEvent( self, e ):
else:
for rec in range( self.tblUnique.rowCount() ):
items.append( self.tblUnique.item( rec, 0 ).text() + ":" + self.tblUnique.item( rec, 1 ).text() + "\n" )
if not items.isEmpty():
if items:
clip_board = QApplication.clipboard()
clip_board.setText( items )
else:
Expand Down

0 comments on commit e3608db

Please sign in to comment.