Showing with 15 additions and 22 deletions.
  1. +1 −1 src/gui/qgsnewhttpconnection.cpp
  2. +13 −20 src/providers/wms/qgswmsprovider.cpp
  3. +1 −1 src/ui/qgsoptionsbase.ui
2 changes: 1 addition & 1 deletion src/gui/qgsnewhttpconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void QgsNewHttpConnection::accept()
settings.setValue( key + "/invertAxisOrientation", cbxInvertAxisOrientation->isChecked() );
settings.setValue( key + "/smoothPixmapTransform", cbxSmoothPixmapTransform->isChecked() );

int dpiMode;
int dpiMode = 0;
switch ( cmbDpiMode->currentIndex() )
{
case 0: // all => QGIS|UMN|GeoServer
Expand Down
33 changes: 13 additions & 20 deletions src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1389,24 +1389,22 @@ void QgsWmsProvider::cacheReplyFinished()

QString contentType = mCacheReply->header( QNetworkRequest::ContentTypeHeader ).toString();
QgsDebugMsg( "contentType: " + contentType );
if ( contentType.startsWith( "image/", Qt::CaseInsensitive ) ||
contentType.compare( "application/octet-stream", Qt::CaseInsensitive ) == 0 )
QByteArray text = mCacheReply->readAll();
QImage myLocalImage = QImage::fromData( text );

if ( !myLocalImage.isNull() )
{
QImage myLocalImage = QImage::fromData( mCacheReply->readAll() );
if ( !myLocalImage.isNull() )
{
QPainter p( mCachedImage );
p.drawImage( 0, 0, myLocalImage );
}
else
{
QgsMessageLog::logMessage( tr( "Returned image is flawed [Content-Type:%1; URL:%2]" )
.arg( contentType ).arg( mCacheReply->url().toString() ), tr( "WMS" ) );
}
QPainter p( mCachedImage );
p.drawImage( 0, 0, myLocalImage );
}
else if ( contentType.startsWith( "image/", Qt::CaseInsensitive ) ||
contentType.compare( "application/octet-stream", Qt::CaseInsensitive ) == 0 )
{
QgsMessageLog::logMessage( tr( "Returned image is flawed [Content-Type:%1; URL:%2]" )
.arg( contentType ).arg( mCacheReply->url().toString() ), tr( "WMS" ) );
}
else
{
QByteArray text = mCacheReply->readAll();
if ( contentType.toLower() == "text/xml" && parseServiceExceptionReportDom( text ) )
{
QgsMessageLog::logMessage( tr( "Map request error (Title:%1; Error:%2; URL: %3)" )
Expand All @@ -1421,17 +1419,12 @@ void QgsWmsProvider::cacheReplyFinished()
.arg( contentType )
.arg( mCacheReply->url().toString() ), tr( "WMS" ) );
}

mCacheReply->deleteLater();
mCacheReply = 0;

return;
}

mCacheReply->deleteLater();
mCacheReply = 0;

if ( !mWaiting )
if ( !mWaiting && !myLocalImage.isNull() )
{
QgsDebugMsg( "emit dataChanged()" );
emit dataChanged();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsoptionsbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -4205,7 +4205,7 @@
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Size</string>
<string>Size [KiB]</string>
</property>
</widget>
</item>
Expand Down