Skip to content
Permalink
Browse files

Remove unnecessary members from renderer

  • Loading branch information
pblottiere committed Mar 27, 2019
1 parent 0b68762 commit a159c01901e5050d8debdf80fbdb55d79d304fdb
@@ -511,7 +511,7 @@ void QgsWmsRenderContext::checkLayerReadPermissions()
}

#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsAccessControl *QgsWmsRenderContext::accessControl()
QgsAccessControl *QgsWmsRenderContext::accessControl() const
{
return mInterface->accessControls();
}
@@ -184,7 +184,7 @@ namespace QgsWms
/**
* Returns the access control interface.
*/
QgsAccessControl *accessControl();
QgsAccessControl *accessControl() const;
#endif

private:
@@ -116,10 +116,6 @@ namespace QgsWms
QgsRenderer::QgsRenderer( const QgsWmsRenderContext &context )
: mContext( context )
{
#ifdef HAVE_SERVER_PYTHON_PLUGINS
mAccessControl = mContext.accessControl();
#endif

mProject = mContext.project();

mWmsParameters = mContext.parameters();
@@ -1415,14 +1411,14 @@ namespace QgsWms
}

#ifdef HAVE_SERVER_PYTHON_PLUGINS
mAccessControl->filterFeatures( layer, fReq );
mContext.accessControl()->filterFeatures( layer, fReq );

QStringList attributes;
for ( const QgsField &field : fields )
{
attributes.append( field.name() );
}
attributes = mAccessControl->layerAttributes( layer, attributes );
attributes = mContext.accessControl()->layerAttributes( layer, attributes );
fReq.setSubsetOfAttributes( attributes, layer->fields() );
#endif

@@ -2611,10 +2607,10 @@ namespace QgsWms
QgsFeatureFilterProviderGroup filters;
filters.addProvider( &mFeatureFilter );
#ifdef HAVE_SERVER_PYTHON_PLUGINS
mAccessControl->resolveFilterFeatures( mapSettings.layers() );
filters.addProvider( mAccessControl );
mContext.accessControl()->resolveFilterFeatures( mapSettings.layers() );
filters.addProvider( mContext.accessControl() );
#endif
QgsMapRendererJobProxy renderJob( mSettings.parallelRendering(), mSettings.maxThreads(), &filters );
QgsMapRendererJobProxy renderJob( mContext.settings().parallelRendering(), mContext.settings().maxThreads(), &filters );
renderJob.render( mapSettings, &image );
painter = renderJob.takePainter();

@@ -2740,7 +2736,7 @@ namespace QgsWms
void QgsRenderer::setLayerAccessControlFilter( QgsMapLayer *layer ) const
{
#ifdef HAVE_SERVER_PYTHON_PLUGINS
QgsOWSServerFilterRestorer::applyAccessControlLayerFilters( mAccessControl, layer );
QgsOWSServerFilterRestorer::applyAccessControlLayerFilters( mContext.accessControl(), layer );
#else
Q_UNUSED( layer );
#endif
@@ -285,13 +285,8 @@ namespace QgsWms

QgsWmsParameters mWmsParameters;

#ifdef HAVE_SERVER_PYTHON_PLUGINS
//! The access control helper
QgsAccessControl *mAccessControl = nullptr;
#endif
QgsFeatureFilter mFeatureFilter;

QgsServerSettings mSettings;
const QgsProject *mProject = nullptr;
QList<QgsMapLayer *> mTemporaryLayers;
QgsWmsRenderContext mContext;

0 comments on commit a159c01

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