Skip to content

Commit

Permalink
Revert 38f4a6f
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 5, 2017
1 parent 4d8f886 commit 1d504ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
8 changes: 3 additions & 5 deletions src/core/qgsvectorlayercache.cpp
Expand Up @@ -58,9 +58,9 @@ int QgsVectorLayerCache::cacheSize()

void QgsVectorLayerCache::setCacheGeometry( bool cacheGeometry )
{
bool shouldCache = cacheGeometry && mLayer->hasGeometryType();
bool mustInvalidate = shouldCache && !mCacheGeometry; // going from no geometry -> geometry, so have to clear existing cache entries
mCacheGeometry = shouldCache;
bool shouldCacheGeometry = cacheGeometry && mLayer->hasGeometryType();
bool mustInvalidate = shouldCacheGeometry && !mCacheGeometry; // going from no geometry -> geometry, so have to clear existing cache entries
mCacheGeometry = shouldCacheGeometry;
if ( cacheGeometry )
{
connect( mLayer, &QgsVectorLayer::geometryChanged, this, &QgsVectorLayerCache::geometryChanged );
Expand Down Expand Up @@ -237,7 +237,6 @@ void QgsVectorLayerCache::attributeAdded( int field )
{
Q_UNUSED( field )
mCachedAttributes.append( field );
mFullCache = false;
mCache.clear();
}

Expand Down Expand Up @@ -274,7 +273,6 @@ void QgsVectorLayerCache::layerDeleted()
void QgsVectorLayerCache::invalidate()
{
mCache.clear();
mFullCache = false;
emit invalidated();
}

Expand Down
7 changes: 0 additions & 7 deletions tests/src/core/testqgsvectorlayercache.cpp
Expand Up @@ -384,13 +384,6 @@ void TestVectorLayerCache::testCacheGeom()
{
QVERIFY( f.hasGeometry() );
}

// another test...
cache.setCacheGeometry( false );
cache.setFullCache( true );
QVERIFY( cache.hasFullCache() );
cache.setCacheGeometry( true );
QVERIFY( !cache.hasFullCache() );
}

void TestVectorLayerCache::onCommittedFeaturesAdded( const QString &layerId, const QgsFeatureList &features )
Expand Down

0 comments on commit 1d504ea

Please sign in to comment.