26 qDeleteAll( mBackends );
31 return mBackends.value( type,
nullptr );
36 for (
auto it = mBackends.constBegin(); it != mBackends.constEnd(); ++it )
39 const QString scheme = storage->
type() +
':';
40 if ( uri.startsWith( scheme ) )
48 return mBackends.values();
53 mBackends.insert( storage->
type(), storage );
58 delete mBackends.take( storage->
type() );
63 if ( !providerGuiRegistry )
66 const QStringList providersList = providerGuiRegistry->
providerList();
67 for (
const QString &key : providersList )
73 mBackends[key] = provider;
Abstract interface for project storage GUI - to be implemented by various backends and registered in ...
virtual QString type()=0
Unique identifier of the project storage type.
~QgsProjectStorageGuiRegistry()
QgsProjectStorageGuiProvider * projectStorageFromType(const QString &type)
Returns storage implementation if the storage type matches one. Returns nullptr otherwise (it is a no...
void unregisterProjectStorage(QgsProjectStorageGuiProvider *storage)
Unregisters a storage backend and destroys its instance.
QList< QgsProjectStorageGuiProvider * > projectStorages() const
Returns a list of registered project storage implementations.
void registerProjectStorage(QgsProjectStorageGuiProvider *storage)
Registers a storage backend and takes ownership of it.
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
QgsProjectStorageGuiProvider * projectStorageFromUri(const QString &uri)
Returns storage implementation if the URI matches one. Returns nullptr otherwise (it is a normal file...
QgsProjectStorageGuiRegistry()
A registry / canonical manager of GUI parts of data providers.
virtual QList< QgsProjectStorageGuiProvider * > projectStorageGuiProviders(const QString &providerKey)
Returns all project storage gui providers registered in provider with providerKey.
QStringList providerList() const
Returns list of available providers by their keys.