23 #ifdef HAVE_SERVER_PYTHON_PLUGINS 28 #ifdef HAVE_SERVER_PYTHON_PLUGINS 30 QHash<QgsMapLayer *, QString> &originalLayerFilters )
32 if (
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( mapLayer ) )
37 if ( !originalLayerFilters.contains( layer ) )
39 originalLayerFilters.insert( layer, layer->subsetString() );
41 if ( !layer->subsetString().isEmpty() )
43 sql.prepend(
") AND (" );
45 sql.prepend( layer->subsetString() );
48 if ( !layer->setSubsetString( sql ) )
58 if (
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( mapLayer ) )
63 if ( !layer->subsetString().isEmpty() )
65 sql.prepend(
") AND (" );
67 sql.prepend( layer->subsetString() );
70 if ( !layer->setSubsetString( sql ) )
82 QHash<QgsMapLayer *, QString>::const_iterator filterIt = filterMap.constBegin();
83 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)
Set 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.