Skip to content
Permalink
Browse files

Clear supports enum values cache when attributes change

  • Loading branch information
elpaso committed Feb 20, 2019
1 parent 4f30a44 commit 7627fb20fdb2a8c83b5cef79913391b5547ab214
Showing with 11 additions and 0 deletions.
  1. +10 −0 src/providers/postgres/qgspostgresprovider.cpp
  2. +1 −0 src/providers/postgres/qgspostgresprovider.h
@@ -711,6 +711,10 @@ struct PGTypeInfo

bool QgsPostgresProvider::loadFields()
{

// Clear cached information about enum values support
mShared->clearSupportsEnumValuesCache();

if ( !mIsQuery )
{
QgsDebugMsg( QStringLiteral( "Loading fields for table %1" ).arg( mTableName ) );
@@ -5175,6 +5179,12 @@ void QgsPostgresSharedData::clear()
mFidCounter = 0;
}

void QgsPostgresSharedData::clearSupportsEnumValuesCache()
{
QMutexLocker locker( &mMutex );
mFieldSupportsEnumValues.clear();
}

bool QgsPostgresSharedData::fieldSupportsEnumValuesIsSet( int index )
{
QMutexLocker locker( &mMutex );
@@ -522,6 +522,7 @@ class QgsPostgresSharedData
QVariantList lookupKey( QgsFeatureId featureId );
void clear();

void clearSupportsEnumValuesCache( );
bool fieldSupportsEnumValuesIsSet( int index );
bool fieldSupportsEnumValues( int index );
void setFieldSupportsEnumValues( int index, bool isSupported );

0 comments on commit 7627fb2

Please sign in to comment.
You can’t perform that action at this time.