Skip to content

Commit

Permalink
Use vector layer methods to test queries (instead of provider methods)
Browse files Browse the repository at this point in the history
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 7deafa0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/gui/qgssearchquerybuilder.cpp
Expand Up @@ -29,7 +29,6 @@
#include "qgssearchquerybuilder.h"
#include "qgssearchstring.h"
#include "qgssearchtreenode.h"
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
#include "qgslogger.h"

Expand Down Expand Up @@ -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 ) )
{
Expand Down

0 comments on commit 7deafa0

Please sign in to comment.