[QGIS Commit] r13854 - trunk/qgis/python/plugins/fTools/tools

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Jun 30 14:26:36 EDT 2010


Author: jef
Date: 2010-06-30 18:26:36 +0000 (Wed, 30 Jun 2010)
New Revision: 13854

Modified:
   trunk/qgis/python/plugins/fTools/tools/doVisual.py
Log:
fix #2844

Modified: trunk/qgis/python/plugins/fTools/tools/doVisual.py
===================================================================
--- trunk/qgis/python/plugins/fTools/tools/doVisual.py	2010-06-30 16:03:42 UTC (rev 13853)
+++ trunk/qgis/python/plugins/fTools/tools/doVisual.py	2010-06-30 18:26:36 UTC (rev 13854)
@@ -130,7 +130,6 @@
     self.testThread.stop()
     QApplication.restoreOverrideCursor()
     self.buttonOk.setEnabled( True )
-    QApplication.restoreOverrideCursor()
     
   def runFinishedFromThread( self, output ):
     self.testThread.stop()
@@ -217,8 +216,9 @@
     lstUnique = []
     nFeat = len( unique )
     nElement = 0
-    self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
-    self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
+    if nFeat > 0:
+      self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
+      self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
     for item in unique:
       nElement += 1
       self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
@@ -270,8 +270,9 @@
           self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
       else: # there is no selection, process the whole layer
         nFeat = vprovider.featureCount()
-        self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
-        self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
+	if nFeat > 0:
+          self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
+          self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
         vprovider.select( allAttrs )
         while vprovider.nextFeature( feat ):
           atMap = feat.attributeMap()
@@ -335,8 +336,9 @@
       else: # there is no selection, process the whole layer
         nFeat = vprovider.featureCount()
         uniqueVal = ftools_utils.getUniqueValuesCount( vlayer, index, False )
-        self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
-        self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
+	if nFeat > 0:
+          self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
+          self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
         vprovider.select( allAttrs )
         while vprovider.nextFeature( feat ):
           atMap = feat.attributeMap()
@@ -397,8 +399,9 @@
     vprovider.rewind()
     nFeat = vprovider.featureCount()
     nElement = 0
-    self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
-    self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
+    if nFeat > 0:
+      self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
+      self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
     while vprovider.nextFeature( feat ):
       neighbourID = index.nearestNeighbor( feat.geometry().asPoint(), 2 )[ 1 ]
       vprovider.featureAtId( neighbourID, neighbour, True, [] )
@@ -430,8 +433,9 @@
     lstErrors = []
     nFeat = vprovider.featureCount()
     nElement = 0
-    self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
-    self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
+    if nFeat > 0:
+      self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
+      self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
 
     while vprovider.nextFeature( feat ):
       geom = QgsGeometry( feat.geometry() )



More information about the QGIS-commit mailing list