Skip to content

Commit 836e1a8

Browse files
committedNov 15, 2013
WMS:
- don't let failing (optional) GetLegendGraphic request block every following request - don't refresh legend symbology everytime the extent changes (ie. don't GetLegendGraphic again and again)
1 parent c0b8e9a commit 836e1a8

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed
 

‎src/app/legend/qgslegend.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,11 @@ QgsLegend::QgsLegend( QgsMapCanvas *canvas, QWidget * parent, const char *name )
114114

115115
connect( mMapCanvas, SIGNAL( layersChanged() ),
116116
this, SLOT( refreshCheckStates() ) );
117+
#if 0
118+
// too much
117119
connect( mMapCanvas, SIGNAL( extentsChanged() ),
118120
this, SLOT( updateLegendItemSymbologies() ) );
121+
#endif
119122

120123
// Initialise the line indicator widget.
121124
mInsertionLine = new QWidget( viewport() );

‎src/providers/wms/qgswmsprovider.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,13 +1019,13 @@ void QgsWmsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in
10191019
Q_UNUSED( bandNo );
10201020
QgsDebugMsg( "Entered" );
10211021
// TODO: optimize to avoid writing to QImage
1022-
QImage* image = draw( viewExtent, pixelWidth, pixelHeight );
1023-
1024-
if ( ! image ) // should not happen
1022+
QImage *image = draw( viewExtent, pixelWidth, pixelHeight );
1023+
if ( !image ) // should not happen
10251024
{
10261025
QgsMessageLog::logMessage( tr( "image is NULL" ), tr( "WMS" ) );
10271026
return;
10281027
}
1028+
10291029
QgsDebugMsg( QString( "image height = %1 bytesPerLine = %2" ).arg( image->height() ) . arg( image->bytesPerLine() ) ) ;
10301030
size_t myExpectedSize = pixelWidth * pixelHeight * 4;
10311031
size_t myImageSize = image->height() * image->bytesPerLine();
@@ -4785,9 +4785,7 @@ void QgsWmsProvider::getLegendGraphicReplyFinished()
47854785
}
47864786
else
47874787
{
4788-
mErrorFormat = "text/plain";
4789-
mError = tr( "Download of GetLegendGraphic failed: %1" ).arg( mGetLegendGraphicReply->errorString() );
4790-
QgsMessageLog::logMessage( mError, tr( "WMS" ) );
4788+
QgsMessageLog::logMessage( tr( "Download of GetLegendGraphic failed: %1" ).arg( mGetLegendGraphicReply->errorString() ), tr( "WMS" ) );
47914789
mHttpGetLegendGraphicResponse.clear();
47924790
}
47934791

0 commit comments

Comments
 (0)
Please sign in to comment.