Skip to content

Commit

Permalink
Avoid a bunch of useless string parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 14, 2020
1 parent c35d8e5 commit 9924b15
Show file tree
Hide file tree
Showing 33 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion external/libdxfrw/drw_objects.cpp
Expand Up @@ -583,7 +583,7 @@ bool DRW_LType::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
QStringList l;
for ( unsigned i = 0; i < path.size() ; i++ )
{
l << QStringLiteral( "%1" ).arg( path[i] );
l << QString::number( path[i] );
}
QgsDebugMsg( QString( "path=%1 rem:%2" ).arg( l.join( " " ) ).arg( buf->numRemainingBytes() ) );

Expand Down
2 changes: 1 addition & 1 deletion src/3d/materials/qgsphongmaterialsettings.cpp
Expand Up @@ -110,7 +110,7 @@ QMap<QString, QString> QgsPhongMaterialSettings::toExportParameters() const
parameters[ QStringLiteral( "Kd" ) ] = QStringLiteral( "%1 %2 %3" ).arg( mDiffuse.redF() ).arg( mDiffuse.greenF() ).arg( mDiffuse.blueF() );
parameters[ QStringLiteral( "Ka" ) ] = QStringLiteral( "%1 %2 %3" ).arg( mAmbient.redF() ).arg( mAmbient.greenF() ).arg( mAmbient.blueF() );
parameters[ QStringLiteral( "Ks" ) ] = QStringLiteral( "%1 %2 %3" ).arg( mSpecular.redF() ).arg( mSpecular.greenF() ).arg( mSpecular.blueF() );
parameters[ QStringLiteral( "Ns" ) ] = QStringLiteral( "%1" ).arg( mShininess );
parameters[ QStringLiteral( "Ns" ) ] = QString::number( mShininess );
return parameters;
}

Expand Down
2 changes: 1 addition & 1 deletion src/3d/materials/qgsphongtexturedmaterialsettings.cpp
Expand Up @@ -173,7 +173,7 @@ QMap<QString, QString> QgsPhongTexturedMaterialSettings::toExportParameters() co
QMap<QString, QString> parameters;
parameters[ QStringLiteral( "Ka" ) ] = QStringLiteral( "%1 %2 %3" ).arg( mAmbient.redF() ).arg( mAmbient.greenF() ).arg( mAmbient.blueF() );
parameters[ QStringLiteral( "Ks" ) ] = QStringLiteral( "%1 %2 %3" ).arg( mSpecular.redF() ).arg( mSpecular.greenF() ).arg( mSpecular.blueF() );
parameters[ QStringLiteral( "Ns" ) ] = QStringLiteral( "%1" ).arg( mShininess );
parameters[ QStringLiteral( "Ns" ) ] = QString::number( mShininess );
return parameters;
}

Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgs3dexportobject.cpp
Expand Up @@ -149,7 +149,7 @@ void Qgs3DExportObject::saveTo( QTextStream &out, float scale, const QVector3D &
return QStringLiteral( "%1/%2" ).arg( negativeIndex ).arg( negativeIndex );
if ( hasNormals && hasTextures )
return QStringLiteral( "%1/%2/%3" ).arg( negativeIndex ).arg( negativeIndex ).arg( negativeIndex );
return QStringLiteral( "%1" ).arg( negativeIndex );
return QString::number( negativeIndex );
};

if ( mType == TriangularFaces )
Expand Down
2 changes: 1 addition & 1 deletion src/app/decorations/qgsdecorationtitledialog.cpp
Expand Up @@ -52,7 +52,7 @@ QgsDecorationTitleDialog::QgsDecorationTitleDialog( QgsDecorationTitle &deco, QW
txtTitleText->setAcceptRichText( false );
if ( !mDeco.enabled() && mDeco.mLabelText.isEmpty() )
{
QString defaultString = QStringLiteral( "%1" ).arg( QgsProject::instance()->metadata().title() );
QString defaultString = QgsProject::instance()->metadata().title();
txtTitleText->setPlainText( defaultString );
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgscustomization.cpp
Expand Up @@ -723,7 +723,7 @@ void QgsCustomization::createTreeItemBrowser()
if ( capabilities != QgsDataProvider::NoDataCapabilities )
{
QStringList item;
item << QStringLiteral( "%1" ).arg( pr->name() ) << QObject::tr( "Data Item Provider: %1" ).arg( pr->name() );
item << pr->name() << QObject::tr( "Data Item Provider: %1" ).arg( pr->name() );
items << item;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptooloffsetcurve.cpp
Expand Up @@ -532,7 +532,7 @@ void QgsMapToolOffsetCurve::prepareGeometry( const QgsPointLocator::Match &match
int vertex = match.vertexIndex();
QgsVertexId vertexId;
geom.vertexIdFromVertexNr( vertex, vertexId );
QgsDebugMsg( QStringLiteral( "%1" ).arg( vertexId.ring ) );
QgsDebugMsgLevel( QString::number( vertexId.ring ), 2 );

if ( !geom.isMultipart() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/classification/qgsclassificationlogarithmic.cpp
Expand Up @@ -111,7 +111,7 @@ QString QgsClassificationLogarithmic::valueToLabel( double value ) const
{
if ( value <= 0 )
{
return QString( QStringLiteral( "%1" ) ).arg( value );
return QString::number( value );
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions src/core/dxf/qgsdxfexport.cpp
Expand Up @@ -298,7 +298,7 @@ int QgsDxfExport::writeHandle( int code, int handle )

Q_ASSERT_X( handle < DXF_HANDMAX, "QgsDxfExport::writeHandle(int, int)", "DXF handle too large" );

writeGroup( code, QStringLiteral( "%1" ).arg( handle, 0, 16 ) );
writeGroup( code, QString::number( handle, 16 ) );
return handle;
}

Expand Down Expand Up @@ -551,7 +551,7 @@ void QgsDxfExport::writeBlocks()
{
writeGroup( 0, QStringLiteral( "BLOCK" ) );
writeHandle();
writeGroup( 330, QStringLiteral( "%1" ).arg( mBlockHandles[ block ], 0, 16 ) );
writeGroup( 330, QString::number( mBlockHandles[ block ], 16 ) );
writeGroup( 100, QStringLiteral( "AcDbEntity" ) );
writeGroup( 8, QStringLiteral( "0" ) );
writeGroup( 100, QStringLiteral( "AcDbBlockBegin" ) );
Expand Down Expand Up @@ -592,7 +592,7 @@ void QgsDxfExport::writeBlocks()
}

QString block( QStringLiteral( "symbolLayer%1" ).arg( mBlockCounter++ ) );
mBlockHandle = QStringLiteral( "%1" ).arg( mBlockHandles[ block ], 0, 16 );
mBlockHandle = QString::number( mBlockHandles[ block ], 16 );

writeGroup( 0, QStringLiteral( "BLOCK" ) );
writeHandle();
Expand Down Expand Up @@ -631,7 +631,7 @@ void QgsDxfExport::writeEntities()
startSection();
writeGroup( 2, QStringLiteral( "ENTITIES" ) );

mBlockHandle = QStringLiteral( "%1" ).arg( mBlockHandles[ QStringLiteral( "*Model_Space" )], 0, 16 );
mBlockHandle = QString::number( mBlockHandles[ QStringLiteral( "*Model_Space" )], 16 );

// iterate through the maplayers
for ( DxfLayerJob *job : qgis::as_const( mJobs ) )
Expand Down
6 changes: 3 additions & 3 deletions src/core/mesh/qgsmeshlayerutils.cpp
Expand Up @@ -545,16 +545,16 @@ QString QgsMeshLayerUtils::formatTime( double hours, const QDateTime &referenceT
else if ( format == QStringLiteral( "d" ) )
{
int d = totalHours / 24;
ret = QStringLiteral( "%1" ).arg( d );
ret = QString::number( d );
}
else if ( format == QStringLiteral( "ss" ) )
{
int seconds = static_cast<int>( hours * 3600.0 );
ret = QStringLiteral( "%1" ).arg( seconds );
ret = QString::number( seconds );
}
else // "hh"
{
ret = QStringLiteral( "%1" ).arg( hours );
ret = QString::number( hours );
}
}
return ret;
Expand Down
2 changes: 1 addition & 1 deletion src/core/mesh/qgsmeshrenderersettings.cpp
Expand Up @@ -446,7 +446,7 @@ QDomElement QgsMeshRendererSettings::writeXml( QDomDocument &doc ) const
if ( mAveragingMethod )
{
QDomElement elemAveraging = doc.createElement( QStringLiteral( "averaging-3d" ) );
elemAveraging.setAttribute( QStringLiteral( "method" ), QStringLiteral( "%1" ).arg( mAveragingMethod->method() ) ) ;
elemAveraging.setAttribute( QStringLiteral( "method" ), QString::number( mAveragingMethod->method() ) ) ;
QDomElement elemAveragingParams = mAveragingMethod->writeXml( doc );
elemAveraging.appendChild( elemAveragingParams );
elem.appendChild( elemAveraging );
Expand Down
4 changes: 2 additions & 2 deletions src/core/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -6742,7 +6742,7 @@ int QgsOgrProviderMetadata::listStyles(
geometryColumn == QString::fromUtf8( OGR_L_GetGeometryColumn( hUserLayer ) ) )
{
// Append first all related styles
QString id( QStringLiteral( "%1" ).arg( fid ) );
QString id( QString::number( fid ) );
ids.append( id );
names.append( styleName );
descriptions.append( description );
Expand Down Expand Up @@ -6771,7 +6771,7 @@ int QgsOgrProviderMetadata::listStyles(
for ( int j = 0; j < listId.size(); j++ )
{
int fid = listId[j];
QString id( QStringLiteral( "%1" ).arg( fid ) );
QString id( QString::number( fid ) );
ids.append( id );
names.append( mapIdToStyleName[fid] );
descriptions.append( mapIdToDescription[fid] );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -2159,7 +2159,7 @@ bool QgsProject::writeProjectFile( const QString &filename )

QDomElement qgisNode = doc->createElement( QStringLiteral( "qgis" ) );
qgisNode.setAttribute( QStringLiteral( "projectname" ), title() );
qgisNode.setAttribute( QStringLiteral( "version" ), QStringLiteral( "%1" ).arg( Qgis::version() ) );
qgisNode.setAttribute( QStringLiteral( "version" ), Qgis::version() );

QgsSettings settings;
if ( !settings.value( QStringLiteral( "projects/anonymize_saved_projects" ), false, QgsSettings::Core ).toBool() )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgssqlexpressioncompiler.cpp
Expand Up @@ -397,7 +397,7 @@ QgsSqlExpressionCompiler::Result QgsSqlExpressionCompiler::compileNode( const Qg
args = sqlArgumentsFromFunctionName( fd->name(), args );

// build result
result = !nd.isEmpty() ? QStringLiteral( "%1(%2)" ).arg( nd, args.join( ',' ) ) : QStringLiteral( "%1" ).arg( args.join( ',' ) );
result = !nd.isEmpty() ? QStringLiteral( "%1(%2)" ).arg( nd, args.join( ',' ) ) : args.join( ',' );
return inResult == Partial ? Partial : Complete;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterchecker.cpp
Expand Up @@ -165,7 +165,7 @@ bool QgsRasterChecker::runTest( const QString &verifiedKey, QString verifiedUri,
QString valStr;
if ( compare( verifiedVal, expectedVal, 0 ) )
{
valStr = QStringLiteral( "%1" ).arg( verifiedVal );
valStr = QString::number( verifiedVal );
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterpipe.cpp
Expand Up @@ -164,7 +164,7 @@ bool QgsRasterPipe::set( QgsRasterInterface *interface )
{
if ( !interface ) return false;

QgsDebugMsgLevel( QStringLiteral( "%1" ).arg( typeid( *interface ).name() ), 4 );
QgsDebugMsgLevel( typeid( *interface ).name(), 4 );
Role role = interfaceRole( interface );

// We don't know where to place unknown interface
Expand Down
2 changes: 1 addition & 1 deletion src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp
Expand Up @@ -1518,7 +1518,7 @@ QVariant QgsProcessingRangeWidgetWrapper::widgetValue() const
if ( qgsDoubleNear( mMinSpinBox->value(), mMinSpinBox->minimum() ) )
value = QStringLiteral( "None" );
else
value = QStringLiteral( "%1" ).arg( mMinSpinBox->value() );
value = QString::number( mMinSpinBox->value() );

if ( qgsDoubleNear( mMaxSpinBox->value(), mMaxSpinBox->minimum() ) )
value += QStringLiteral( ",None" );
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsidentifymenu.cpp
Expand Up @@ -294,7 +294,7 @@ void QgsIdentifyMenu::addVectorLayer( QgsVectorLayer *layer, const QList<QgsMapT
// case 1
QString featureTitle = exp.evaluate( &context ).toString();
if ( featureTitle.isEmpty() )
featureTitle = QStringLiteral( "%1" ).arg( results[0].mFeature.id() );
featureTitle = QString::number( results[0].mFeature.id() );
layerAction = new QAction( QStringLiteral( "%1 (%2)" ).arg( layer->name(), featureTitle ), this );
}
else
Expand All @@ -316,7 +316,7 @@ void QgsIdentifyMenu::addVectorLayer( QgsVectorLayer *layer, const QList<QgsMapT
{
QString featureTitle = exp.evaluate( &context ).toString();
if ( featureTitle.isEmpty() )
featureTitle = QStringLiteral( "%1" ).arg( results[0].mFeature.id() );
featureTitle = QString::number( results[0].mFeature.id() );
layerMenu = new QMenu( QStringLiteral( "%1 (%2)" ).arg( layer->name(), featureTitle ), this );
}
layerAction = layerMenu->menuAction();
Expand Down Expand Up @@ -377,7 +377,7 @@ void QgsIdentifyMenu::addVectorLayer( QgsVectorLayer *layer, const QList<QgsMapT
context.setFeature( result.mFeature );
QString featureTitle = exp.evaluate( &context ).toString();
if ( featureTitle.isEmpty() )
featureTitle = QStringLiteral( "%1" ).arg( result.mFeature.id() );
featureTitle = QString::number( result.mFeature.id() );

if ( customFeatureActions.isEmpty() && ( !featureActionMenu || featureActionMenu->actions().isEmpty() ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology/qgsrulebasedrendererwidget.cpp
Expand Up @@ -479,7 +479,7 @@ void QgsRuleBasedRendererWidget::restoreSectionWidths()
void QgsRuleBasedRendererWidget::copy()
{
QModelIndexList indexlist = viewRules->selectionModel()->selectedRows();
QgsDebugMsg( QStringLiteral( "%1" ).arg( indexlist.count() ) );
QgsDebugMsgLevel( QString::number( indexlist.count() ), 2 );

if ( indexlist.isEmpty() )
return;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/vector/qgsattributesformproperties.cpp
Expand Up @@ -124,7 +124,7 @@ void QgsAttributesFormProperties::initAvailableWidgetsTree()

for ( const QgsRelation &relation : relations )
{
DnDTreeItemData itemData = DnDTreeItemData( DnDTreeItemData::Relation, QStringLiteral( "%1" ).arg( relation.id() ), QStringLiteral( "%1" ).arg( relation.name() ) );
DnDTreeItemData itemData = DnDTreeItemData( DnDTreeItemData::Relation, relation.id(), relation.name() );
itemData.setShowLabel( true );
QTreeWidgetItem *item = mAvailableWidgetsTree->addItem( catitem, itemData );
item->setData( 0, FieldNameRole, relation.id() );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/vector/qgsvectorlayerproperties.cpp
Expand Up @@ -1538,7 +1538,7 @@ void QgsVectorLayerProperties::addJoinToTreeWidget( const QgsVectorLayerJoinInfo
childFields->setText( 0, QStringLiteral( "Joined fields" ) );
const QStringList *list = join.joinFieldNamesSubset();
if ( list )
childFields->setText( 1, QStringLiteral( "%1" ).arg( list->count() ) );
childFields->setText( 1, QString::number( list->count() ) );
else
childFields->setText( 1, tr( "all" ) );
joinItem->addChild( childFields );
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/topology/rulesDialog.cpp
Expand Up @@ -78,7 +78,7 @@ void rulesDialog::readTest( int index, QgsProject *project )
QString testName;
QString layer1Id;
QString layer2Id;
QString postfix = QStringLiteral( "%1" ).arg( index );
QString postfix = QString::number( index );

testName = project->readEntry( QStringLiteral( "Topol" ), "/testname_" + postfix, QString() );
layer1Id = project->readEntry( QStringLiteral( "Topol" ), "/layer1_" + postfix, QString() );
Expand Down Expand Up @@ -244,7 +244,7 @@ void rulesDialog::addRule()
mRulesTable->setItem( row, 4, newItem );

// save state to the project file.....
QString postfix = QStringLiteral( "%1" ).arg( row );
QString postfix = QString::number( row );
QgsProject *project = QgsProject::instance();

project->writeEntry( QStringLiteral( "Topol" ), QStringLiteral( "/testCount" ), row + 1 );
Expand Down
6 changes: 3 additions & 3 deletions src/providers/db2/qgsdb2provider.cpp
Expand Up @@ -1014,8 +1014,8 @@ bool QgsDb2Provider::addFeatures( QgsFeatureList &flist, Flags flags )
else
first = false;

statement += QStringLiteral( "%1" ).arg( fld.name() );
values += QStringLiteral( "?" );
statement += fld.name();
values += '?';
}

// append geometry column name
Expand All @@ -1027,7 +1027,7 @@ bool QgsDb2Provider::addFeatures( QgsFeatureList &flist, Flags flags )
values += ',';
}

statement += QStringLiteral( "%1" ).arg( mGeometryColName );
statement += mGeometryColName;

values += QStringLiteral( "db2gse.%1(CAST (%2 AS BLOB(2M)),%3)" )
.arg( mGeometryColType,
Expand Down
18 changes: 9 additions & 9 deletions src/providers/wfs/qgsbackgroundcachedshareddata.cpp
Expand Up @@ -183,7 +183,7 @@ bool QgsBackgroundCachedSharedData::createCache()
int counter = 2;
while ( setSQLiteColumnNameUpperCase.find( sqliteFieldName.toUpper() ) != setSQLiteColumnNameUpperCase.end() )
{
sqliteFieldName = field.name() + QStringLiteral( "%1" ).arg( counter );
sqliteFieldName = field.name() + QString::number( counter );
counter++;
}
setSQLiteColumnNameUpperCase.insert( sqliteFieldName.toUpper() );
Expand Down Expand Up @@ -659,7 +659,7 @@ void QgsBackgroundCachedSharedData::serializeFeatures( QVector<QgsFeatureUniqueI
QString errorMsg;

QString sql = qgs_sqlite3_mprintf( "SELECT qgisId, dbId FROM id_cache WHERE uniqueId = '%q'",
uniqueId.toUtf8().constData() );
uniqueId.toUtf8().constData() );
auto stmt = mCacheIdDb.prepare( sql, resultCode );
Q_ASSERT( resultCode == SQLITE_OK );
if ( stmt.step() == SQLITE_ROW )
Expand All @@ -669,15 +669,15 @@ void QgsBackgroundCachedSharedData::serializeFeatures( QVector<QgsFeatureUniqueI
if ( dbId != oldDbId )
{
sql = qgs_sqlite3_mprintf( "UPDATE id_cache SET dbId = NULL WHERE dbId = %lld",
dbId );
dbId );
if ( mCacheIdDb.exec( sql, errorMsg ) != SQLITE_OK )
{
QgsMessageLog::logMessage( QObject::tr( "Problem when updating id cache: %1 -> %2" ).arg( sql ).arg( errorMsg ), mComponentTranslated );
}

sql = qgs_sqlite3_mprintf( "UPDATE id_cache SET dbId = %lld WHERE uniqueId = '%q'",
dbId,
uniqueId.toUtf8().constData() );
dbId,
uniqueId.toUtf8().constData() );
if ( mCacheIdDb.exec( sql, errorMsg ) != SQLITE_OK )
{
QgsMessageLog::logMessage( QObject::tr( "Problem when updating id cache: %1 -> %2" ).arg( sql ).arg( errorMsg ), mComponentTranslated );
Expand All @@ -687,7 +687,7 @@ void QgsBackgroundCachedSharedData::serializeFeatures( QVector<QgsFeatureUniqueI
else
{
sql = qgs_sqlite3_mprintf( "UPDATE id_cache SET dbId = NULL WHERE dbId = %lld",
dbId );
dbId );
if ( mCacheIdDb.exec( sql, errorMsg ) != SQLITE_OK )
{
QgsMessageLog::logMessage( QObject::tr( "Problem when updating id cache: %1 -> %2" ).arg( sql ).arg( errorMsg ), mComponentTranslated );
Expand All @@ -696,9 +696,9 @@ void QgsBackgroundCachedSharedData::serializeFeatures( QVector<QgsFeatureUniqueI
qgisId = mNextCachedIdQgisId;
mNextCachedIdQgisId ++;
sql = qgs_sqlite3_mprintf( "INSERT INTO id_cache (uniqueId, dbId, qgisId) VALUES ('%q', %lld, %lld)",
uniqueId.toUtf8().constData(),
dbId,
qgisId );
uniqueId.toUtf8().constData(),
dbId,
qgisId );
if ( mCacheIdDb.exec( sql, errorMsg ) != SQLITE_OK )
{
QgsMessageLog::logMessage( QObject::tr( "Problem when updating id cache: %1 -> %2" ).arg( sql ).arg( errorMsg ), mComponentTranslated );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wfs/qgsoapifcollection.cpp
Expand Up @@ -77,7 +77,7 @@ bool QgsOapifCollection::deserialize( const json &j )
mdLink.mimeType = link.type;
mdLink.description = link.title;
if ( link.length > 0 )
mdLink.size = QStringLiteral( "%1" ).arg( link.length );
mdLink.size = QString::number( link.length );
mLayerMetadata.addLink( mdLink );
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/wfs/qgsoapifitemsrequest.cpp
Expand Up @@ -140,7 +140,7 @@ void QgsOapifItemsRequest::processReply()
}
else if ( id.is_number_integer() )
{
mFeatures[i].second = QStringLiteral( "%1" ).arg( id.get<qint64>() );
mFeatures[i].second = QString::number( id.get<qint64>() );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmscapabilities.h
Expand Up @@ -769,7 +769,7 @@ struct QgsWmsAuthorization

if ( !mReferer.isEmpty() )
{
request.setRawHeader( "Referer", QStringLiteral( "%1" ).arg( mReferer ).toLatin1() );
request.setRawHeader( "Referer", mReferer.toLatin1() );
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgsbufferserverresponse.cpp
Expand Up @@ -88,7 +88,7 @@ void QgsBufferServerResponse::finish()
{
if ( ! mHeaders.contains( "Content-Length" ) )
{
mHeaders.insert( QStringLiteral( "Content-Length" ), QStringLiteral( "%1" ).arg( mBuffer.pos() ) );
mHeaders.insert( QStringLiteral( "Content-Length" ), QString::number( mBuffer.pos() ) );
}
}
flush();
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgsfcgiserverresponse.cpp
Expand Up @@ -94,7 +94,7 @@ void QgsFcgiServerResponse::finish()
{
if ( ! mHeaders.contains( "Content-Length" ) )
{
mHeaders.insert( QStringLiteral( "Content-Length" ), QStringLiteral( "%1" ).arg( mBuffer.pos() ) );
mHeaders.insert( QStringLiteral( "Content-Length" ), QString::number( mBuffer.pos() ) );
}
}
flush();
Expand Down

0 comments on commit 9924b15

Please sign in to comment.