Skip to content

Commit

Permalink
[wms] Misc Qt 6 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 30, 2021
1 parent 405ae2d commit 9085de2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmscapabilities.cpp
Expand Up @@ -1154,7 +1154,7 @@ void QgsWmsCapabilities::parseLayer( const QDomElement &element, QgsWmsLayerProp
{
// CRS can contain several definitions separated by whitespace
// though this was deprecated in WMS 1.1.1
const QStringList crsList = nodeElement.text().split( QRegExp( "\\s+" ) );
const QStringList crsList = nodeElement.text().split( QRegularExpression( "\\s+" ) );
for ( const QString &srs : crsList )
{
if ( !layerProperty.crs.contains( srs ) )
Expand Down
4 changes: 3 additions & 1 deletion src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -2167,7 +2167,7 @@ QString QgsWmsProvider::layerMetadata( QgsWmsLayerProperty &layer )
}

// Layer Coordinate Reference Systems
for ( int j = 0; j < std::min( layer.crs.size(), 10 ); j++ )
for ( int j = 0; j < std::min( static_cast< int >( layer.crs.size() ), 10 ); j++ )
{
metadata += QStringLiteral( "<tr><td>" ) %
tr( "Available in CRS" ) %
Expand Down Expand Up @@ -3275,7 +3275,9 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPointXY &point, QgsRa
dom.setContent( gmlByteArray ); // gets XML encoding
gmlByteArray.clear();
QTextStream stream( &gmlByteArray );
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
stream.setCodec( QTextCodec::codecForName( "UTF-8" ) );
#endif
dom.save( stream, 4, QDomNode::EncodingFromTextStream );

QgsDebugMsgLevel( "GML UTF-8 (first 2000 bytes):\n" + gmlByteArray.left( 2000 ), 2 );
Expand Down

0 comments on commit 9085de2

Please sign in to comment.