Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
reactivate select by location progress bar. Fixes #2517; Thanks to al…
…exbruy for the patch!

git-svn-id: http://svn.osgeo.org/qgis/trunk@13024 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer committed Mar 8, 2010
1 parent 0e72bcb commit c902101
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/plugins/fTools/tools/doSelectByLocation.py
Expand Up @@ -62,20 +62,25 @@ def compute(self, inPoly, inPts, modify):
selectedSet = []
selectProvider.nextFeature(feat)
geomLayer = QgsGeometry(feat.geometry())

self.progressBar.setMaximum( inputProvider.featureCount() + selectProvider.featureCount() )

while selectProvider.nextFeature(feat):
geomLayer = geomLayer.combine(QgsGeometry(feat.geometry()))
self.progressBar.setValue( self.progressBarValue() + 1 )
while inputProvider.nextFeature(feat):
geom = QgsGeometry(feat.geometry())
if geom.intersects(geomLayer):
selectedSet.append(feat.id())
self.progressBar.setValue( self.progressBarValue() + 1 )
if modify == self.tr("adding to current selection"):
selectedSet = list(set(inputLayer.selectedFeaturesIds()).union(selectedSet))
elif modify == self.tr("removing from current selection"):
selectedSet = list(set(inputLayer.selectedFeaturesIds()).difference(selectedSet))
inputLayer.setSelectedFeatures(selectedSet)

#Gets vector layer by layername in canvas
#Return: QgsVectorLayer
#Return: QgsVectorLayer
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
Expand Down

0 comments on commit c902101

Please sign in to comment.