mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
The providers plugin path can be changed in the applications.
This commit is contained in:
parent
0a7e3f5e2b
commit
9fdab87056
@ -69,6 +69,12 @@ QgsProviderRegistry::QgsProviderRegistry( const QString& pluginPath )
|
||||
QString mLibraryDirectory = baseDir + "/lib";
|
||||
#endif
|
||||
mLibraryDirectory = pluginPath;
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
void QgsProviderRegistry::init()
|
||||
{
|
||||
mLibraryDirectory.setSorting( QDir::Name | QDir::IgnoreCase );
|
||||
mLibraryDirectory.setFilter( QDir::Files | QDir::NoSymLinks );
|
||||
|
||||
@ -220,7 +226,7 @@ QgsProviderRegistry::QgsProviderRegistry( const QString& pluginPath )
|
||||
// typedef for the unload dataprovider function
|
||||
typedef void cleanupProviderFunction_t();
|
||||
|
||||
QgsProviderRegistry::~QgsProviderRegistry()
|
||||
void QgsProviderRegistry::clean()
|
||||
{
|
||||
QgsMapLayerRegistry::instance()->removeAllMapLayers();
|
||||
|
||||
@ -242,6 +248,11 @@ QgsProviderRegistry::~QgsProviderRegistry()
|
||||
}
|
||||
}
|
||||
|
||||
QgsProviderRegistry::~QgsProviderRegistry()
|
||||
{
|
||||
clean();
|
||||
}
|
||||
|
||||
|
||||
/** Convenience function for finding any existing data providers that match "providerKey"
|
||||
|
||||
@ -313,13 +324,13 @@ QString QgsProviderRegistry::pluginList( bool asHTML ) const
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
void QgsProviderRegistry::setLibraryDirectory( QDir const & path )
|
||||
{
|
||||
mLibraryDirectory = path;
|
||||
clean();
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
QDir const & QgsProviderRegistry::libraryDirectory() const
|
||||
{
|
||||
return mLibraryDirectory;
|
||||
|
@ -172,6 +172,9 @@ class CORE_EXPORT QgsProviderRegistry
|
||||
/** Ctor private since instance() creates it */
|
||||
QgsProviderRegistry( const QString& pluginPath );
|
||||
|
||||
void init();
|
||||
void clean();
|
||||
|
||||
/** Associative container of provider metadata handles */
|
||||
Providers mProviders;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user