22 #ifdef HAVE_SERVER_PYTHON_PLUGINS 27 #ifdef HAVE_SERVER_PYTHON_PLUGINS 29 QHash<QgsMapLayer *, QString> &originalLayerFilters )
31 if (
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( mapLayer ) )
36 if ( !originalLayerFilters.contains( layer ) )
38 originalLayerFilters.insert( layer, layer->subsetString() );
40 if ( !layer->subsetString().isEmpty() )
42 sql.prepend(
") AND (" );
44 sql.prepend( layer->subsetString() );
47 if ( !layer->setSubsetString( sql ) )
57 if (
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( mapLayer ) )
62 if ( !layer->subsetString().isEmpty() )
64 sql.prepend(
") AND (" );
66 sql.prepend( layer->subsetString() );
69 if ( !layer->setSubsetString( sql ) )
81 QHash<QgsMapLayer *, QString>::const_iterator filterIt = filterMap.constBegin();
82 for ( ; filterIt != filterMap.constEnd(); ++filterIt )
Base class for all map layer types.
QString extraSubsetString(const QgsVectorLayer *layer) const
Returns an additional subset string (typically SQL) filter.
static void applyAccessControlLayerFilters(const QgsAccessControl *accessControl, QgsMapLayer *mapLayer, QHash< QgsMapLayer *, QString > &originalLayerFilters)
Apply filter from AccessControl.
void restoreLayerFilters(const QHash< QgsMapLayer *, QString > &filterMap)
Apply filter from AccessControal.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
virtual bool setSubsetString(const QString &subset)
Sets the string (typically sql) used to define a subset of the layer.
A helper class that centralizes restrictions given by all the access control filter plugins...
Represents a vector layer which manages a vector based data sets.