Skip to content

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
 

‎src/providers/wfs/qgswfsprovider.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ static const QString TEXT_PROVIDER_DESCRIPTION = "WFS data provider";
3636
static const QString WFS_NAMESPACE = "http://www.opengis.net/wfs";
3737
static const QString GML_NAMESPACE = "http://www.opengis.net/gml";
3838

39-
QgsWFSProvider::QgsWFSProvider(const QString& uri): QgsVectorDataProvider(uri), mUseIntersect(false), mSourceSRS(0), mSelectedFeatures(0), mFeatureCount(0)
39+
QgsWFSProvider::QgsWFSProvider(const QString& uri): QgsVectorDataProvider(uri), mUseIntersect(false), mSourceSRS(0), mSelectedFeatures(0), mFeatureCount(0), mValid(true)
4040
{
4141
if(getFeature(uri) == 0)
4242
{
43-
//provider valid
43+
mValid = true;
44+
//set spatial filter to the whole extent
45+
select(&mExtent, false);
4446
}
4547
else
4648
{
47-
//provider invalid
49+
mValid = false;
4850
}
49-
//set spatial filter to the whole extent
50-
select(&mExtent, false);
5151
}
5252

5353
QgsWFSProvider::~QgsWFSProvider()
@@ -233,7 +233,7 @@ QgsRect* QgsWFSProvider::extent()
233233

234234
bool QgsWFSProvider::isValid()
235235
{
236-
return true;
236+
return mValid;
237237
}
238238

239239
void QgsWFSProvider::select(QgsRect *mbr, bool useIntersect)

‎src/providers/wfs/qgswfsprovider.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class QgsWFSProvider: public QgsVectorDataProvider
9999
The position in the vector is equal to the position of an attribute in the layers attribute vector*/
100100
std::vector< std::pair<QString, QString> > mMinMaxCash;
101101
int mFeatureCount;
102+
/**Flag if provider is valid*/
103+
bool mValid;
102104

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

0 commit comments

Comments
 (0)
Please sign in to comment.