Skip to content

Commit 1b696a7

Browse files
committed
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.
1 parent f304828 commit 1b696a7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

python/core/qgsvectorlayerexporter.sip

+7
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ class QgsVectorLayerExporter : QgsFeatureSink
124124
Finalizes the export and closes the new created layer.
125125
%End
126126

127+
bool flushBuffer();
128+
%Docstring
129+
Flush the buffer writing the features to the new layer.
130+
.. versionadded:: 3.0
131+
:rtype: bool
132+
%End
133+
127134
private:
128135
QgsVectorLayerExporter( const QgsVectorLayerExporter &rh );
129136
};

src/core/qgsvectorlayerexporter.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,14 @@ class CORE_EXPORT QgsVectorLayerExporter : public QgsFeatureSink
141141
*/
142142
~QgsVectorLayerExporter();
143143

144-
private:
145-
//! Flush the buffer writing the features to the new layer
144+
/**
145+
* Flush the buffer writing the features to the new layer.
146+
* \since QGIS 3.0
147+
*/
146148
bool flushBuffer();
147149

150+
private:
151+
148152
//! Create index
149153
bool createSpatialIndex();
150154

0 commit comments

Comments
 (0)