Skip to content

Commit 026b9b0

Browse files
committedSep 19, 2017
[Server] WMS Parameters: const QStringList &l
1 parent 9ee829b commit 026b9b0

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed
 

‎src/server/services/wms/qgswmsparameters.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -927,12 +927,12 @@ namespace QgsWms
927927
return value( name, mapId ).toString().split( delimiter, QString::SkipEmptyParts );
928928
}
929929

930-
QList<int> QgsWmsParameters::toIntList( QStringList l, bool *error ) const
930+
QList<int> QgsWmsParameters::toIntList( const QStringList &l, bool *error ) const
931931
{
932932
*error = false;
933933
QList<int> elements;
934934

935-
Q_FOREACH ( QString element, l )
935+
for ( const QString &element : l )
936936
{
937937
bool ok;
938938
int e = element.toInt( &ok );
@@ -951,7 +951,7 @@ namespace QgsWms
951951
return elements;
952952
}
953953

954-
QList<int> QgsWmsParameters::toIntList( QStringList l, ParameterName p ) const
954+
QList<int> QgsWmsParameters::toIntList( const QStringList &l, ParameterName p ) const
955955
{
956956
bool error;
957957
QList<int> elements = toIntList( l, &error );
@@ -966,7 +966,7 @@ namespace QgsWms
966966
return elements;
967967
}
968968

969-
QList<int> QgsWmsParameters::toIntList( QStringList l, ParameterName p, int mapId ) const
969+
QList<int> QgsWmsParameters::toIntList( const QStringList &l, ParameterName p, int mapId ) const
970970
{
971971
bool error;
972972
QList<int> elements = toIntList( l, &error );
@@ -981,12 +981,12 @@ namespace QgsWms
981981
return elements;
982982
}
983983

984-
QList<float> QgsWmsParameters::toFloatList( QStringList l, bool *error ) const
984+
QList<float> QgsWmsParameters::toFloatList( const QStringList &l, bool *error ) const
985985
{
986986
*error = false;
987987
QList<float> elements;
988988

989-
Q_FOREACH ( QString element, l )
989+
for ( const QString &element : l )
990990
{
991991
bool ok;
992992
float e = element.toFloat( &ok );
@@ -1005,7 +1005,7 @@ namespace QgsWms
10051005
return elements;
10061006
}
10071007

1008-
QList<float> QgsWmsParameters::toFloatList( QStringList l, ParameterName p ) const
1008+
QList<float> QgsWmsParameters::toFloatList( const QStringList &l, ParameterName p ) const
10091009
{
10101010
bool error;
10111011
QList<float> elements = toFloatList( l, &error );
@@ -1020,7 +1020,7 @@ namespace QgsWms
10201020
return elements;
10211021
}
10221022

1023-
QList<float> QgsWmsParameters::toFloatList( QStringList l, ParameterName p, int mapId ) const
1023+
QList<float> QgsWmsParameters::toFloatList( const QStringList &l, ParameterName p, int mapId ) const
10241024
{
10251025
bool error;
10261026
QList<float> elements = toFloatList( l, &error );
@@ -1035,12 +1035,12 @@ namespace QgsWms
10351035
return elements;
10361036
}
10371037

1038-
QList<QColor> QgsWmsParameters::toColorList( QStringList l, bool *error ) const
1038+
QList<QColor> QgsWmsParameters::toColorList( const QStringList &l, bool *error ) const
10391039
{
10401040
*error = false;
10411041
QList<QColor> elements;
10421042

1043-
Q_FOREACH ( QString element, l )
1043+
for ( const QString &element : l )
10441044
{
10451045
QColor c = QColor( element );
10461046

@@ -1058,7 +1058,7 @@ namespace QgsWms
10581058
return elements;
10591059
}
10601060

1061-
QList<QColor> QgsWmsParameters::toColorList( QStringList l, ParameterName p ) const
1061+
QList<QColor> QgsWmsParameters::toColorList( const QStringList &l, ParameterName p ) const
10621062
{
10631063
bool error;
10641064
QList<QColor> elements = toColorList( l, &error );
@@ -1073,7 +1073,7 @@ namespace QgsWms
10731073
return elements;
10741074
}
10751075

1076-
QList<QColor> QgsWmsParameters::toColorList( QStringList l, ParameterName p, int mapId ) const
1076+
QList<QColor> QgsWmsParameters::toColorList( const QStringList &l, ParameterName p, int mapId ) const
10771077
{
10781078
bool error;
10791079
QList<QColor> elements = toColorList( l, &error );
@@ -1088,12 +1088,12 @@ namespace QgsWms
10881088
return elements;
10891089
}
10901090

1091-
QList<QgsGeometry> QgsWmsParameters::toGeomList( QStringList l, bool *error ) const
1091+
QList<QgsGeometry> QgsWmsParameters::toGeomList( const QStringList &l, bool *error ) const
10921092
{
10931093
*error = false;
10941094
QList<QgsGeometry> geometries;
10951095

1096-
Q_FOREACH ( QString wkt, l )
1096+
for ( const QString &wkt : l )
10971097
{
10981098
QgsGeometry g( QgsGeometry::fromWkt( wkt ) );
10991099

@@ -1111,7 +1111,7 @@ namespace QgsWms
11111111
return geometries;
11121112
}
11131113

1114-
QList<QgsGeometry> QgsWmsParameters::toGeomList( QStringList l, ParameterName p ) const
1114+
QList<QgsGeometry> QgsWmsParameters::toGeomList( const QStringList &l, ParameterName p ) const
11151115
{
11161116
bool error;
11171117
QList<QgsGeometry> elements = toGeomList( l, &error );
@@ -1126,7 +1126,7 @@ namespace QgsWms
11261126
return elements;
11271127
}
11281128

1129-
QList<QgsGeometry> QgsWmsParameters::toGeomList( QStringList l, ParameterName p, int mapId ) const
1129+
QList<QgsGeometry> QgsWmsParameters::toGeomList( const QStringList &l, ParameterName p, int mapId ) const
11301130
{
11311131
bool error;
11321132
QList<QgsGeometry> elements = toGeomList( l, &error );

‎src/server/services/wms/qgswmsparameters.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -830,18 +830,18 @@ namespace QgsWms
830830
QgsRectangle toRectangle( ParameterName name, int mapId ) const;
831831
QStringList toStringList( ParameterName name, char delimiter = ',' ) const;
832832
QStringList toStringList( ParameterName name, int mapId, char delimiter = ',' ) const;
833-
QList<int> toIntList( QStringList l, bool *error = Q_NULLPTR ) const;
834-
QList<int> toIntList( QStringList l, ParameterName name ) const;
835-
QList<int> toIntList( QStringList l, ParameterName name, int mapId ) const;
836-
QList<float> toFloatList( QStringList l, bool *error = Q_NULLPTR ) const;
837-
QList<float> toFloatList( QStringList l, ParameterName name ) const;
838-
QList<float> toFloatList( QStringList l, ParameterName name, int mapId ) const;
839-
QList<QColor> toColorList( QStringList l, bool *error = Q_NULLPTR ) const;
840-
QList<QColor> toColorList( QStringList l, ParameterName name ) const;
841-
QList<QColor> toColorList( QStringList l, ParameterName name, int mapId ) const;
842-
QList<QgsGeometry> toGeomList( QStringList l, bool *error = Q_NULLPTR ) const;
843-
QList<QgsGeometry> toGeomList( QStringList l, ParameterName name ) const;
844-
QList<QgsGeometry> toGeomList( QStringList l, ParameterName name, int mapId ) const;
833+
QList<int> toIntList( const QStringList &l, bool *error = Q_NULLPTR ) const;
834+
QList<int> toIntList( const QStringList &l, ParameterName name ) const;
835+
QList<int> toIntList( const QStringList &l, ParameterName name, int mapId ) const;
836+
QList<float> toFloatList( const QStringList &l, bool *error = Q_NULLPTR ) const;
837+
QList<float> toFloatList( const QStringList &l, ParameterName name ) const;
838+
QList<float> toFloatList( const QStringList &l, ParameterName name, int mapId ) const;
839+
QList<QColor> toColorList( const QStringList &l, bool *error = Q_NULLPTR ) const;
840+
QList<QColor> toColorList( const QStringList &l, ParameterName name ) const;
841+
QList<QColor> toColorList( const QStringList &l, ParameterName name, int mapId ) const;
842+
QList<QgsGeometry> toGeomList( const QStringList &l, bool *error = Q_NULLPTR ) const;
843+
QList<QgsGeometry> toGeomList( const QStringList &l, ParameterName name ) const;
844+
QList<QgsGeometry> toGeomList( const QStringList &l, ParameterName name, int mapId ) const;
845845

846846
QgsServerRequest::Parameters mRequestParameters;
847847
QMap<ParameterName, Parameter> mParameters;

0 commit comments

Comments
 (0)
Please sign in to comment.