Skip to content

Commit

Permalink
Update feature paging fix to allow for WFS version >= 1.1
Browse files Browse the repository at this point in the history
But, only default to paging enabled if WFS 2.0.0 or higher

From Even Rouault: For some older MapServer versions that had a paging
extension for WFS 1.1, but didn't support yet WFS 2.0
  • Loading branch information
dakcarto authored and nyalldawson committed Jun 9, 2019
1 parent b9ec495 commit d106406
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/gui/qgsnewhttpconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ

void QgsNewHttpConnection::wfsVersionCurrentIndexChanged( int index )
{
cbxWfsFeaturePaging->setEnabled( index == 0 || index >= 3 );
lblPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == 0 || index >= 3 ) );
txtPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == 0 || index >= 3 ) );
// For now 2019-06-06, leave paging checkable for some WFS version 1.1 servers with support
cbxWfsFeaturePaging->setEnabled( index == 0 || index >= 2 );
lblPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == 0 || index >= 2 ) );
txtPageSize->setEnabled( cbxWfsFeaturePaging->isChecked() && ( index == 0 || index >= 2 ) );
cbxWfsIgnoreAxisOrientation->setEnabled( index != 1 );
}

Expand Down Expand Up @@ -318,14 +319,16 @@ void QgsNewHttpConnection::updateServiceSpecificSettings()
txtReferer->setText( settings.value( wmsKey + "/referer" ).toString() );
txtMaxNumFeatures->setText( settings.value( wfsKey + "/maxnumfeatures" ).toString() );

bool pagingEnabled = settings.value( wfsKey + "/pagingenabled", true ).toBool();
// Only default to paging enabled if WFS 2.0.0 or higher
bool pagingEnabled = settings.value( wfsKey + "/pagingenabled", ( versionIdx == 0 || versionIdx >= 3 ) ).toBool();
txtPageSize->setText( settings.value( wfsKey + "/pagesize" ).toString() );
cbxWfsFeaturePaging->setChecked( pagingEnabled );

// Enable/disable these items per WFS versions
txtPageSize->setEnabled( pagingEnabled && ( versionIdx == 0 || versionIdx >= 3 ) );
lblPageSize->setEnabled( pagingEnabled && ( versionIdx == 0 || versionIdx >= 3 ) );
cbxWfsFeaturePaging->setEnabled( versionIdx == 0 || versionIdx >= 3 );
// For now 2019-06-06, leave paging checkable for some WFS version 1.1 servers with support
txtPageSize->setEnabled( pagingEnabled && ( versionIdx == 0 || versionIdx >= 2 ) );
lblPageSize->setEnabled( pagingEnabled && ( versionIdx == 0 || versionIdx >= 2 ) );
cbxWfsFeaturePaging->setEnabled( versionIdx == 0 || versionIdx >= 2 );
cbxWfsIgnoreAxisOrientation->setEnabled( versionIdx != 1 );
}

Expand Down

0 comments on commit d106406

Please sign in to comment.