Skip to content

Commit

Permalink
Use empty string methods, not ""
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 29, 2020
1 parent 8437c87 commit 61ff81a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsdataitems.cpp
Expand Up @@ -362,7 +362,7 @@ QString QgsWMSLayerItem::createUri()

// Number of styles must match number of layers
mDataSourceUri.setParam( QStringLiteral( "layers" ), mLayerProperty.name );
QString style = !mLayerProperty.style.isEmpty() ? mLayerProperty.style.at( 0 ).name : QLatin1String( "" );
QString style = !mLayerProperty.style.isEmpty() ? mLayerProperty.style.at( 0 ).name : QString();
mDataSourceUri.setParam( QStringLiteral( "styles" ), style );

// Check for layer dimensions
Expand Down
14 changes: 7 additions & 7 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -1102,11 +1102,11 @@ void QgsWmsProvider::addWmstParameters( QUrlQuery &query )
}
else
{
if ( uri.hasParam( QLatin1String( "time" ) ) &&
uri.param( QLatin1String( "time" ) ) != QLatin1String( "" ) )
if ( uri.hasParam( QStringLiteral( "time" ) ) &&
!uri.param( QStringLiteral( "time" ) ).isEmpty() )
{
QString time = uri.param( QLatin1String( "time" ) );
QStringList timeParts = time.split( "/" );
QString time = uri.param( QStringLiteral( "time" ) );
QStringList timeParts = time.split( '/' );

QDateTime start = QDateTime::fromString( timeParts.at( 0 ), Qt::ISODateWithMs );
QDateTime end = QDateTime::fromString( timeParts.at( 1 ), Qt::ISODateWithMs );
Expand Down Expand Up @@ -1135,10 +1135,10 @@ void QgsWmsProvider::addWmstParameters( QUrlQuery &query )
}

// If the data provider has bi-temporal properties and they are enabled
if ( uri.hasParam( "reference_time" ) &&
uri.param( QLatin1String( "reference_time" ) ) != QLatin1String( "" ) )
if ( uri.hasParam( QStringLiteral( "reference_time" ) ) &&
!uri.param( QStringLiteral( "reference_time" ) ).isEmpty() )
{
QString time = uri.param( QLatin1String( "reference_time" ) );
QString time = uri.param( QStringLiteral( "reference_time" ) );

QDateTime dateTime = QDateTime::fromString( time, Qt::ISODateWithMs );

Expand Down

0 comments on commit 61ff81a

Please sign in to comment.