Skip to content
Permalink
Browse files

Flush capabilities cache when flushing project layers

Made by @dmarteau
  • Loading branch information
rldhont committed Jun 28, 2016
1 parent bf53e4c commit 7dcb9ccc6e9f11bf869e4e0b00d01a6bc7f04e3f
@@ -61,6 +61,12 @@ void QgsCapabilitiesCache::insertCapabilitiesDocument( const QString& configFile
mCachedCapabilities[ configFilePath ].insert( key, doc->cloneNode().toDocument() );
}

void QgsCapabilitiesCache::removeCapabilitiesDocument( const QString& path )
{
mCachedCapabilities.remove( path );
mFileSystemWatcher.removePath( path );
}

void QgsCapabilitiesCache::removeChangedEntry( const QString& path )
{
QgsDebugMsg( "Remove capabilities cache entry because file changed" );
@@ -44,6 +44,11 @@ class SERVER_EXPORT QgsCapabilitiesCache : public QObject
*/
void insertCapabilitiesDocument( const QString& configFilePath, const QString& key, const QDomDocument* doc );

/** Remove capabilities document
* @param configFilePath the project file path
*/
void removeCapabilitiesDocument( const QString& path );

private:
QHash< QString, QHash< QString, QDomDocument > > mCachedCapabilities;
QFileSystemWatcher mFileSystemWatcher;
@@ -77,6 +77,10 @@ void QgsServerInterfaceImpl::registerAccessControl( QgsAccessControlFilter* acce

void QgsServerInterfaceImpl::removeConfigCacheEntry( const QString& path )
{
if( mCapabilitiesCache )
{
mCapabilitiesCache->removeCapabilitiesDocument( path );
}
QgsConfigCache::instance()->removeEntry( path );
}

0 comments on commit 7dcb9cc

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