Skip to content
Permalink
Browse files
Use vector layer methods to test queries (instead of provider methods)
git-svn-id: http://svn.osgeo.org/qgis/trunk@15645 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 30, 2011
1 parent 8e1c0b4 commit 7deafa0a3d4de172860b332d86682c0e9fbec10d
Showing with 4 additions and 7 deletions.
  1. +4 −7 src/gui/qgssearchquerybuilder.cpp
@@ -29,7 +29,6 @@
#include "qgssearchquerybuilder.h"
#include "qgssearchstring.h"
#include "qgssearchtreenode.h"
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
#include "qgslogger.h"

@@ -215,13 +214,11 @@ long QgsSearchQueryBuilder::countRecords( QString searchString )

int count = 0;
QgsFeature feat;
QgsVectorDataProvider* provider = mLayer->dataProvider();
const QgsFieldMap& fields = provider->fields();
QgsAttributeList allAttributes = provider->attributeIndexes();

provider->select( allAttributes, QgsRectangle(), fetchGeom );
const QgsFieldMap& fields = mLayer->pendingFields();
QgsAttributeList allAttributes = mLayer->pendingAllAttributesList();
mLayer->select( allAttributes, QgsRectangle(), fetchGeom );

while ( provider->nextFeature( feat ) )
while ( mLayer->nextFeature( feat ) )
{
if ( searchTree->checkAgainst( fields, feat ) )
{

0 comments on commit 7deafa0

Please sign in to comment.