Skip to content

Commit

Permalink
[Server] Replace list.size() < 1 by list.isEmpty()
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Jun 5, 2017
1 parent b6c76a0 commit fc63cbe
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/server/qgsinterpolationlayerbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ QgsMapLayer *QgsInterpolationLayerBuilder::createMapLayer( const QDomElement &el
}

QDomNodeList interpolationList = elem.elementsByTagName( QStringLiteral( "Interpolation" ) );
if ( interpolationList.size() < 1 )
if ( interpolationList.isEmpty() )
{
QgsDebugMsg( "No Interpolation element found" );
return nullptr;
Expand All @@ -68,7 +68,7 @@ QgsMapLayer *QgsInterpolationLayerBuilder::createMapLayer( const QDomElement &el
QgsInterpolator::LayerData currentLayerData;
currentLayerData.vectorLayer = mVectorLayer;
QDomNodeList propertyNameList = interpolationElem.elementsByTagName( QStringLiteral( "PropertyName" ) );
if ( propertyNameList.size() < 1 )
if ( propertyNameList.isEmpty() )
{
currentLayerData.zCoordInterpolation = true;
}
Expand Down Expand Up @@ -110,7 +110,7 @@ QgsMapLayer *QgsInterpolationLayerBuilder::createMapLayer( const QDomElement &el
int nCols, nRows;

QDomNodeList resolutionNodeList = elem.elementsByTagName( QStringLiteral( "Resolution" ) );
if ( resolutionNodeList.size() < 1 )
if ( resolutionNodeList.isEmpty() )
{
//use default values...
nCols = 100;
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ QFileInfo QgsServer::defaultProjectFile()
{
QgsMessageLog::logMessage( projectFiles.at( x ).absoluteFilePath(), QStringLiteral( "Server" ), QgsMessageLog::INFO );
}
if ( projectFiles.size() < 1 )
if ( projectFiles.isEmpty() )
{
return QFileInfo();
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswmsdescribelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace QgsWms
}

QStringList layersList = parameters[ QStringLiteral( "LAYERS" )].split( ',', QString::SkipEmptyParts );
if ( layersList.size() < 1 )
if ( layersList.isEmpty() )
{
throw QgsServiceException( QStringLiteral( "InvalidParameterValue" ), QStringLiteral( "Layers is empty" ), 400 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswmsgetfeatureinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace QgsWms
QDomNodeList featureNodeList = layerElem.elementsByTagName( QStringLiteral( "Feature" ) );
QDomElement currentFeatureElement;

if ( featureNodeList.size() < 1 ) //raster layer?
if ( featureNodeList.isEmpty() ) //raster layer?
{
QDomNodeList attributeNodeList = layerElem.elementsByTagName( QStringLiteral( "Attribute" ) );
for ( int j = 0; j < attributeNodeList.size(); ++j )
Expand Down
8 changes: 4 additions & 4 deletions src/server/services/wms/qgswmsrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ namespace QgsWms

readLayersAndStyles( mParameters, layersList, stylesList );

if ( layersList.size() < 1 )
if ( layersList.isEmpty() )
{
return nullptr;
}
Expand All @@ -193,7 +193,7 @@ namespace QgsWms

QgsCoordinateReferenceSystem dummyCRS;
QStringList layerIds = layerSet( layersList, stylesList, dummyCRS, scaleDenominator );
if ( layerIds.size() < 1 )
if ( layerIds.isEmpty() )
{
return nullptr;
}
Expand Down Expand Up @@ -966,7 +966,7 @@ namespace QgsWms
}

QStringList queryLayerList = mParameters[ QStringLiteral( "QUERY_LAYERS" )].split( QStringLiteral( "," ), QString::SkipEmptyParts );
if ( queryLayerList.size() < 1 )
if ( queryLayerList.isEmpty() )
{
throw QgsBadRequestException( QStringLiteral( "InvalidParameterValue" ), QStringLiteral( "Malformed QUERY_LAYERS" ) );
}
Expand Down Expand Up @@ -2386,7 +2386,7 @@ namespace QgsWms
QDomElement currentFeatureElem;

QDomNodeList featureList = currentLayerElem.elementsByTagName( QStringLiteral( "Feature" ) );
if ( featureList.size() < 1 )
if ( featureList.isEmpty() )
{
//raster?
QDomNodeList attributeList = currentLayerElem.elementsByTagName( QStringLiteral( "Attribute" ) );
Expand Down

0 comments on commit fc63cbe

Please sign in to comment.