Skip to content

Commit

Permalink
[WFS provider] Un-break building of offline editing database with 'On…
Browse files Browse the repository at this point in the history
…ly request features overlapping the view extent' mode
  • Loading branch information
rouault committed Jun 24, 2016
1 parent c6e0ad3 commit d73ec06
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/providers/wfs/qgswfsshareddata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,11 @@ int QgsWFSSharedData::registerToCache( QgsWFSFeatureIterator* iterator, QgsRecta
// In case the request has a spatial filter, which is not the one currently
// being downloaded, check if we have already downloaded an area of interest that includes it
// before deciding to restart a new download with the provided area of interest.
// But don't abort a on going download without a BBOX (Offline editing use case
// when "Only request features overlapping the view extent" : the offline editor
// want to request all features whereas the map renderer only the view)
bool newDownloadNeeded = false;
if ( !rect.isEmpty() && mRect != rect )
if ( !rect.isEmpty() && mRect != rect && !( mDownloader && mRect.isEmpty() ) )
{
QList<QgsFeatureId> intersectingRequests = mCachedRegions.intersects( rect );
newDownloadNeeded = true;
Expand Down Expand Up @@ -533,6 +536,12 @@ int QgsWFSSharedData::registerToCache( QgsWFSFeatureIterator* iterator, QgsRecta
}
}
}
// If there's a ongoing download with a BBOX and we request a new download
// without it, then we need a new download.
else if ( rect.isEmpty() && mDownloader && !mRect.isEmpty() )
{
newDownloadNeeded = true;
}

if ( newDownloadNeeded || !mDownloader )
{
Expand Down

0 comments on commit d73ec06

Please sign in to comment.