Skip to content

Commit 087b52b

Browse files
committed
Merge pull request #965 from luipir/SITA2-WmsTileRetry
Added disclaimer to WMS TileRetry feature - Development funded from Regione Toscana - SITA (followup a563f2a and 3e27811)
2 parents d7c29ae + 8eb6c91 commit 087b52b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/app/qgsoptions.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
251251
// WMS/WMS-C tile expiry time
252252
mDefaultTileExpirySpinBox->setValue( settings.value( "/qgis/defaultTileExpiry", "24" ).toInt() );
253253

254+
// Feature funded by Regione Toscana - SITA
254255
// WMS/WMS-C default max retry in case of tile request errors
255256
mDefaultTileMaxRetrySpinBox->setValue( settings.value( "/qgis/defaultTileMaxRetry", "3" ).toInt() );
256257

@@ -902,6 +903,7 @@ void QgsOptions::saveOptions()
902903
// WMS/WMS-C tile expiry time
903904
settings.setValue( "/qgis/defaultTileExpiry", mDefaultTileExpirySpinBox->value() );
904905

906+
// Feature funded by Regione Toscana - SITA
905907
// WMS/WMS-C default max retry in case of tile request errors
906908
settings.setValue( "/qgis/defaultTileMaxRetry", mDefaultTileMaxRetrySpinBox->value() );
907909

src/providers/wms/qgswmsprovider.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,6 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
843843
}
844844

845845
int i = 0;
846-
int retry = 0;
847846
for ( int row = row0; row <= row1; row++ )
848847
{
849848
for ( int col = col0; col <= col1; col++ )
@@ -865,6 +864,7 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
865864
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ), i );
866865
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ),
867866
QRectF( tm->topLeft.x() + col * twMap, tm->topLeft.y() - ( row + 1 ) * thMap, twMap, thMap ) );
867+
int retry = 0; // just for readability
868868
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 3 ), retry );
869869

870870
QgsDebugMsg( QString( "gettile: %1" ).arg( turl ) );
@@ -902,7 +902,6 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
902902
url.removeQueryItem( "TILECOL" );
903903

904904
int i = 0;
905-
int retry = 0;
906905
for ( int row = row0; row <= row1; row++ )
907906
{
908907
for ( int col = col0; col <= col1; col++ )
@@ -920,6 +919,7 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
920919
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ), i );
921920
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ),
922921
QRectF( tm->topLeft.x() + col * twMap, tm->topLeft.y() - ( row + 1 ) * thMap, twMap, thMap ) );
922+
int retry = 0; // just for readability
923923
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 3 ), retry );
924924

925925
QgsDebugMsg( QString( "gettile: %1" ).arg( turl ) );
@@ -944,7 +944,6 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
944944
}
945945

946946
int i = 0;
947-
int retry = 0;
948947
for ( int row = row0; row <= row1; row++ )
949948
{
950949
for ( int col = col0; col <= col1; col++ )
@@ -962,6 +961,7 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
962961
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 1 ), i );
963962
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 2 ),
964963
QRectF( tm->topLeft.x() + col * twMap, tm->topLeft.y() - ( row + 1 ) * thMap, twMap, thMap ) );
964+
int retry = 0; // just for readability
965965
request.setAttribute( static_cast<QNetworkRequest::Attribute>( QNetworkRequest::User + 3 ), retry );
966966

967967
QgsDebugMsg( QString( "gettile: %1" ).arg( turl ) );
@@ -1039,6 +1039,7 @@ void QgsWmsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in
10391039
//delete image;
10401040
}
10411041

1042+
// tile retry management developed with funding from Regione Toscana-SITA
10421043
void QgsWmsProvider::repeatTileRequest( QNetworkRequest const &oldRequest )
10431044
{
10441045
if ( mErrors == 100 )

src/providers/wms/qgswmsprovider.h

+2
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ class QgsWmsProvider : public QgsRasterDataProvider
746746
/**
747747
* \brief Relaunch tile request cloning previous request parameters and managing max repeat
748748
*
749+
* \note Development funded by Regione Toscana - SITA
750+
*
749751
* \param oldRequest request to clone to generate new tile request
750752
*
751753
* request is not launched if max retry is reached. Message is logged.

0 commit comments

Comments
 (0)