Skip to content

Commit ec226ee

Browse files
committed
Add extra parameter QgsProject* to QgsService::executeRequest
1 parent bac1890 commit ec226ee

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

python/server/qgsservice.sip

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ class QgsService
6262

6363
/**
6464
* Execute the requests and set result in QgsServerRequest
65-
* @param request a QgsServerRequest instance
66-
* @param response a QgsServerResponse instance
6765
*/
68-
virtual void executeRequest( const QgsServerRequest& request, QgsServerResponse& response ) = 0;
66+
virtual void executeRequest( const QgsServerRequest& request, QgsServerResponse& response,
67+
QgsProject* project = nullptr ) = 0;
6968
};
7069

python/server/qgsserviceregistry.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ class QgsServiceRegistry
6363
void registerService( QgsService* service /Transfer/ );
6464

6565
/**
66-
* Unregister service from its name and version
66+
* Unregister service from its name and version
6767
*
6868
* @param name the tame of the service
6969
* @param version (optional) the specific version to unload
7070
* @return the number of unregstered services
7171
*
72-
* If the version is not specified then all versions from the specified service
72+
* If the version is not specified then all versions from the specified service
7373
* are unloaded
7474
*/
7575
int unregisterService( const QString& name, const QString& version = QString() );

src/server/qgsservice.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "qgsserverrequest.h"
2525
#include "qgsserverresponse.h"
2626

27+
class QgsProject;
28+
2729
/**
2830
* \ingroup server
2931
* QgsService
@@ -61,10 +63,9 @@ class SERVER_EXPORT QgsService
6163

6264
/**
6365
* Execute the requests and set result in QgsServerRequest
64-
* @param request a QgsServerRequest instance
65-
* @param response a QgsServerResponse instance
6666
*/
67-
virtual void executeRequest( const QgsServerRequest& request, QgsServerResponse& response ) = 0;
67+
virtual void executeRequest( const QgsServerRequest& request, QgsServerResponse& response,
68+
QgsProject* project = nullptr ) = 0;
6869
};
6970

7071
#endif

src/server/services/DummyService/dummy.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ class SampleService: public QgsService
3131
return method == QgsServerRequest::GetMethod;
3232
}
3333

34-
void executeRequest( const QgsServerRequest& request, QgsServerResponse& response )
34+
void executeRequest( const QgsServerRequest& request, QgsServerResponse& response,
35+
QgsProject* project )
3536
{
37+
Q_UNUSED( project );
3638
Q_UNUSED( request );
3739
QgsDebugMsg( "SampleService::executeRequest called" );
3840
response.write( QString( "Hello world from myService" ) );

0 commit comments

Comments
 (0)