Skip to content

Commit e531052

Browse files
committedMar 2, 2018
Rename cancel() to cancelReload() and update doc accordingly
1 parent 1a5e03f commit e531052

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed
 

‎python/core/qgsvectordataprovider.sip.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,15 @@ Providers with the FastTruncate capability will use an optimised method to trunc
232232
.. seealso:: :py:func:`deleteFeatures`
233233
%End
234234

235-
virtual bool cancel();
235+
virtual bool cancelReload();
236236
%Docstring
237-
Cancels the pending query.
237+
Cancels the current reloading of data.
238238

239-
:return: true if the pending query has been interrupted, false otherwise
239+
:return: true if the reloading has been correctly interrupted, false otherwise
240240

241241
.. versionadded:: 3.2
242+
243+
.. seealso:: :py:func:`reloadData`
242244
%End
243245

244246
virtual bool addAttributes( const QList<QgsField> &attributes );

‎src/core/qgsvectordataprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ QTextCodec *QgsVectorDataProvider::textEncoding() const
804804
return mEncoding;
805805
}
806806

807-
bool QgsVectorDataProvider::cancel()
807+
bool QgsVectorDataProvider::cancelReload()
808808
{
809809
return false;
810810
}

‎src/core/qgsvectordataprovider.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,12 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeat
250250
virtual bool truncate();
251251

252252
/**
253-
* Cancels the pending query.
254-
* \returns true if the pending query has been interrupted, false otherwise
253+
* Cancels the current reloading of data.
254+
* \returns true if the reloading has been correctly interrupted, false otherwise
255255
* \since QGIS 3.2
256+
* \see reloadData()
256257
*/
257-
virtual bool cancel();
258+
virtual bool cancelReload();
258259

259260
/**
260261
* Adds new \a attributes to the provider. Returns true in case of success and false in case of failure.

‎src/core/qgsvirtuallayertask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ QgsVectorLayer *QgsVirtualLayerTask::takeLayer()
5959

6060
void QgsVirtualLayerTask::cancel()
6161
{
62-
mLayer->dataProvider()->cancel();
62+
mLayer->dataProvider()->cancelReload();
6363
QgsTask::cancel();
6464
}

‎src/providers/virtual/qgsvirtuallayerprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ bool QgsVirtualLayerProvider::createIt()
455455
return true;
456456
}
457457

458-
bool QgsVirtualLayerProvider::cancel()
458+
bool QgsVirtualLayerProvider::cancelReload()
459459
{
460460
return mSqlite.interrupt();
461461
}

‎src/providers/virtual/qgsvirtuallayerprovider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class QgsVirtualLayerProvider: public QgsVectorDataProvider
5353
QString description() const override;
5454
QgsAttributeList pkAttributeIndexes() const override;
5555
QSet<QgsMapLayerDependency> dependencies() const override;
56-
bool cancel() override;
56+
bool cancelReload() override;
5757
void reloadData() override;
5858

5959
private:

0 commit comments

Comments
 (0)
Please sign in to comment.