mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Add extra parameter QgsProject* to QgsService::executeRequest
This commit is contained in:
parent
bac1890f9c
commit
ec226eeab8
@ -62,9 +62,8 @@ class QgsService
|
||||
|
||||
/**
|
||||
* Execute the requests and set result in QgsServerRequest
|
||||
* @param request a QgsServerRequest instance
|
||||
* @param response a QgsServerResponse instance
|
||||
*/
|
||||
virtual void executeRequest( const QgsServerRequest& request, QgsServerResponse& response ) = 0;
|
||||
virtual void executeRequest( const QgsServerRequest& request, QgsServerResponse& response,
|
||||
QgsProject* project = nullptr ) = 0;
|
||||
};
|
||||
|
||||
|
@ -63,13 +63,13 @@ class QgsServiceRegistry
|
||||
void registerService( QgsService* service /Transfer/ );
|
||||
|
||||
/**
|
||||
* Unregister service from its name and version
|
||||
* Unregister service from its name and version
|
||||
*
|
||||
* @param name the tame of the service
|
||||
* @param version (optional) the specific version to unload
|
||||
* @return the number of unregstered services
|
||||
*
|
||||
* If the version is not specified then all versions from the specified service
|
||||
* If the version is not specified then all versions from the specified service
|
||||
* are unloaded
|
||||
*/
|
||||
int unregisterService( const QString& name, const QString& version = QString() );
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "qgsserverrequest.h"
|
||||
#include "qgsserverresponse.h"
|
||||
|
||||
class QgsProject;
|
||||
|
||||
/**
|
||||
* \ingroup server
|
||||
* QgsService
|
||||
@ -61,10 +63,9 @@ class SERVER_EXPORT QgsService
|
||||
|
||||
/**
|
||||
* Execute the requests and set result in QgsServerRequest
|
||||
* @param request a QgsServerRequest instance
|
||||
* @param response a QgsServerResponse instance
|
||||
*/
|
||||
virtual void executeRequest( const QgsServerRequest& request, QgsServerResponse& response ) = 0;
|
||||
virtual void executeRequest( const QgsServerRequest& request, QgsServerResponse& response,
|
||||
QgsProject* project = nullptr ) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -31,8 +31,10 @@ class SampleService: public QgsService
|
||||
return method == QgsServerRequest::GetMethod;
|
||||
}
|
||||
|
||||
void executeRequest( const QgsServerRequest& request, QgsServerResponse& response )
|
||||
void executeRequest( const QgsServerRequest& request, QgsServerResponse& response,
|
||||
QgsProject* project )
|
||||
{
|
||||
Q_UNUSED( project );
|
||||
Q_UNUSED( request );
|
||||
QgsDebugMsg( "SampleService::executeRequest called" );
|
||||
response.write( QString( "Hello world from myService" ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user