Skip to content

Commit

Permalink
isValid() function for the wfs provider
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6054 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 6, 2006
1 parent a4c7d41 commit dde9fa6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -36,18 +36,18 @@ static const QString TEXT_PROVIDER_DESCRIPTION = "WFS data provider";
static const QString WFS_NAMESPACE = "http://www.opengis.net/wfs";
static const QString GML_NAMESPACE = "http://www.opengis.net/gml";

QgsWFSProvider::QgsWFSProvider(const QString& uri): QgsVectorDataProvider(uri), mUseIntersect(false), mSourceSRS(0), mSelectedFeatures(0), mFeatureCount(0)
QgsWFSProvider::QgsWFSProvider(const QString& uri): QgsVectorDataProvider(uri), mUseIntersect(false), mSourceSRS(0), mSelectedFeatures(0), mFeatureCount(0), mValid(true)
{
if(getFeature(uri) == 0)
{
//provider valid
mValid = true;
//set spatial filter to the whole extent
select(&mExtent, false);
}
else
{
//provider invalid
mValid = false;
}
//set spatial filter to the whole extent
select(&mExtent, false);
}

QgsWFSProvider::~QgsWFSProvider()
Expand Down Expand Up @@ -233,7 +233,7 @@ QgsRect* QgsWFSProvider::extent()

bool QgsWFSProvider::isValid()
{
return true;
return mValid;
}

void QgsWFSProvider::select(QgsRect *mbr, bool useIntersect)
Expand Down
2 changes: 2 additions & 0 deletions src/providers/wfs/qgswfsprovider.h
Expand Up @@ -99,6 +99,8 @@ class QgsWFSProvider: public QgsVectorDataProvider
The position in the vector is equal to the position of an attribute in the layers attribute vector*/
std::vector< std::pair<QString, QString> > mMinMaxCash;
int mFeatureCount;
/**Flag if provider is valid*/
bool mValid;

/**Goes through all the features and their attributes and populates mMinMaxCash with entries*/
void fillMinMaxCash();
Expand Down

0 comments on commit dde9fa6

Please sign in to comment.