Skip to content
Permalink
Browse files

Rename cancel() to cancelReload() and update doc accordingly

  • Loading branch information
pblottiere committed Mar 2, 2018
1 parent 1a5e03f commit e531052b28cda8759e1dfee43b3b49683f7fe4f9
@@ -232,13 +232,15 @@ Providers with the FastTruncate capability will use an optimised method to trunc
.. seealso:: :py:func:`deleteFeatures`
%End

virtual bool cancel();
virtual bool cancelReload();
%Docstring
Cancels the pending query.
Cancels the current reloading of data.

:return: true if the pending query has been interrupted, false otherwise
:return: true if the reloading has been correctly interrupted, false otherwise

.. versionadded:: 3.2

.. seealso:: :py:func:`reloadData`
%End

virtual bool addAttributes( const QList<QgsField> &attributes );
@@ -804,7 +804,7 @@ QTextCodec *QgsVectorDataProvider::textEncoding() const
return mEncoding;
}

bool QgsVectorDataProvider::cancel()
bool QgsVectorDataProvider::cancelReload()
{
return false;
}
@@ -250,11 +250,12 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeat
virtual bool truncate();

/**
* Cancels the pending query.
* \returns true if the pending query has been interrupted, false otherwise
* Cancels the current reloading of data.
* \returns true if the reloading has been correctly interrupted, false otherwise
* \since QGIS 3.2
* \see reloadData()
*/
virtual bool cancel();
virtual bool cancelReload();

/**
* Adds new \a attributes to the provider. Returns true in case of success and false in case of failure.
@@ -59,6 +59,6 @@ QgsVectorLayer *QgsVirtualLayerTask::takeLayer()

void QgsVirtualLayerTask::cancel()
{
mLayer->dataProvider()->cancel();
mLayer->dataProvider()->cancelReload();
QgsTask::cancel();
}
@@ -455,7 +455,7 @@ bool QgsVirtualLayerProvider::createIt()
return true;
}

bool QgsVirtualLayerProvider::cancel()
bool QgsVirtualLayerProvider::cancelReload()
{
return mSqlite.interrupt();
}
@@ -53,7 +53,7 @@ class QgsVirtualLayerProvider: public QgsVectorDataProvider
QString description() const override;
QgsAttributeList pkAttributeIndexes() const override;
QSet<QgsMapLayerDependency> dependencies() const override;
bool cancel() override;
bool cancelReload() override;
void reloadData() override;

private:

0 comments on commit e531052

Please sign in to comment.
You can’t perform that action at this time.