Skip to content

Commit 7027763

Browse files
committed
Refine QgsFeatureRequest timeout api, dox
1 parent d8b20e7 commit 7027763

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

python/core/auto_generated/qgsfeaturerequest.sip.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ Check if a feature is accepted by this requests filter
637637

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

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

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

655655
.. note::
@@ -673,7 +673,7 @@ expression function.
673673
.. versionadded:: 3.4
674674
%End
675675

676-
void setRequestMayBeNested( bool requestMayBeNested );
676+
QgsFeatureRequest &setRequestMayBeNested( bool requestMayBeNested );
677677
%Docstring
678678
In case this request may be run nested within another already running
679679
iteration on the same connection, set this to true.

src/core/qgsfeaturerequest.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,19 +294,21 @@ int QgsFeatureRequest::connectionTimeout() const
294294
return mConnectionTimeout;
295295
}
296296

297-
void QgsFeatureRequest::setConnectionTimeout( int connectionTimeout )
297+
QgsFeatureRequest &QgsFeatureRequest::setConnectionTimeout( int connectionTimeout )
298298
{
299299
mConnectionTimeout = connectionTimeout;
300+
return *this;
300301
}
301302

302303
bool QgsFeatureRequest::requestMayBeNested() const
303304
{
304305
return mRequestMayBeNested;
305306
}
306307

307-
void QgsFeatureRequest::setRequestMayBeNested( bool requestMayBeNested )
308+
QgsFeatureRequest &QgsFeatureRequest::setRequestMayBeNested( bool requestMayBeNested )
308309
{
309310
mRequestMayBeNested = requestMayBeNested;
311+
return *this;
310312
}
311313

312314

src/core/qgsfeaturerequest.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ class CORE_EXPORT QgsFeatureRequest
617617
bool acceptFeature( const QgsFeature &feature );
618618

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

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

639639
/**
640640
* In case this request may be run nested within another already running
@@ -662,7 +662,7 @@ class CORE_EXPORT QgsFeatureRequest
662662
*
663663
* \since QGIS 3.4
664664
*/
665-
void setRequestMayBeNested( bool requestMayBeNested );
665+
QgsFeatureRequest &setRequestMayBeNested( bool requestMayBeNested );
666666

667667
protected:
668668
FilterType mFilter = FilterNone;

0 commit comments

Comments
 (0)