From fcacb2899f38f3db34aedd8bc5c0b4ae2c365cb9 Mon Sep 17 00:00:00 2001 From: David Marteau Date: Fri, 16 Dec 2016 17:01:48 +0100 Subject: [PATCH] Fix coding style and update comments --- python/server/qgsserverinterface.sip | 20 ++++++++++---------- python/server/qgsserverrequest.sip | 4 ++-- python/server/qgsserverresponse.sip | 6 +++--- src/server/qgsserver.h | 4 ++-- src/server/qgsserverinterface.h | 2 +- src/server/qgsserverinterfaceimpl.cpp | 4 ++-- src/server/qgsserverresponse.h | 4 +++- src/server/qgsservicenativeloader.cpp | 2 +- src/server/qgsservicenativeloader.h | 4 ++-- src/server/qgsserviceregistry.h | 4 ++-- 10 files changed, 28 insertions(+), 26 deletions(-) diff --git a/python/server/qgsserverinterface.sip b/python/server/qgsserverinterface.sip index a1c186057b5..0499089eaec 100644 --- a/python/server/qgsserverinterface.sip +++ b/python/server/qgsserverinterface.sip @@ -39,7 +39,7 @@ typedef QMultiMap QgsServerFiltersMap; class QgsServerInterface { %TypeHeaderCode - #include "qgsserverinterface.h" +#include "qgsserverinterface.h" %End public: @@ -61,26 +61,26 @@ class QgsServerInterface * Get pointer to the capabiblities cache * @return QgsCapabilitiesCache */ - virtual QgsCapabilitiesCache* capabilitiesCache() = 0 /KeepReference/; + virtual QgsCapabilitiesCache* capabilitiesCache() = 0 / KeepReference /; /** * Get pointer to the request handler * @return QgsRequestHandler */ - virtual QgsRequestHandler* requestHandler() = 0 /KeepReference/; + virtual QgsRequestHandler* requestHandler() = 0 / KeepReference /; /** * Register a QgsServerFilter * @param filter the QgsServerFilter to add * @param priority an optional priority for the filter order */ - virtual void registerFilter( QgsServerFilter* filter /Transfer/, int priority = 0 ) = 0; + virtual void registerFilter( QgsServerFilter* filter / Transfer / , int priority = 0 ) = 0; /** * Set the filters map * @param filters the QgsServerFiltersMap */ - virtual void setFilters( QgsServerFiltersMap* filters /Transfer/) = 0; + virtual void setFilters( QgsServerFiltersMap* filters / Transfer / ) = 0; /** * Return the list of current QgsServerFilter @@ -92,13 +92,13 @@ class QgsServerInterface * @param accessControl the access control to register * @param priority the priority used to order them */ - virtual void registerAccessControl( QgsAccessControlFilter* accessControl /Transfer/, int priority = 0 ) = 0; + virtual void registerAccessControl( QgsAccessControlFilter* accessControl / Transfer / , int priority = 0 ) = 0; /** Gets the registred access control filters */ virtual const QgsAccessControl* accessControls() const = 0; //! Return an enrironment variable, used to pass environment variables to python - virtual QString getEnv(const QString& name ) const = 0; + virtual QString getEnv( const QString& name ) const = 0; /** * Return the configuration file path @@ -110,7 +110,7 @@ class QgsServerInterface * Set the configuration file path * @param configFilePath QString with the configuration file path */ - virtual void setConfigFilePath( const QString& configFilePath) = 0; + virtual void setConfigFilePath( const QString& configFilePath ) = 0; /** * Remove entry from config cache @@ -125,10 +125,10 @@ class QgsServerInterface virtual void removeProjectLayers( const QString& path ) = 0; /** - * Return the service registry + * Return the service registry * @return QgsServiceResgistry */ - virtual QgsServiceRegistry* serviceRegistry() = 0 /KeepReference/; + virtual QgsServiceRegistry* serviceRegistry() = 0 / KeepReference /; private: /** Constructor */ diff --git a/python/server/qgsserverrequest.sip b/python/server/qgsserverrequest.sip index 884f05b8c0f..329e28e75ea 100644 --- a/python/server/qgsserverrequest.sip +++ b/python/server/qgsserverrequest.sip @@ -70,8 +70,8 @@ class QgsServerRequest Method method() const; /** - * * @return query params - * */ + * @return query params + */ QMap parameters() const; /** diff --git a/python/server/qgsserverresponse.sip b/python/server/qgsserverresponse.sip index 46064bc7902..83b844f373a 100644 --- a/python/server/qgsserverresponse.sip +++ b/python/server/qgsserverresponse.sip @@ -51,7 +51,7 @@ class QgsServerResponse * Send error * This method delegates error handling at the server level. This is different * from calling setReturnCode() along with and a specific response body. - * @param code HHTP return code value + * @param code HTTP return code value * @param message An informative error message */ virtual void sendError( int code, const QString& message ) = 0; @@ -61,7 +61,7 @@ class QgsServerResponse * This is a convenient method that will write directly * to the underlying I/O device */ - virtual void write(const QString& data ); + virtual void write( const QString& data ); /** * Write chunk of data @@ -69,7 +69,7 @@ class QgsServerResponse * underlying I/O device * @return the number of bytes that were actually written */ - virtual qint64 write(const QByteArray& byteArray ); + virtual qint64 write( const QByteArray& byteArray ); /** * Return the underlying QIODevice diff --git a/src/server/qgsserver.h b/src/server/qgsserver.h index 31f6b342b84..e6b400d47ba 100644 --- a/src/server/qgsserver.h +++ b/src/server/qgsserver.h @@ -60,7 +60,7 @@ class SERVER_EXPORT QgsServer * @param var environment variable name * @param val value * @note added in 2.14 - / */ + */ void putenv( const QString &var, const QString &val ); /** Handles the request. The output is normally printed trough FCGI printf @@ -129,7 +129,7 @@ class SERVER_EXPORT QgsServer //! service registry static QgsServiceRegistry sServiceRegistry; - + }; #endif // QGSSERVER_H diff --git a/src/server/qgsserverinterface.h b/src/server/qgsserverinterface.h index d94cd74b5e4..3a3ba0bee81 100644 --- a/src/server/qgsserverinterface.h +++ b/src/server/qgsserverinterface.h @@ -134,7 +134,7 @@ class SERVER_EXPORT QgsServerInterface virtual void removeProjectLayers( const QString& path ) = 0; /** - * Return the service registry + * Return the service registry * @return QgsServiceResgistry */ virtual QgsServiceRegistry* serviceRegistry() = 0; diff --git a/src/server/qgsserverinterfaceimpl.cpp b/src/server/qgsserverinterfaceimpl.cpp index f36ecbd9b2c..6b4827da961 100644 --- a/src/server/qgsserverinterfaceimpl.cpp +++ b/src/server/qgsserverinterfaceimpl.cpp @@ -24,7 +24,7 @@ //! Constructor QgsServerInterfaceImpl::QgsServerInterfaceImpl( QgsCapabilitiesCache* capCache, QgsServiceRegistry* srvRegistry ) : mCapabilitiesCache( capCache ) - , mServiceRegistry(srvRegistry) + , mServiceRegistry( srvRegistry ) { mRequestHandler = nullptr; mAccessControls = new QgsAccessControl(); @@ -92,6 +92,6 @@ void QgsServerInterfaceImpl::removeProjectLayers( const QString& path ) QgsServiceRegistry* QgsServerInterfaceImpl::serviceRegistry() { - return mServiceRegistry; + return mServiceRegistry; } diff --git a/src/server/qgsserverresponse.h b/src/server/qgsserverresponse.h index 1149628bb3d..80e300903e9 100644 --- a/src/server/qgsserverresponse.h +++ b/src/server/qgsserverresponse.h @@ -56,7 +56,9 @@ class SERVER_EXPORT QgsServerResponse /** * Send error * This method delegates error handling at the server level. This is different - * from calling setReturnCode() along with and a specific response body. + * from calling setReturnCode() wich let you return a specific response body. + * Calling sendError() will end the transaction and any attempt to write data + * or set headers will be an error. * @param code HHTP return code value * @param message An informative error message */ diff --git a/src/server/qgsservicenativeloader.cpp b/src/server/qgsservicenativeloader.cpp index 09a5718216e..5618b0319dc 100644 --- a/src/server/qgsservicenativeloader.cpp +++ b/src/server/qgsservicenativeloader.cpp @@ -55,7 +55,7 @@ QgsServiceNativeLoader::~QgsServiceNativeLoader() } void QgsServiceNativeLoader::loadModules( const QString& modulePath, QgsServiceRegistry& registrar, - QgsServerInterface* serverIface ) + QgsServerInterface* serverIface ) { QDir moduleDir( modulePath ); moduleDir.setSorting( QDir::Name | QDir::IgnoreCase ); diff --git a/src/server/qgsservicenativeloader.h b/src/server/qgsservicenativeloader.h index 7bb2064fedd..1a7b3e9b5cf 100644 --- a/src/server/qgsservicenativeloader.h +++ b/src/server/qgsservicenativeloader.h @@ -49,10 +49,10 @@ class SERVER_EXPORT QgsServiceNativeLoader * Lead all medules from path * @param modulePath the path to look for module * @param registrar QgsServiceRegistry instance for registering services - * @param serverIface QgsServerInterface instarce + * @param serverIface QgsServerInterface instarce */ void loadModules( const QString& modulePath, QgsServiceRegistry& registrar, - QgsServerInterface* serverIface = nullptr ); + QgsServerInterface* serverIface = nullptr ); /** * Unload all modules diff --git a/src/server/qgsserviceregistry.h b/src/server/qgsserviceregistry.h index d38a4e7272c..d11830f68d9 100644 --- a/src/server/qgsserviceregistry.h +++ b/src/server/qgsserviceregistry.h @@ -89,10 +89,10 @@ class SERVER_EXPORT QgsServiceRegistry /** * Initialize registry, load modules and auto register services - * @param serverIface the server interface + * @param serverIface the server interface * @param nativeModulepath the native module path */ - void init( const QString& nativeModulepath, QgsServerInterface* serverIface =nullptr ); + void init( const QString& nativeModulepath, QgsServerInterface* serverIface = nullptr ); /** * Clean up registered service and unregister modules