Skip to content

Commit

Permalink
Fix coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarteau committed Jan 10, 2017
1 parent a0ee81b commit 609dd58
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/server/qgsserverresponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wms/qgsdxfwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wms/qgsfilterrestorer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/server/services/wms/qgswms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswmsdescribelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/server/services/wms/qgswmsgetfeatureinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswmsgetlegendgraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/server/services/wms/qgswmsgetmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) );
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswmsgetprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions src/server/services/wms/qgswmsservertransitional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );

Expand Down Expand Up @@ -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() );

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/server/services/wms/qgswmsservertransitional.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/server/services/wms/qgswmsutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}

Expand Down Expand Up @@ -94,7 +94,8 @@ namespace QgsWms
}

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

Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 609dd58

Please sign in to comment.