Navigation Menu

Skip to content

Commit

Permalink
Make QgsVectorLayerExporter::flushBuffer public
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nyalldawson committed Jun 22, 2017
1 parent f304828 commit 1b696a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions python/core/qgsvectorlayerexporter.sip
Expand Up @@ -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 );
};
Expand Down
8 changes: 6 additions & 2 deletions src/core/qgsvectorlayerexporter.h
Expand Up @@ -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();

Expand Down

0 comments on commit 1b696a7

Please sign in to comment.