Skip to content

Commit

Permalink
Add a takeLayer method
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Mar 2, 2018
1 parent 1ad02ad commit 941aa0a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/core/qgsvirtuallayertask.sip.in
Expand Up @@ -34,6 +34,11 @@ Constructor.
QgsVectorLayer *layer();
%Docstring
Returns the underlying virtual layer.
%End

QgsVectorLayer *takeLayer();
%Docstring
Returns the underlying virtual layer and ownership.
%End

QgsVirtualLayerDefinition definition() const;
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgsvirtuallayertask.cpp
Expand Up @@ -52,6 +52,11 @@ QgsVectorLayer *QgsVirtualLayerTask::layer()
return mLayer.get();
}

QgsVectorLayer *QgsVirtualLayerTask::takeLayer()
{
return mLayer.release();
}

void QgsVirtualLayerTask::cancel()
{
mLayer->dataProvider()->cancel();
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgsvirtuallayertask.h
Expand Up @@ -47,6 +47,11 @@ class CORE_EXPORT QgsVirtualLayerTask : public QgsTask
*/
QgsVectorLayer *layer();

/**
* Returns the underlying virtual layer and ownership.
*/
QgsVectorLayer *takeLayer();

/**
* Returns the virtual layer definition.
*/
Expand Down

0 comments on commit 941aa0a

Please sign in to comment.