Skip to content
Permalink
Browse files

The providers plugin path can be changed in the applications.

  • Loading branch information
gshegunov authored and m-kuhn committed Dec 15, 2015
1 parent 0a7e3f5 commit 9fdab87056dd22a33fb7e8eab679ae45fdfbb31a
Showing with 17 additions and 3 deletions.
  1. +14 −3 src/core/qgsproviderregistry.cpp
  2. +3 −0 src/core/qgsproviderregistry.h
@@ -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;

0 comments on commit 9fdab87

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