Make QgsVectorLayerExporter::flushBuffer public

Sometimes it's necessary to manually call this, instead of
deleting the exporter and letting it be called automatically
There's a chance that features in the buffer will cause errors
while being exported, and if the only way to flush the buffer
is to delete the exporter then there's no way to detect or
retrieve these errors.
This commit is contained in:
Nyall Dawson 2017-06-22 18:19:05 +10:00
parent f304828f59
commit 1b696a7f65
2 changed files with 13 additions and 2 deletions

View File

@ -124,6 +124,13 @@ class QgsVectorLayerExporter : QgsFeatureSink
Finalizes the export and closes the new created layer.
%End
bool flushBuffer();
%Docstring
Flush the buffer writing the features to the new layer.
.. versionadded:: 3.0
:rtype: bool
%End
private:
QgsVectorLayerExporter( const QgsVectorLayerExporter &rh );
};

View File

@ -141,10 +141,14 @@ class CORE_EXPORT QgsVectorLayerExporter : public QgsFeatureSink
*/
~QgsVectorLayerExporter();
private:
//! Flush the buffer writing the features to the new layer
/**
* Flush the buffer writing the features to the new layer.
* \since QGIS 3.0
*/
bool flushBuffer();
private:
//! Create index
bool createSpatialIndex();