Index: python/plugins/fTools/tools/doValidate.py =================================================================== --- python/plugins/fTools/tools/doValidate.py (revision 14620) +++ python/plugins/fTools/tools/doValidate.py (working copy) @@ -24,14 +24,14 @@ self.tblUnique.setSelectionBehavior(QAbstractItemView.SelectRows) # populate list of available layers myList = ftools_utils.getLayerNames( [ QGis.Point, QGis.Line, QGis.Polygon ] ) - self.connect(self.tblUnique, SIGNAL("currentItemChanged(QTableWidgetItem*, QTableWidgetItem*)" ), + self.connect(self.tblUnique, SIGNAL("currentItemChanged(QTableWidgetItem*, QTableWidgetItem*)" ), self.zoomToError) self.inShape.addItems( myList ) self.cancel_close = self.buttonBox_2.button(QDialogButtonBox.Close) self.buttonOk = self.buttonBox_2.button(QDialogButtonBox.Ok) self.progressBar.setValue(0) self.storedScale = self.iface.mapCanvas().scale() - + def keyPressEvent( self, e ): if ( e.modifiers() == Qt.ControlModifier or \ e.modifiers() == Qt.MetaModifier ) and \ @@ -54,7 +54,7 @@ QMessageBox.information( self, self.tr("Error!"), self.tr( "Please specify input field" ) ) else: self.validate( self.inShape.currentText(), self.useSelected.checkState() ) - + def zoomToError(self, curr, prev): if curr is None: return @@ -93,7 +93,7 @@ self.testThread.stop() QApplication.restoreOverrideCursor() self.buttonOk.setEnabled( True ) - + def runFinishedFromThread( self, output ): self.testThread.stop() QApplication.restoreOverrideCursor() @@ -124,10 +124,10 @@ self.cancel_close.setText( "Close" ) QObject.disconnect( self.cancel_close, SIGNAL( "clicked()" ), self.cancelThread ) return True - + def runStatusFromThread( self, status ): self.progressBar.setValue( status ) - + def runRangeFromThread( self, range_vals ): self.progressBar.setRange( range_vals[ 0 ], range_vals[ 1 ] ) @@ -154,9 +154,14 @@ layer = vlayer.selectedFeatures() nFeat = len(layer) else: - layer = vlayer - layer.select([]) # select all features, and ignore attributes - nFeat = layer.featureCount() + #layer = vlayer + layer = [] + vlayer.select([]) # select all features, and ignore attributes + ft = QgsFeature() + while vlayer.nextFeature( ft ): + layer.append( ft ) + ft = QgsFeature() + nFeat = vlayer.featureCount() nElement = 0 if nFeat > 0: self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )