Skip to content

Commit d8cf02e

Browse files
committedSep 19, 2017
[Server] Remove QgsProject::instance
1 parent a35af0c commit d8cf02e

File tree

3 files changed

+2
-26
lines changed

3 files changed

+2
-26
lines changed
 

‎src/server/qgsserver.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ void QgsServer::handleRequest( QgsServerRequest &request, QgsServerResponse &res
305305
{
306306
QgsMessageLog::MessageLevel logLevel = QgsServerLogger::instance()->logLevel();
307307
QTime time; //used for measuring request time if loglevel < 1
308-
QgsProject::instance()->removeAllMapLayers();
309308

310309
qApp->processEvents();
311310

‎src/server/services/wms/qgswmsrenderer.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,20 +1686,6 @@ namespace QgsWms
16861686
return true;
16871687
}
16881688

1689-
#ifdef HAVE_SERVER_PYTHON_PLUGINS
1690-
void QgsRenderer::applyAccessControlLayersFilters( const QStringList &layerList, QHash<QgsMapLayer *, QString> &originalLayerFilters ) const
1691-
{
1692-
Q_FOREACH ( const QString &layerName, layerList )
1693-
{
1694-
QList<QgsMapLayer *> mapLayers = QgsProject::instance()->mapLayersByName( layerName );
1695-
Q_FOREACH ( QgsMapLayer *mapLayer, mapLayers )
1696-
{
1697-
QgsOWSServerFilterRestorer::applyAccessControlLayerFilters( mAccessControl, mapLayer, originalLayerFilters );
1698-
}
1699-
}
1700-
}
1701-
#endif
1702-
17031689
bool QgsRenderer::testFilterStringSafety( const QString &filter ) const
17041690
{
17051691
//; too dangerous for sql injections
@@ -1897,7 +1883,7 @@ namespace QgsWms
18971883
QString currentLayerId = currentLayerElem.attribute( QStringLiteral( "id" ) );
18981884
if ( !currentLayerId.isEmpty() )
18991885
{
1900-
QgsMapLayer *currentLayer = QgsProject::instance()->mapLayer( currentLayerId );
1886+
QgsMapLayer *currentLayer = mProject->mapLayer( currentLayerId );
19011887
if ( currentLayer )
19021888
{
19031889
QString WMSPropertyAttributesString = currentLayer->customProperty( QStringLiteral( "WMSPropertyAttributes" ) ).toString();
@@ -2109,7 +2095,7 @@ namespace QgsWms
21092095

21102096
QgsExpressionContext expressionContext;
21112097
expressionContext << QgsExpressionContextUtils::globalScope()
2112-
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() );
2098+
<< QgsExpressionContextUtils::projectScope( mProject );
21132099
if ( layer )
21142100
expressionContext << QgsExpressionContextUtils::layerScope( layer );
21152101
expressionContext.setFeature( *feat );

‎src/server/services/wms/qgswmsrenderer.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,6 @@ namespace QgsWms
224224
//! Record which symbols within one layer would be rendered with the given renderer context
225225
void runHitTestLayer( QgsVectorLayer *vl, SymbolSet &usedSymbols, QgsRenderContext &context ) const;
226226

227-
#ifdef HAVE_SERVER_PYTHON_PLUGINS
228-
229-
/** Apply filter strings from the access control to the layers.
230-
* \param layerList layers to filter
231-
* \param originalLayerFilters the original layers filter dictionary
232-
*/
233-
void applyAccessControlLayersFilters( const QStringList &layerList, QHash<QgsMapLayer *, QString> &originalLayerFilters ) const;
234-
#endif
235-
236227
/** Tests if a filter sql string is allowed (safe)
237228
\returns true in case of success, false if string seems unsafe*/
238229
bool testFilterStringSafety( const QString &filter ) const;

0 commit comments

Comments
 (0)
Please sign in to comment.