Skip to content

Commit f841681

Browse files
committedJan 28, 2019
Some cleaning
1 parent 8db9ab1 commit f841681

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed
 

‎src/core/qgsjsonutils.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ QString QgsJsonExporter::exportFeatures( const QgsFeatureList &features ) const
239239

240240
QString layerName;
241241
if ( mIncludeName )
242-
layerName.append( QStringLiteral( "\n \"name\": \"%1\",\n" ).arg( mLayer->name() ) );
242+
layerName = QStringLiteral( "\n \"name\": \"%1\",\n" ).arg( mLayer->name() );
243243

244244
return QStringLiteral( "{%1 \"type\": \"FeatureCollection\",\n \"features\":[\n%2\n]}" ).arg( layerName, featureJSON.join( QStringLiteral( ",\n" ) ) );
245245
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,8 +2281,7 @@ namespace QgsWms
22812281
QByteArray QgsRenderer::convertFeatureInfoToJson( const QList<QgsMapLayer *> &layers, const QDomDocument &doc ) const
22822282
{
22832283
QString json;
2284-
json.append( QStringLiteral( "{" ) );
2285-
json.append( QStringLiteral( "\"layers\":[" ) );
2284+
json.append( QStringLiteral( "{\n\"layers\":[" ) );
22862285

22872286
const bool withGeometry = ( QgsServerProjectUtils::wmsFeatureInfoAddWktGeometry( *mProject ) && mWmsParameters.withGeometry() );
22882287

@@ -2318,7 +2317,7 @@ namespace QgsWms
23182317
for ( int j = 0; j < featuresNode.size(); ++j )
23192318
{
23202319
const QDomElement featureNode = featuresNode.at( j ).toElement();
2321-
const qint64 fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
2320+
const QgsFeatureId fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
23222321
const QgsFeature feature = vl->getFeature( fid );
23232322
features << feature;
23242323

0 commit comments

Comments
 (0)
Please sign in to comment.