File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ void QgsVectorLayerCache::attributeAdded( int field )
237
237
{
238
238
Q_UNUSED ( field )
239
239
mCachedAttributes .append ( field );
240
+ mFullCache = false ;
240
241
mCache .clear ();
241
242
}
242
243
@@ -273,6 +274,7 @@ void QgsVectorLayerCache::layerDeleted()
273
274
void QgsVectorLayerCache::invalidate ()
274
275
{
275
276
mCache .clear ();
277
+ mFullCache = false ;
276
278
emit invalidated ();
277
279
}
278
280
Original file line number Diff line number Diff line change @@ -242,6 +242,15 @@ void TestVectorLayerCache::testFullCache()
242
242
{
243
243
QVERIFY ( cache.isFidCached ( f.id () ) );
244
244
}
245
+
246
+ // add a feature to the layer
247
+ mPointsLayer ->startEditing ();
248
+ QgsFeature f2 ( mPointsLayer ->fields () );
249
+ QVERIFY ( mPointsLayer ->addFeature ( f2 ) );
250
+ QVERIFY ( cache.hasFullCache () );
251
+ QVERIFY ( cache.isFidCached ( f2.id () ) );
252
+
253
+ mPointsLayer ->rollBack ();
245
254
}
246
255
247
256
void TestVectorLayerCache::testFullCacheThroughRequest ()
@@ -375,6 +384,13 @@ void TestVectorLayerCache::testCacheGeom()
375
384
{
376
385
QVERIFY ( f.hasGeometry () );
377
386
}
387
+
388
+ // another test...
389
+ cache.setCacheGeometry ( false );
390
+ cache.setFullCache ( true );
391
+ QVERIFY ( cache.hasFullCache () );
392
+ cache.setCacheGeometry ( true );
393
+ QVERIFY ( !cache.hasFullCache () );
378
394
}
379
395
380
396
void TestVectorLayerCache::onCommittedFeaturesAdded ( const QString &layerId, const QgsFeatureList &features )
You can’t perform that action at this time.
0 commit comments