Skip to content
Permalink
Browse files

[ftools] More SIP API updates

  • Loading branch information
m-kuhn committed Jun 16, 2013
1 parent c7a5e0f commit e3608db6a2398bc616f244cf7a61cf49df6a84ff
@@ -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

@@ -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

@@ -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

@@ -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 )
@@ -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():
@@ -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):
@@ -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 )

@@ -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:
@@ -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 )

@@ -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:

0 comments on commit e3608db

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