[ftools] More SIP API updates

This commit is contained in:
Matthias Kuhn 2013-06-16 14:21:32 +02:00
parent c7a5e0f763
commit e3608db6a2
7 changed files with 11 additions and 11 deletions

View File

@ -892,7 +892,7 @@ class geoprocessingThread( QThread ):
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 @@ class geoprocessingThread( QThread ):
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 @@ class geoprocessingThread( QThread ):
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

View File

@ -53,7 +53,7 @@ class Dialog( QDialog, Ui_Dialog ):
self.tr( "Select directory with shapefiles to merge" ),
lastDir )
if inDir.isEmpty():
if not inDir:
return
workDir = QDir( inDir )
@ -89,8 +89,8 @@ class Dialog( QDialog, Ui_Dialog ):
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():

View File

@ -143,7 +143,7 @@ class Dialog(QDialog, Ui_Dialog):
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):

View File

@ -133,7 +133,7 @@ class Dialog( QDialog, Ui_Dialog ):
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 )

View File

@ -115,7 +115,7 @@ class ValidateDialog( QDialog, Ui_Dialog ):
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:

View File

@ -123,7 +123,7 @@ class Dialog(QDialog, Ui_Dialog):
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 )

View File

@ -72,7 +72,7 @@ class VisualDialog( QDialog, Ui_Dialog ):
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: