Skip to content
Permalink
Browse files

Fix warnings when building without HAVE_SERVER_PYTHON_PLUGINS

  • Loading branch information
nyalldawson committed Apr 9, 2019
1 parent 3b4dbe8 commit 9502c353073cf92b62e9d666cbdc18d003c675a6
@@ -33,16 +33,14 @@ namespace QgsWcs
void writeDescribeCoverage( QgsServerInterface *serverIface, const QgsProject *project, const QString &version,
const QgsServerRequest &request, QgsServerResponse &response )
{
QgsAccessControl *accessControl = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
QgsAccessControl *accessControl = serverIface->accessControls();
#endif
QDomDocument doc;
const QDomDocument *describeDocument = nullptr;

QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
cacheManager = serverIface->cacheManager();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager && cacheManager->getCachedDocument( &doc, project, request, accessControl ) )
{
describeDocument = &doc;
@@ -76,6 +74,8 @@ namespace QgsWcs

#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif

//wcs:WCS_Capabilities element
@@ -32,16 +32,14 @@ namespace QgsWcs
void writeGetCapabilities( QgsServerInterface *serverIface, const QgsProject *project, const QString &version,
const QgsServerRequest &request, QgsServerResponse &response )
{
QgsAccessControl *accessControl = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
QgsAccessControl *accessControl = serverIface->accessControls();
#endif
QDomDocument doc;
const QDomDocument *capabilitiesDocument = nullptr;

QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
cacheManager = serverIface->cacheManager();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager && cacheManager->getCachedDocument( &doc, project, request, accessControl ) )
{
capabilitiesDocument = &doc;
@@ -274,6 +272,8 @@ namespace QgsWcs
{
#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif
/*
* Adding layer list in ContentMetadata
@@ -52,6 +52,8 @@ namespace QgsWcs

#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif
//defining coverage name
QString coveName;
@@ -34,16 +34,14 @@ namespace QgsWfs
void writeDescribeFeatureType( QgsServerInterface *serverIface, const QgsProject *project, const QString &version,
const QgsServerRequest &request, QgsServerResponse &response )
{
QgsAccessControl *accessControl = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
QgsAccessControl *accessControl = serverIface->accessControls();
#endif
QDomDocument doc;
const QDomDocument *describeDocument = nullptr;

QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
cacheManager = serverIface->cacheManager();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager && cacheManager->getCachedDocument( &doc, project, request, accessControl ) )
{
describeDocument = &doc;
@@ -82,7 +80,11 @@ namespace QgsWfs
throw QgsBadRequestException( QStringLiteral( "Invalid WFS Parameter" ),
QStringLiteral( "OUTPUTFORMAT %1 is not supported" ).arg( wfsParameters.outputFormatAsString() ) );

#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif

//xsd:schema
QDomElement schemaElement = doc.createElement( QStringLiteral( "schema" )/*xsd:schema*/ );
@@ -38,16 +38,14 @@ namespace QgsWfs
void writeGetCapabilities( QgsServerInterface *serverIface, const QgsProject *project, const QString &version,
const QgsServerRequest &request, QgsServerResponse &response )
{
QgsAccessControl *accessControl = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
QgsAccessControl *accessControl = serverIface->accessControls();
#endif
QDomDocument doc;
const QDomDocument *capabilitiesDocument = nullptr;

QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
cacheManager = serverIface->cacheManager();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager && cacheManager->getCachedDocument( &doc, project, request, accessControl ) )
{
capabilitiesDocument = &doc;
@@ -431,7 +429,11 @@ namespace QgsWfs

QDomElement getFeatureTypeListElement( QDomDocument &doc, QgsServerInterface *serverIface, const QgsProject *project )
{
#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif

//wfs:FeatureTypeList element
QDomElement featureTypeListElement = doc.createElement( QStringLiteral( "FeatureTypeList" )/*wfs:FeatureTypeList*/ );
@@ -39,16 +39,14 @@ namespace QgsWfs
void writeGetCapabilities( QgsServerInterface *serverIface, const QgsProject *project, const QString &version,
const QgsServerRequest &request, QgsServerResponse &response )
{
QgsAccessControl *accessControl = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
QgsAccessControl *accessControl = serverIface->accessControls();
#endif
QDomDocument doc;
const QDomDocument *capabilitiesDocument = nullptr;

QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
cacheManager = serverIface->cacheManager();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager && cacheManager->getCachedDocument( &doc, project, request, accessControl ) )
{
capabilitiesDocument = &doc;
@@ -269,7 +267,11 @@ namespace QgsWfs

QDomElement getFeatureTypeListElement( QDomDocument &doc, QgsServerInterface *serverIface, const QgsProject *project )
{
#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif

//wfs:FeatureTypeList element
QDomElement featureTypeListElement = doc.createElement( QStringLiteral( "FeatureTypeList" )/*wfs:FeatureTypeList*/ );
@@ -177,12 +177,13 @@ namespace QgsWfs
}
}

QgsAccessControl *accessControl = serverIface->accessControls();

#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
//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
std::unique_ptr< QgsOWSServerFilterRestorer > filterRestorer( new QgsOWSServerFilterRestorer() );
#else
( void )serverIface;
#endif

// features counters
@@ -214,6 +214,9 @@ namespace QgsWfs

void performTransaction( transactionRequest &aRequest, QgsServerInterface *serverIface, const QgsProject *project )
{
#ifndef HAVE_SERVER_PYTHON_PLUGINS
( void )serverIface;
#endif
// store typeName
QStringList typeNameList;

@@ -239,8 +242,10 @@ namespace QgsWfs
typeNameList << name;
}

#ifdef HAVE_SERVER_PYTHON_PLUGINS
// get access controls
QgsAccessControl *accessControl = serverIface->accessControls();
#endif

//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
@@ -225,8 +225,12 @@ namespace QgsWfs
typeNameList << name;
}

#ifdef HAVE_SERVER_PYTHON_PLUGINS
// get access controls
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif

//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
@@ -108,6 +108,8 @@ namespace QgsWms
// access control
#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif
// Use layer ids
bool useLayerIds = QgsServerProjectUtils::wmsUseLayerIds( *project );
@@ -90,9 +90,8 @@ namespace QgsWms
const QString &version, const QgsServerRequest &request,
QgsServerResponse &response, bool projectSettings )
{
QgsAccessControl *accessControl = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
QgsAccessControl *accessControl = serverIface->accessControls();
#endif

QDomDocument doc;
@@ -112,9 +111,8 @@ namespace QgsWms
#endif
QString cacheKey = cacheKeyList.join( '-' );

QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
cacheManager = serverIface->cacheManager();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager && cacheManager->getCachedDocument( &doc, project, request, accessControl ) )
{
capabilitiesDocument = &doc;
@@ -1671,7 +1669,11 @@ namespace QgsWms
void appendDrawingOrder( QDomDocument &doc, QDomElement &parentElem, QgsServerInterface *serverIface,
const QgsProject *project )
{
#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif
bool useLayerIds = QgsServerProjectUtils::wmsUseLayerIds( *project );
QStringList restrictedLayers = QgsServerProjectUtils::wmsRestrictedLayers( *project );

@@ -54,17 +54,15 @@ namespace QgsWms
const QString &version, const QgsServerRequest &request,
QgsServerResponse &response )
{
QgsAccessControl *accessControl = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
QgsAccessControl *accessControl = serverIface->accessControls();
#endif

QDomDocument doc;
const QDomDocument *contextDocument = nullptr;

QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
cacheManager = serverIface->cacheManager();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager && cacheManager->getCachedDocument( &doc, project, request, accessControl ) )
{
contextDocument = &doc;
@@ -64,11 +64,9 @@ namespace QgsWms
}

// Get cached image
QgsAccessControl *accessControl = nullptr;
QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
cacheManager = serverIface->cacheManager();
QgsAccessControl *accessControl = serverIface->accessControls();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager )
{
QImage image;
@@ -88,14 +86,14 @@ namespace QgsWms
if ( result )
{
writeImage( response, *result, format, context.imageQuality() );
#ifdef HAVE_SERVER_PYTHON_PLUGINS
if ( cacheManager )
{
QByteArray content = response.data();
#ifdef HAVE_SERVER_PYTHON_PLUGINS
if ( !content.isEmpty() )
cacheManager->setCachedImage( &content, project, request, accessControl );
#endif
}
#endif
}
else
{
@@ -132,7 +132,11 @@ namespace QgsWms
myDocument.appendChild( root );

// access control
#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif
// Use layer ids
bool useLayerIds = QgsServerProjectUtils::wmsUseLayerIds( *project );
// WMS restricted layers
@@ -40,16 +40,14 @@ namespace QgsWmts
void writeGetCapabilities( QgsServerInterface *serverIface, const QgsProject *project, const QString &version,
const QgsServerRequest &request, QgsServerResponse &response )
{
QgsAccessControl *accessControl = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
QgsAccessControl *accessControl = serverIface->accessControls();
#endif
QDomDocument doc;
const QDomDocument *capabilitiesDocument = nullptr;

QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
cacheManager = serverIface->cacheManager();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager && cacheManager->getCachedDocument( &doc, project, request, accessControl ) )
{
capabilitiesDocument = &doc;
@@ -34,11 +34,9 @@ namespace QgsWmts
QUrlQuery query = translateWmtsParamToWmsQueryItem( QStringLiteral( "GetMap" ), params, project, serverIface );

// Get cached image
QgsAccessControl *accessControl = nullptr;
QgsServerCacheManager *cacheManager = nullptr;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
accessControl = serverIface->accessControls();
cacheManager = serverIface->cacheManager();
QgsAccessControl *accessControl = serverIface->accessControls();
QgsServerCacheManager *cacheManager = serverIface->cacheManager();
if ( cacheManager )
{
QgsWmtsParameters::Format f = params.format();
@@ -366,6 +366,8 @@ namespace QgsWmts
QList< layerDef > wmtsLayers;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *accessControl = serverIface->accessControls();
#else
( void )serverIface;
#endif

// WMTS Project configuration
@@ -619,6 +621,10 @@ namespace QgsWmts
QUrlQuery translateWmtsParamToWmsQueryItem( const QString &request, const QgsWmtsParameters &params,
const QgsProject *project, QgsServerInterface *serverIface )
{
#ifndef HAVE_SERVER_PYTHON_PLUGINS
( void )serverIface;
#endif

//defining Layer
QString layer = params.layer();
//read Layer

0 comments on commit 9502c35

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