File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -942,6 +942,22 @@ QgsVectorLayer::endian_t QgsVectorLayer::endian()
942
942
return (htonl (1 ) == 1 ) ? QgsVectorLayer::XDR : QgsVectorLayer::NDR ;
943
943
}
944
944
945
+ void QgsVectorLayer::cacheGeometries ()
946
+ {
947
+ for (std::map<int , QgsGeometry*>::iterator it = mCachedGeometries .begin (); it != mCachedGeometries .end (); ++it)
948
+ {
949
+ delete it->second ;
950
+ }
951
+ mCachedGeometries .clear ();
952
+ if (dataProvider)
953
+ {
954
+ QgsFeature* f = 0 ;
955
+ while (f = dataProvider->getNextFeature (false ))
956
+ {
957
+ mCachedGeometries .insert (std::make_pair (f->featureId (), f->geometryAndOwnership ()));
958
+ }
959
+ }
960
+ }
945
961
946
962
void QgsVectorLayer::table ()
947
963
{
Original file line number Diff line number Diff line change @@ -557,6 +557,10 @@ protected slots:
557
557
};
558
558
private: // Private methods
559
559
endian_t endian ();
560
+
561
+ /* *Caches all the (commited) geometries to mCachedFeatures, e.g. when entering editing mode*/
562
+ void cacheGeometries ();
563
+
560
564
// pointer for loading the provider library
561
565
QLibrary *myLib;
562
566
// ! Update threshold for drawing features as they are read. A value of zero indicates
You can’t perform that action at this time.
0 commit comments