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

This commit is contained in:
Blottiere Paul 2018-03-02 09:41:58 +00:00
parent 1a5e03f667
commit e531052b28
6 changed files with 13 additions and 10 deletions

View File

@ -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 );

View File

@ -804,7 +804,7 @@ QTextCodec *QgsVectorDataProvider::textEncoding() const
return mEncoding;
}
bool QgsVectorDataProvider::cancel()
bool QgsVectorDataProvider::cancelReload()
{
return false;
}

View File

@ -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.

View File

@ -59,6 +59,6 @@ QgsVectorLayer *QgsVirtualLayerTask::takeLayer()
void QgsVirtualLayerTask::cancel()
{
mLayer->dataProvider()->cancel();
mLayer->dataProvider()->cancelReload();
QgsTask::cancel();
}

View File

@ -455,7 +455,7 @@ bool QgsVirtualLayerProvider::createIt()
return true;
}
bool QgsVirtualLayerProvider::cancel()
bool QgsVirtualLayerProvider::cancelReload()
{
return mSqlite.interrupt();
}

View File

@ -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: