Skip to content
Permalink
Browse files

Fix coding style

  • Loading branch information
dmarteau committed Jan 10, 2017
1 parent a0ee81b commit 609dd58d780cc99561e802f90ac14ff860e0523c
@@ -57,7 +57,7 @@ class SERVER_EXPORT QgsServerResponse
* Send error
* This method delegates error handling at the server level. This is different
* from calling setReturnCode() wich let you return a specific response body.
* Calling sendError() will end the transaction and any attempt to write data
* Calling sendError() will end the transaction and any attempt to write data
* or set headers will be an error.
* @param code HHTP return code value
* @param message An informative error message
@@ -46,7 +46,7 @@ namespace QgsWms
return options;
}

void readDxfLayerSettings( QgsWmsServer& server, QgsWmsConfigParser* configParser,
void readDxfLayerSettings( QgsWmsServer& server, QgsWmsConfigParser* configParser,
QList< QPair<QgsVectorLayer *, int > >& layers,
const QMap<QString, QString>& options )
{
@@ -39,7 +39,7 @@ class QgsOWSServerFilterRestorer
{
restoreLayerFilters( mOriginalLayerFilters );
}

void restoreLayerFilters( const QHash<QgsMapLayer*, QString>& filterMap );

/** Returns a reference to the object's hash of layers to original subsetString filters.
@@ -71,8 +71,8 @@ namespace QgsWms
return;
}

if ( (QSTR_COMPARE( mVersion, "1.1.1" ) && QSTR_COMPARE( req, "capabilities" ))
|| QSTR_COMPARE( req, "GetCapabilites" ) )
if (( QSTR_COMPARE( mVersion, "1.1.1" ) && QSTR_COMPARE( req, "capabilities" ) )
|| QSTR_COMPARE( req, "GetCapabilites" ) )
{
//TODO GetCapabilities
writeGetCapabilities( mServerIface, mVersion, request, response, false );
@@ -28,7 +28,7 @@ namespace QgsWms
void writeDescribeLayer( QgsServerInterface* serverIface, const QString& version,
const QgsServerRequest& request, QgsServerResponse& response )
{
Q_UNUSED(version);
Q_UNUSED( version );
QgsServerRequest::Parameters params = request.parameters();
try
{
@@ -146,8 +146,8 @@ namespace QgsWms
}
else //unsupported format, set exception
{
writeError( response, QStringLiteral( "InvalidFormat" ),
QString("Feature info format '%1' is not supported. Possibilities are 'text/plain', 'text/html' or 'text/xml'." ).arg(infoFormat) );
writeError( response, QStringLiteral( "InvalidFormat" ),
QString( "Feature info format '%1' is not supported. Possibilities are 'text/plain', 'text/html' or 'text/xml'." ).arg( infoFormat ) );
return;
}

@@ -40,7 +40,7 @@ namespace QgsWms
QScopedPointer<QImage> result( server.getLegendGraphics() );
if ( !result.isNull() )
{
QString format = params.value( QStringLiteral("FORMAT"), QStringLiteral("PNG") );
QString format = params.value( QStringLiteral( "FORMAT" ), QStringLiteral( "PNG" ) );
writeImage( response, *result, format, server.getImageQuality() );
}
else
@@ -41,12 +41,12 @@ namespace QgsWms
QScopedPointer<QImage> result( server.getMap() );
if ( !result.isNull() )
{
QString format = params.value( QStringLiteral("FORMAT"), QStringLiteral("PNG") );
QString format = params.value( QStringLiteral( "FORMAT" ), QStringLiteral( "PNG" ) );
writeImage( response, *result, format, server.getImageQuality() );
}
else
{
writeError( response, QStringLiteral( "UnknownError" ),
writeError( response, QStringLiteral( "UnknownError" ),
QStringLiteral( "Failed to compute GetMap image" ) );
}
}
@@ -53,7 +53,7 @@ namespace QgsWms
contentType = "image/svg+xml";
}
else if ( format.compare( QStringLiteral( "application/pdf" ), Qt::CaseInsensitive ) == 0 ||
format.compare( QStringLiteral( "pdf" ), Qt::CaseInsensitive ) == 0 )
format.compare( QStringLiteral( "pdf" ), Qt::CaseInsensitive ) == 0 )
{
format = "pdf";
contentType = "application/pdf";
@@ -964,7 +964,7 @@ namespace QgsWms

//scoped pointer to restore all original layer filters (subsetStrings) when pointer goes out of scope
//there's LOTS of potential exit paths here, so we avoid having to restore the filters manually
QScopedPointer< QgsOWSServerFilterRestorer > filterRestorer( new QgsOWSServerFilterRestorer(mAccessControl) );
QScopedPointer< QgsOWSServerFilterRestorer > filterRestorer( new QgsOWSServerFilterRestorer( mAccessControl ) );

applyRequestedLayerFilters( layersList, mapSettings, filterRestorer->originalFilters() );

@@ -1125,7 +1125,7 @@ namespace QgsWms

//scoped pointer to restore all original layer filters (subsetStrings) when pointer goes out of scope
//there's LOTS of potential exit paths here, so we avoid having to restore the filters manually
QScopedPointer< QgsOWSServerFilterRestorer > filterRestorer( new QgsOWSServerFilterRestorer(mAccessControl) );
QScopedPointer< QgsOWSServerFilterRestorer > filterRestorer( new QgsOWSServerFilterRestorer( mAccessControl ) );

applyRequestedLayerFilters( layersList, mapSettings, filterRestorer->originalFilters() );

@@ -1308,7 +1308,7 @@ namespace QgsWms

//scoped pointer to restore all original layer filters (subsetStrings) when pointer goes out of scope
//there's LOTS of potential exit paths here, so we avoid having to restore the filters manually
QScopedPointer< QgsOWSServerFilterRestorer > filterRestorer( new QgsOWSServerFilterRestorer(mAccessControl) );
QScopedPointer< QgsOWSServerFilterRestorer > filterRestorer( new QgsOWSServerFilterRestorer( mAccessControl ) );
applyRequestedLayerFilters( layersList, mapSettings, filterRestorer->originalFilters() );

#ifdef HAVE_SERVER_PYTHON_PLUGINS
@@ -257,7 +257,7 @@ namespace QgsWms
//! Cleanup temporary objects (e.g. SLD parser objects or temporary files) after request
void cleanupAfterRequest();

private:
private:

QMap<QString, QString> mParameters;
bool mOwnsConfigParser; //delete config parser after request (e.g. sent SLD)
@@ -266,7 +266,7 @@ namespace QgsWms
bool mDrawLegendLayerLabel;
bool mDrawLegendItemLabel;

//! Map containing the WMS parameters
//! Map containing the WMS parameters
QgsWmsConfigParser* mConfigParser;
QString mConfigFilePath;
//! The access control helper
@@ -58,7 +58,7 @@ namespace QgsWms
elem.appendChild( messageText );
root.appendChild( elem );

response.setHeader( QStringLiteral("Content-Type"), QStringLiteral("text/xml; charset=utf-8") );
response.setHeader( QStringLiteral( "Content-Type" ), QStringLiteral( "text/xml; charset=utf-8" ) );
response.write( doc.toByteArray() );
}

@@ -94,7 +94,8 @@ namespace QgsWms
}

//forward declaration
namespace {
namespace
{
void medianCut( QVector<QRgb>& colorTable, int nColors, const QImage& inputImage );
}

@@ -150,7 +151,7 @@ namespace QgsWms
if ( outputFormat != UNKN )
{
response.setHeader( "Content-Type", contentType );
result.save( response.io(), qPrintable(saveFormat), imageQuality );
result.save( response.io(), qPrintable( saveFormat ), imageQuality );
}
else
{

0 comments on commit 609dd58

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