31 const auto constProvidersList = providersList;
32 for (
const QString &key : constProvidersList )
35 mProviders << providerList;
36 for (
const auto &p : std::as_const( providerList ) )
38 if ( ! p->dataProviderKey().isEmpty() )
40 mDataItemProviderOrigin[ p->name() ] = p->dataProviderKey();
48 qDeleteAll( mProviders );
55 for (
const auto &p : std::as_const( mProviders ) )
57 if ( p->name() == providerName )
77 int index = mProviders.indexOf(
provider );
81 delete mProviders.takeAt( index );
87 return mDataItemProviderOrigin.value( dataItemProviderName, QString() );
QList< QgsDataItemProvider * > providers() const
Returns the list of available providers.
QString dataProviderKey(const QString &dataItemProviderName)
Returns the (possibly blank) data provider key for a given data item provider name.
void providerWillBeRemoved(QgsDataItemProvider *provider)
Emitted when a data item provider is about to be removed.
~QgsDataItemProviderRegistry()
void removeProvider(QgsDataItemProvider *provider)
Removes a provider implementation from the registry.
void providerAdded(QgsDataItemProvider *provider)
Emitted when a new data item provider has been added.
void addProvider(QgsDataItemProvider *provider)
Adds a provider implementation to the registry.
QgsDataItemProviderRegistry()
QgsDataItemProvider * provider(const QString &providerName) const
Returns the (possibly nullptr) data item provider named providerName.
This is the interface for those who want to add custom data items to the browser tree.
virtual QString dataProviderKey() const
Returns the data provider key (if the data item provider is associated with a data provider),...
virtual QString name()=0
Human-readable name of the provider name.
A data item provider for file based data sources.
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
QList< QgsDataItemProvider * > dataItemProviders(const QString &providerKey) const
Returns list of data item providers of the provider.
QStringList providerList() const
Returns list of available providers by their keys.