Skip to content
Permalink
Browse files

[Server] Replace list.size() < 1 by list.isEmpty()

  • Loading branch information
rldhont committed Jun 5, 2017
1 parent b6c76a0 commit fc63cbecc4aa8573cb7de89e20f6dc3ee967c372
@@ -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;
@@ -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;
}
@@ -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;
@@ -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();
}
@@ -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 );
}
@@ -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 )
@@ -173,7 +173,7 @@ namespace QgsWms

readLayersAndStyles( mParameters, layersList, stylesList );

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

QgsCoordinateReferenceSystem dummyCRS;
QStringList layerIds = layerSet( layersList, stylesList, dummyCRS, scaleDenominator );
if ( layerIds.size() < 1 )
if ( layerIds.isEmpty() )
{
return nullptr;
}
@@ -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" ) );
}
@@ -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" ) );

0 comments on commit fc63cbe

Please sign in to comment.
You can’t perform that action at this time.