Skip to content
Permalink
Browse files

Add fast truncate implementation for memory provider

  • Loading branch information
nyalldawson committed Dec 26, 2018
1 parent b0aae0b commit fd0fba70c1ead85ce31b003c1fba204e59d56f5e
@@ -616,9 +616,16 @@ QgsVectorDataProvider::Capabilities QgsMemoryProvider::capabilities() const
{
return AddFeatures | DeleteFeatures | ChangeGeometries |
ChangeAttributeValues | AddAttributes | DeleteAttributes | RenameAttributes | CreateSpatialIndex |
SelectAtId | CircularGeometries;
SelectAtId | CircularGeometries | FastTruncate;
}

bool QgsMemoryProvider::truncate()
{
mFeatures.clear();
clearMinMaxCache();
mExtent.setMinimal();
return true;
}

void QgsMemoryProvider::updateExtents()
{
@@ -68,6 +68,7 @@ class QgsMemoryProvider : public QgsVectorDataProvider
bool supportsSubsetString() const override { return true; }
bool createSpatialIndex() override;
QgsVectorDataProvider::Capabilities capabilities() const override;
bool truncate() override;

/* Implementation of functions from QgsDataProvider */

0 comments on commit fd0fba7

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