Skip to content
Permalink
Browse files

Add extra parameter QgsProject* to QgsService::executeRequest

  • Loading branch information
dmarteau committed Jan 10, 2017
1 parent bac1890 commit ec226eeab8f388202d1b556102fcf817cc3599d6
@@ -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" ) );

0 comments on commit ec226ee

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