17#include "moc_qgsdataitemproviderregistry.cpp"
32 const auto constProvidersList = providersList;
33 for (
const QString &key : constProvidersList )
36 mProviders << providerList;
37 for (
const auto &p : std::as_const( providerList ) )
39 if ( ! p->dataProviderKey().isEmpty() )
41 mDataItemProviderOrigin[ p->name() ] = p->dataProviderKey();
49 qDeleteAll( mProviders );
56 for (
const auto &p : std::as_const( mProviders ) )
58 if ( p->name() == providerName )
78 int index = mProviders.indexOf(
provider );
82 delete mProviders.takeAt( index );
88 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.