Skip to content

Commit

Permalink
Fix no geometry bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
hamiltoncj committed Jul 15, 2022
1 parent 4f66199 commit 4d44e8f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions fuzzyWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ def searchLayer(self, layer):
# Check for contraints
if self.constrain_to_canvas and layer.isSpatial():
extent = self.canvasExtent(layer)
request = QgsFeatureRequest(extent).setFlags(QgsFeatureRequest.NoGeometry)
request = QgsFeatureRequest(extent)
else:
request = QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)
request = QgsFeatureRequest()
fnames = []
# Get and Keep a copy of the field names
for field in layer.fields():
Expand Down Expand Up @@ -149,9 +149,9 @@ def searchFieldInLayer(self, layer, selectedField):
search_str_len = len(self.searchStr)
if self.constrain_to_canvas and layer.isSpatial():
extent = self.canvasExtent(layer)
request = QgsFeatureRequest(extent).setFlags(QgsFeatureRequest.NoGeometry)
request = QgsFeatureRequest(extent)
else:
request = QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)
request = QgsFeatureRequest()
# self.error.emit('searchFieldInLayer')
request.setSubsetOfAttributes([selectedField], layer.fields())
if self.search_selected:
Expand Down
3 changes: 2 additions & 1 deletion metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name=Search Layers
qgisMinimumVersion=3.0
description=Enhanced textual searching on all QGIS layers and fields.
version=3.0.10
version=3.0.11
author=C Hamilton
[email protected]
about=The Search Layers plugin features enhanced textual vector layer searching in QGIS. This plugin can search across all layers and all fields.
Expand All @@ -15,6 +15,7 @@ icon=icon.png
experimental=False
deprecated=False
changelog=
3.0.11 - Fix no geometry bug
3.0.10 - Update translation.
3.0.9 - Keep layer and attribute settings when tool is closed.
3.0.8 - Internationalize
Expand Down
8 changes: 4 additions & 4 deletions searchWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def searchLayer(self, layer):
# Check for contraints
if self.constrain_to_canvas and layer.isSpatial():
extent = self.canvasExtent(layer)
request = QgsFeatureRequest(extent).setFlags(QgsFeatureRequest.NoGeometry)
request = QgsFeatureRequest(extent)
else:
request = QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)
request = QgsFeatureRequest()
fnames = []
# Get and Keep a copy of the field names
for field in layer.fields():
Expand Down Expand Up @@ -275,9 +275,9 @@ def searchFieldInLayer(self, layer, selectedField):

if self.constrain_to_canvas and layer.isSpatial():
extent = self.canvasExtent(layer)
request = QgsFeatureRequest(extent).setFlags(QgsFeatureRequest.NoGeometry)
request = QgsFeatureRequest(extent)
else:
request = QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)
request = QgsFeatureRequest()
request.setSubsetOfAttributes([selectedField], layer.fields())
request.setFilterExpression(fstring)
if self.search_selected:
Expand Down

0 comments on commit 4d44e8f

Please sign in to comment.