Skip to content

Commit b6c76a0

Browse files
committed
[Server] Replaced unnecessary QStringLiteral by character
1 parent 05d9f92 commit b6c76a0

9 files changed

+62
-62
lines changed

src/server/services/wcs/qgswcsdescribecoverage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace QgsWcs
8787
QStringList coveNameList;
8888
if ( !coveNames.isEmpty() )
8989
{
90-
coveNameList = coveNames.split( QStringLiteral( "," ) );
90+
coveNameList = coveNames.split( ',' );
9191
for ( int i = 0; i < coveNameList.size(); ++i )
9292
{
9393
coveNameList.replace( i, coveNameList.at( i ).trimmed() );
@@ -111,7 +111,7 @@ namespace QgsWcs
111111
QString name = layer->name();
112112
if ( !layer->shortName().isEmpty() )
113113
name = layer->shortName();
114-
name = name.replace( QLatin1String( " " ), QLatin1String( "_" ) );
114+
name = name.replace( ' ', '_' );
115115

116116
if ( coveNameList.size() == 0 || coveNameList.contains( name ) )
117117
{

src/server/services/wcs/qgswcsutils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace QgsWcs
4545
QString name = layer->name();
4646
if ( !layer->shortName().isEmpty() )
4747
name = layer->shortName();
48-
name = name.replace( QLatin1String( " " ), QLatin1String( "_" ) );
48+
name = name.replace( ' ', '_' );
4949
QDomText nameText = doc.createTextNode( name );
5050
nameElem.appendChild( nameText );
5151
layerElem.appendChild( nameElem );
@@ -260,15 +260,15 @@ namespace QgsWcs
260260

261261
QgsRectangle parseBbox( const QString &bboxStr )
262262
{
263-
QStringList lst = bboxStr.split( QStringLiteral( "," ) );
263+
QStringList lst = bboxStr.split( ',' );
264264
if ( lst.count() != 4 )
265265
return QgsRectangle();
266266

267267
double d[4];
268268
bool ok;
269269
for ( int i = 0; i < 4; i++ )
270270
{
271-
lst[i].replace( QLatin1String( " " ), QLatin1String( "+" ) );
271+
lst[i].replace( ' ', '+' );
272272
d[i] = lst[i].toDouble( &ok );
273273
if ( !ok )
274274
return QgsRectangle();

src/server/services/wfs/qgswfsdescribefeaturetype.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ namespace QgsWfs
9090
if ( docChildElem.tagName() == QLatin1String( "TypeName" ) )
9191
{
9292
QString typeName = docChildElem.text().trimmed();
93-
if ( typeName.contains( QLatin1String( ":" ) ) )
94-
typeNameList << typeName.section( QStringLiteral( ":" ), 1, 1 );
93+
if ( typeName.contains( ':' ) )
94+
typeNameList << typeName.section( ':', 1, 1 );
9595
else
9696
typeNameList << typeName;
9797
}
@@ -103,12 +103,12 @@ namespace QgsWfs
103103
QString typeNames = request.parameter( QStringLiteral( "TYPENAME" ) );
104104
if ( !typeNames.isEmpty() )
105105
{
106-
QStringList typeNameSplit = typeNames.split( QStringLiteral( "," ) );
106+
QStringList typeNameSplit = typeNames.split( ',' );
107107
for ( int i = 0; i < typeNameSplit.size(); ++i )
108108
{
109109
QString typeName = typeNameSplit.at( i ).trimmed();
110-
if ( typeName.contains( QLatin1String( ":" ) ) )
111-
typeNameList << typeName.section( QStringLiteral( ":" ), 1, 1 );
110+
if ( typeName.contains( ':' ) )
111+
typeNameList << typeName.section( ':', 1, 1 );
112112
else
113113
typeNameList << typeName;
114114
}
@@ -127,7 +127,7 @@ namespace QgsWfs
127127
QString name = layer->name();
128128
if ( !layer->shortName().isEmpty() )
129129
name = layer->shortName();
130-
name = name.replace( QLatin1String( " " ), QLatin1String( "_" ) );
130+
name = name.replace( ' ', '_' );
131131

132132
if ( !typeNameList.isEmpty() && !typeNameList.contains( name ) )
133133
{
@@ -168,7 +168,7 @@ namespace QgsWfs
168168
QString typeName = layer->name();
169169
if ( !layer->shortName().isEmpty() )
170170
typeName = layer->shortName();
171-
typeName = typeName.replace( QLatin1String( " " ), QLatin1String( "_" ) );
171+
typeName = typeName.replace( ' ', '_' );
172172

173173
//xsd:element
174174
QDomElement elementElem = doc.createElement( QStringLiteral( "element" )/*xsd:element*/ );

src/server/services/wfs/qgswfsgetfeature.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ namespace QgsWfs
121121
QString name = layer->name();
122122
if ( !layer->shortName().isEmpty() )
123123
name = layer->shortName();
124-
name = name.replace( QLatin1String( " " ), QLatin1String( "_" ) );
124+
name = name.replace( ' ', '_' );
125125

126126
if ( typeNameList.contains( name ) )
127127
{
@@ -387,7 +387,7 @@ namespace QgsWfs
387387
// parse FEATUREID
388388
if ( parameters.contains( QStringLiteral( "FEATUREID" ) ) )
389389
{
390-
QStringList fidList = parameters.value( QStringLiteral( "FEATUREID" ) ).split( QStringLiteral( "," ) );
390+
QStringList fidList = parameters.value( QStringLiteral( "FEATUREID" ) ).split( ',' );
391391
// Verifying the 1:1 mapping between FEATUREID and PROPERTYNAME
392392
if ( !propertyNameList.isEmpty() && propertyNameList.size() != fidList.size() )
393393
{
@@ -417,13 +417,13 @@ namespace QgsWfs
417417
propertyName = *propertyNameIt;
418418
}
419419
// testing typename in the WFS featureID
420-
if ( !fid.contains( QLatin1String( "." ) ) )
420+
if ( !fid.contains( '.' ) )
421421
{
422422
throw QgsRequestNotWellFormedException( QStringLiteral( "FEATUREID has to have TYPENAME in the values" ) );
423423
}
424424

425-
QString typeName = fid.section( QStringLiteral( "." ), 0, 0 );
426-
fid = fid.section( QStringLiteral( "." ), 1, 1 );
425+
QString typeName = fid.section( '.', 0, 0 );
426+
fid = fid.section( '.', 1, 1 );
427427
if ( !typeNameList.contains( typeName ) )
428428
{
429429
typeNameList << typeName;
@@ -467,23 +467,23 @@ namespace QgsWfs
467467
{
468468
QStringList propertyList;
469469

470-
QStringList attrList = propertyName.split( QStringLiteral( "," ) );
470+
QStringList attrList = propertyName.split( ',' );
471471
QStringList::const_iterator alstIt;
472472
for ( alstIt = attrList.begin(); alstIt != attrList.end(); ++alstIt )
473473
{
474474
QString fieldName = *alstIt;
475475
fieldName = fieldName.trimmed();
476-
if ( fieldName.contains( QLatin1String( ":" ) ) )
476+
if ( fieldName.contains( ':' ) )
477477
{
478-
fieldName = fieldName.section( QStringLiteral( ":" ), 1, 1 );
478+
fieldName = fieldName.section( ':', 1, 1 );
479479
}
480-
if ( fieldName.contains( QLatin1String( "/" ) ) )
480+
if ( fieldName.contains( '/' ) )
481481
{
482-
if ( fieldName.section( QStringLiteral( "/" ), 0, 0 ) != typeName )
482+
if ( fieldName.section( '/', 0, 0 ) != typeName )
483483
{
484484
throw QgsRequestNotWellFormedException( QStringLiteral( "PropertyName text '%1' has to contain TypeName '%2'" ).arg( fieldName ).arg( typeName ) );
485485
}
486-
fieldName = fieldName.section( QStringLiteral( "/" ), 1, 1 );
486+
fieldName = fieldName.section( '/', 1, 1 );
487487
}
488488
propertyList.append( fieldName );
489489
}
@@ -513,7 +513,7 @@ namespace QgsWfs
513513
throw QgsRequestNotWellFormedException( QStringLiteral( "TYPENAME is mandatory except if FEATUREID is used" ) );
514514
}
515515

516-
typeNameList = parameters.value( QStringLiteral( "TYPENAME" ) ).split( QStringLiteral( "," ) );
516+
typeNameList = parameters.value( QStringLiteral( "TYPENAME" ) ).split( ',' );
517517
// Verifying the 1:1 mapping between TYPENAME and PROPERTYNAME
518518
if ( !propertyNameList.isEmpty() && typeNameList.size() != propertyNameList.size() )
519519
{
@@ -549,23 +549,23 @@ namespace QgsWfs
549549
{
550550
QStringList propertyList;
551551

552-
QStringList attrList = propertyName.split( QStringLiteral( "," ) );
552+
QStringList attrList = propertyName.split( ',' );
553553
QStringList::const_iterator alstIt;
554554
for ( alstIt = attrList.begin(); alstIt != attrList.end(); ++alstIt )
555555
{
556556
QString fieldName = *alstIt;
557557
fieldName = fieldName.trimmed();
558-
if ( fieldName.contains( QLatin1String( ":" ) ) )
558+
if ( fieldName.contains( ':' ) )
559559
{
560-
fieldName = fieldName.section( QStringLiteral( ":" ), 1, 1 );
560+
fieldName = fieldName.section( ':', 1, 1 );
561561
}
562-
if ( fieldName.contains( QLatin1String( "/" ) ) )
562+
if ( fieldName.contains( '/' ) )
563563
{
564-
if ( fieldName.section( QStringLiteral( "/" ), 0, 0 ) != typeName )
564+
if ( fieldName.section( '/', 0, 0 ) != typeName )
565565
{
566566
throw QgsRequestNotWellFormedException( QStringLiteral( "PropertyName text '%1' has to contain TypeName '%2'" ).arg( fieldName ).arg( typeName ) );
567567
}
568-
fieldName = fieldName.section( QStringLiteral( "/" ), 1, 1 );
568+
fieldName = fieldName.section( '/', 1, 1 );
569569
}
570570
propertyList.append( fieldName );
571571
}
@@ -660,7 +660,7 @@ namespace QgsWfs
660660
bool ok;
661661
for ( int i = 0; i < 4; i++ )
662662
{
663-
corners[i].replace( QLatin1String( " " ), QLatin1String( "+" ) );
663+
corners[i].replace( ' ', '+' );
664664
d[i] = corners[i].toDouble( &ok );
665665
if ( !ok )
666666
{
@@ -769,9 +769,9 @@ namespace QgsWfs
769769
getFeatureQuery parseQueryElement( QDomElement &queryElem )
770770
{
771771
QString typeName = queryElem.attribute( QStringLiteral( "typeName" ), QLatin1String( "" ) );
772-
if ( typeName.contains( QLatin1String( ":" ) ) )
772+
if ( typeName.contains( ':' ) )
773773
{
774-
typeName = typeName.section( QStringLiteral( ":" ), 1, 1 );
774+
typeName = typeName.section( ':', 1, 1 );
775775
}
776776

777777
QgsFeatureRequest featureRequest;
@@ -785,17 +785,17 @@ namespace QgsWfs
785785
if ( queryChildElem.tagName() == QLatin1String( "PropertyName" ) )
786786
{
787787
QString fieldName = queryChildElem.text().trimmed();
788-
if ( fieldName.contains( QLatin1String( ":" ) ) )
788+
if ( fieldName.contains( ':' ) )
789789
{
790-
fieldName = fieldName.section( QStringLiteral( ":" ), 1, 1 );
790+
fieldName = fieldName.section( ':', 1, 1 );
791791
}
792-
if ( fieldName.contains( QLatin1String( "/" ) ) )
792+
if ( fieldName.contains( '/' ) )
793793
{
794-
if ( fieldName.section( QStringLiteral( "/" ), 0, 0 ) != typeName )
794+
if ( fieldName.section( '/', 0, 0 ) != typeName )
795795
{
796796
throw QgsRequestNotWellFormedException( QStringLiteral( "PropertyName text '%1' has to contain TypeName '%2'" ).arg( fieldName ).arg( typeName ) );
797797
}
798-
fieldName = fieldName.section( QStringLiteral( "/" ), 1, 1 );
798+
fieldName = fieldName.section( '/', 1, 1 );
799799
}
800800
propertyList.append( fieldName );
801801
}
@@ -878,7 +878,7 @@ namespace QgsWfs
878878
query.removeAllQueryItems( QStringLiteral( "_DC" ) );
879879

880880
query.addQueryItem( QStringLiteral( "REQUEST" ), QStringLiteral( "DescribeFeatureType" ) );
881-
query.addQueryItem( QStringLiteral( "TYPENAME" ), typeNames.join( QStringLiteral( "," ) ) );
881+
query.addQueryItem( QStringLiteral( "TYPENAME" ), typeNames.join( ',' ) );
882882
query.addQueryItem( QStringLiteral( "OUTPUTFORMAT" ), QStringLiteral( "XMLSCHEMA" ) );
883883

884884
mapUrl.setQuery( query );

src/server/services/wfs/qgswfstransaction.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ namespace QgsWfs
243243
QString name = layer->name();
244244
if ( !layer->shortName().isEmpty() )
245245
name = layer->shortName();
246-
name = name.replace( QLatin1String( " " ), QLatin1String( "_" ) );
246+
name = name.replace( ' ', '_' );
247247

248248
if ( !typeNameList.contains( name ) )
249249
{
@@ -779,7 +779,7 @@ namespace QgsWfs
779779
// parse FEATUREID
780780
if ( parameters.contains( QStringLiteral( "FEATUREID" ) ) )
781781
{
782-
QStringList fidList = parameters.value( QStringLiteral( "FEATUREID" ) ).split( QStringLiteral( "," ) );
782+
QStringList fidList = parameters.value( QStringLiteral( "FEATUREID" ) ).split( ',' );
783783

784784
QMap<QString, QgsFeatureIds> fidsMap;
785785

@@ -790,13 +790,13 @@ namespace QgsWfs
790790
QString fid = *fidIt;
791791
fid = fid.trimmed();
792792
// testing typename in the WFS featureID
793-
if ( !fid.contains( QLatin1String( "." ) ) )
793+
if ( !fid.contains( '.' ) )
794794
{
795795
throw QgsRequestNotWellFormedException( QStringLiteral( "FEATUREID has to have TYPENAME in the values" ) );
796796
}
797797

798-
QString typeName = fid.section( QStringLiteral( "." ), 0, 0 );
799-
fid = fid.section( QStringLiteral( "." ), 1, 1 );
798+
QString typeName = fid.section( '.', 0, 0 );
799+
fid = fid.section( '.', 1, 1 );
800800
if ( !typeNameList.contains( typeName ) )
801801
{
802802
typeNameList << typeName;
@@ -830,7 +830,7 @@ namespace QgsWfs
830830
throw QgsRequestNotWellFormedException( QStringLiteral( "TYPENAME is mandatory except if FEATUREID is used" ) );
831831
}
832832

833-
typeNameList = parameters.value( QStringLiteral( "TYPENAME" ) ).split( QStringLiteral( "," ) );
833+
typeNameList = parameters.value( QStringLiteral( "TYPENAME" ) ).split( ',' );
834834

835835
// Create actions based on TypeName
836836
QStringList::const_iterator typeNameIt = typeNameList.constBegin();
@@ -925,7 +925,7 @@ namespace QgsWfs
925925
bool ok;
926926
for ( int i = 0; i < 4; i++ )
927927
{
928-
corners[i].replace( QLatin1String( " " ), QLatin1String( "+" ) );
928+
corners[i].replace( ' ', '+' );
929929
d[i] = corners[i].toDouble( &ok );
930930
if ( !ok )
931931
{
@@ -1038,8 +1038,8 @@ namespace QgsWfs
10381038
transactionDelete parseDeleteActionElement( QDomElement &actionElem )
10391039
{
10401040
QString typeName = actionElem.attribute( QStringLiteral( "typeName" ) );
1041-
if ( typeName.contains( QLatin1String( ":" ) ) )
1042-
typeName = typeName.section( QStringLiteral( ":" ), 1, 1 );
1041+
if ( typeName.contains( ':' ) )
1042+
typeName = typeName.section( ':', 1, 1 );
10431043

10441044
QDomElement filterElem = actionElem.firstChild().toElement();
10451045
if ( filterElem.tagName() != QLatin1String( "Filter" ) )
@@ -1065,8 +1065,8 @@ namespace QgsWfs
10651065
transactionUpdate parseUpdateActionElement( QDomElement &actionElem )
10661066
{
10671067
QString typeName = actionElem.attribute( QStringLiteral( "typeName" ) );
1068-
if ( typeName.contains( QLatin1String( ":" ) ) )
1069-
typeName = typeName.section( QStringLiteral( ":" ), 1, 1 );
1068+
if ( typeName.contains( ':' ) )
1069+
typeName = typeName.section( ':', 1, 1 );
10701070

10711071
QDomNodeList propertyNodeList = actionElem.elementsByTagName( QStringLiteral( "Property" ) );
10721072
if ( propertyNodeList.size() != 1 )
@@ -1130,8 +1130,8 @@ namespace QgsWfs
11301130
for ( int i = 0; i < featureNodeList.count(); ++i )
11311131
{
11321132
QString tempTypeName = featureNodeList.at( i ).toElement().localName();
1133-
if ( tempTypeName.contains( QLatin1String( ":" ) ) )
1134-
tempTypeName = tempTypeName.section( QStringLiteral( ":" ), 1, 1 );
1133+
if ( tempTypeName.contains( ':' ) )
1134+
tempTypeName = tempTypeName.section( ':', 1, 1 );
11351135

11361136
if ( typeName.isEmpty() )
11371137
{

src/server/services/wms/qgswmsdescribelayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace QgsWms
5858
QStringLiteral( "LAYERS is mandatory for DescribeLayer operation" ), 400 );
5959
}
6060

61-
QStringList layersList = parameters[ QStringLiteral( "LAYERS" )].split( QStringLiteral( "," ), QString::SkipEmptyParts );
61+
QStringList layersList = parameters[ QStringLiteral( "LAYERS" )].split( ',', QString::SkipEmptyParts );
6262
if ( layersList.size() < 1 )
6363
{
6464
throw QgsServiceException( QStringLiteral( "InvalidParameterValue" ), QStringLiteral( "Layers is empty" ), 400 );

src/server/services/wms/qgswmsgetcapabilities.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ namespace QgsWms
947947
//keyword list
948948
if ( !l->keywordList().isEmpty() )
949949
{
950-
QStringList keywordStringList = l->keywordList().split( QStringLiteral( "," ) );
950+
QStringList keywordStringList = l->keywordList().split( ',' );
951951

952952
QDomElement keywordListElem = doc.createElement( QStringLiteral( "KeywordList" ) );
953953
for ( int i = 0; i < keywordStringList.size(); ++i )
@@ -1619,7 +1619,7 @@ namespace QgsWms
16191619
reversedList << layerList[ i ];
16201620

16211621
QDomElement layerDrawingOrderElem = doc.createElement( QStringLiteral( "LayerDrawingOrder" ) );
1622-
QDomText drawingOrderText = doc.createTextNode( reversedList.join( QStringLiteral( "," ) ) );
1622+
QDomText drawingOrderText = doc.createTextNode( reversedList.join( ',' ) );
16231623
layerDrawingOrderElem.appendChild( drawingOrderText );
16241624
parentElem.appendChild( layerDrawingOrderElem );
16251625
}

src/server/services/wms/qgswmsgetcontext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ namespace QgsWms
356356
//keyword list
357357
if ( !l->keywordList().isEmpty() )
358358
{
359-
QStringList keywordStringList = l->keywordList().split( QStringLiteral( "," ) );
359+
QStringList keywordStringList = l->keywordList().split( ',' );
360360
bool sia2045 = QgsServerProjectUtils::wmsInfoFormatSia2045( *project );
361361

362362
QDomElement keywordsElem = doc.createElement( QStringLiteral( "ows:Keywords" ) );

0 commit comments

Comments
 (0)