Skip to content
Permalink
Browse files

Allow 3rd-party data item providers to be plugged

  • Loading branch information
wonder-sk committed Mar 4, 2015
1 parent 68c5e39 commit d6f0dbd40348eea298f1dbab3a32eb2c861583cb
@@ -13,6 +13,12 @@ class QgsDataItemProviderRegistry
//! Get list of available providers
QList<QgsDataItemProvider*> providers() const;

//! Add a provider implementation. Takes ownership of the object.
void addProvider( QgsDataItemProvider* provider /Transfer/ );

//! Remove provider implementation from the list (provider object is deleted)
void removeProvider( QgsDataItemProvider* provider );

private:
QgsDataItemProviderRegistry();

@@ -84,3 +84,14 @@ QgsDataItemProviderRegistry::~QgsDataItemProviderRegistry()
qDeleteAll( mProviders );
}

void QgsDataItemProviderRegistry::addProvider( QgsDataItemProvider* provider )
{
mProviders.append( provider );
}

void QgsDataItemProviderRegistry::removeProvider( QgsDataItemProvider* provider )
{
int index = mProviders.indexOf( provider );
if ( index >= 0 )
delete mProviders.takeAt( index );
}
@@ -36,6 +36,12 @@ class CORE_EXPORT QgsDataItemProviderRegistry : public QgsSingleton<QgsDataItemP
//! Get list of available providers
QList<QgsDataItemProvider*> providers() const { return mProviders; }

//! Add a provider implementation. Takes ownership of the object.
void addProvider( QgsDataItemProvider* provider );

//! Remove provider implementation from the list (provider object is deleted)
void removeProvider( QgsDataItemProvider* provider );

private:
QgsDataItemProviderRegistry();

0 comments on commit d6f0dbd

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