Skip to content

Commit

Permalink
Refine QgsFeatureRequest timeout api, dox
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 6, 2018
1 parent d8b20e7 commit 7027763
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions python/core/auto_generated/qgsfeaturerequest.sip.in
Expand Up @@ -637,7 +637,7 @@ Check if a feature is accepted by this requests filter

int connectionTimeout() const;
%Docstring
The timeout for how long we should wait for a connection if none is available from the pool
Returns the timeout (in milliseconds) for how long we should wait for a connection if none is available from the pool
at this moment. A negative value (which is set by default) will wait forever.

.. note::
Expand All @@ -647,9 +647,9 @@ at this moment. A negative value (which is set by default) will wait forever.
.. versionadded:: 3.0
%End

void setConnectionTimeout( int connectionTimeout );
QgsFeatureRequest &setConnectionTimeout( int connectionTimeout );
%Docstring
The timeout for how long we should wait for a connection if none is available from the pool
Sets the timeout (in milliseconds) for how long we should wait for a connection if none is available from the pool
at this moment. A negative value (which is set by default) will wait forever.

.. note::
Expand All @@ -673,7 +673,7 @@ expression function.
.. versionadded:: 3.4
%End

void setRequestMayBeNested( bool requestMayBeNested );
QgsFeatureRequest &setRequestMayBeNested( bool requestMayBeNested );
%Docstring
In case this request may be run nested within another already running
iteration on the same connection, set this to true.
Expand Down
6 changes: 4 additions & 2 deletions src/core/qgsfeaturerequest.cpp
Expand Up @@ -294,19 +294,21 @@ int QgsFeatureRequest::connectionTimeout() const
return mConnectionTimeout;
}

void QgsFeatureRequest::setConnectionTimeout( int connectionTimeout )
QgsFeatureRequest &QgsFeatureRequest::setConnectionTimeout( int connectionTimeout )
{
mConnectionTimeout = connectionTimeout;
return *this;
}

bool QgsFeatureRequest::requestMayBeNested() const
{
return mRequestMayBeNested;
}

void QgsFeatureRequest::setRequestMayBeNested( bool requestMayBeNested )
QgsFeatureRequest &QgsFeatureRequest::setRequestMayBeNested( bool requestMayBeNested )
{
mRequestMayBeNested = requestMayBeNested;
return *this;
}


Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsfeaturerequest.h
Expand Up @@ -617,7 +617,7 @@ class CORE_EXPORT QgsFeatureRequest
bool acceptFeature( const QgsFeature &feature );

/**
* The timeout for how long we should wait for a connection if none is available from the pool
* Returns the timeout (in milliseconds) for how long we should wait for a connection if none is available from the pool
* at this moment. A negative value (which is set by default) will wait forever.
*
* \note Only works if the provider supports this option.
Expand All @@ -627,14 +627,14 @@ class CORE_EXPORT QgsFeatureRequest
int connectionTimeout() const;

/**
* The timeout for how long we should wait for a connection if none is available from the pool
* Sets the timeout (in milliseconds) for how long we should wait for a connection if none is available from the pool
* at this moment. A negative value (which is set by default) will wait forever.
*
* \note Only works if the provider supports this option.
*
* \since QGIS 3.0
*/
void setConnectionTimeout( int connectionTimeout );
QgsFeatureRequest &setConnectionTimeout( int connectionTimeout );

/**
* In case this request may be run nested within another already running
Expand Down Expand Up @@ -662,7 +662,7 @@ class CORE_EXPORT QgsFeatureRequest
*
* \since QGIS 3.4
*/
void setRequestMayBeNested( bool requestMayBeNested );
QgsFeatureRequest &setRequestMayBeNested( bool requestMayBeNested );

protected:
FilterType mFilter = FilterNone;
Expand Down

0 comments on commit 7027763

Please sign in to comment.