wms provider: handle content type case insensitive

This commit is contained in:
Juergen E. Fischer 2012-04-19 21:26:59 +02:00
parent 314783619b
commit 7cdd446a9e

View File

@ -801,10 +801,10 @@ void QgsWmsProvider::tileReplyFinished()
QString contentType = reply->header( QNetworkRequest::ContentTypeHeader ).toString();
QgsDebugMsg( "contentType: " + contentType );
if ( !contentType.startsWith( "image/" ) )
if ( !contentType.startsWith( "image/", Qt::CaseInsensitive ) )
{
QByteArray text = reply->readAll();
if ( contentType == "text/xml" && parseServiceExceptionReportDom( text ) )
if ( contentType.toLower() == "text/xml" && parseServiceExceptionReportDom( text ) )
{
showMessageBox( mErrorCaption, mError );
}
@ -909,7 +909,7 @@ void QgsWmsProvider::cacheReplyFinished()
QString contentType = cacheReply->header( QNetworkRequest::ContentTypeHeader ).toString();
QgsDebugMsg( "contentType: " + contentType );
if ( contentType.startsWith( "image/" ) )
if ( contentType.startsWith( "image/", Qt::CaseInsensitive ) )
{
QImage myLocalImage = QImage::fromData( cacheReply->readAll() );
if ( !myLocalImage.isNull() )
@ -925,7 +925,7 @@ void QgsWmsProvider::cacheReplyFinished()
else
{
QByteArray text = cacheReply->readAll();
if ( contentType == "text/xml" && parseServiceExceptionReportDom( text ) )
if ( contentType.toLower() == "text/xml" && parseServiceExceptionReportDom( text ) )
{
showMessageBox( mErrorCaption, mError );
}