File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 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 @@ -241,6 +241,15 @@ void TestVectorLayerCache::testFullCache()
241
241
{
242
242
QVERIFY ( cache.isFidCached ( f.id () ) );
243
243
}
244
+
245
+ // add a feature to the layer
246
+ mPointsLayer ->startEditing ();
247
+ QgsFeature f2 ( mPointsLayer ->fields () );
248
+ QVERIFY ( mPointsLayer ->addFeature ( f2 ) );
249
+ QVERIFY ( cache.hasFullCache () );
250
+ QVERIFY ( cache.isFidCached ( f2.id () ) );
251
+
252
+ mPointsLayer ->rollBack ();
244
253
}
245
254
246
255
void TestVectorLayerCache::testFullCacheThroughRequest ()
@@ -374,6 +383,13 @@ void TestVectorLayerCache::testCacheGeom()
374
383
{
375
384
QVERIFY ( f.constGeometry () );
376
385
}
386
+
387
+ // another test...
388
+ cache.setCacheGeometry ( false );
389
+ cache.setFullCache ( true );
390
+ QVERIFY ( cache.hasFullCache () );
391
+ cache.setCacheGeometry ( true );
392
+ QVERIFY ( !cache.hasFullCache () );
377
393
}
378
394
379
395
void TestVectorLayerCache::onCommittedFeaturesAdded ( const QString& layerId, const QgsFeatureList& features )
You can’t perform that action at this time.
0 commit comments