Skip to content
Permalink
Browse files

Add QgsDataProvider::invalidateConnections() and implement in Spatial…

…ite provider

This invalidates all cached connections to the given database name.
This will be used by the WFS provider to cleanup any cached connections before
removing its temporary Spatialite DB

(cherry-picked from 62bd406, necessary for offline plugin fix)
  • Loading branch information
rouault authored and dakcarto committed Apr 22, 2016
1 parent 0c54862 commit 21a2f412c3dcc73b7762a11e2bdba54b2e78b26c
@@ -218,6 +218,11 @@ class QgsDataProvider : QObject
*/
virtual QgsError error() const;

/** Invalidate connections corresponding to specified name
* @note added in QGIS 2.16
*/
virtual void invalidateConnections( const QString& connection );

signals:

/**
@@ -306,6 +306,11 @@ class CORE_EXPORT QgsDataProvider : public QObject
*/
virtual QgsError error() const { return mError; }

/** Invalidate connections corresponding to specified name
* @note added in QGIS 2.16
*/
virtual void invalidateConnections( const QString& connection ) { Q_UNUSED( connection ); }

signals:

/**
@@ -5001,7 +5001,10 @@ const QgsField & QgsSpatiaLiteProvider::field( int index ) const
return attributeFields[index];
}


void QgsSpatiaLiteProvider::invalidateConnections( const QString& connection )
{
QgsSpatiaLiteConnPool::instance()->invalidateConnections( connection );
}

/**
* Class factory to return a pointer to a newly created
@@ -233,6 +233,8 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
*/
QgsAttributeList pkAttributeIndexes() override;

void invalidateConnections( const QString& connection ) override;

signals:
/**
* This is emitted whenever the worker thread has fully calculated the

0 comments on commit 21a2f41

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