Skip to content
Permalink
Browse files

Fix test failure, add comments

  • Loading branch information
nyalldawson committed Jul 16, 2018
1 parent 8b77d9e commit 80159c2c36c776b1e6581bb03b6ed55e12c8e60c
@@ -75,19 +75,15 @@ void QgsProcessingToolboxModelNode::deleteChildren()
//

QgsProcessingToolboxModelProviderNode::QgsProcessingToolboxModelProviderNode( QgsProcessingProvider *provider )
: mProvider( provider )
: mProviderId( provider->id() )
, mProvider( provider )
{}

QgsProcessingProvider *QgsProcessingToolboxModelProviderNode::provider()
{
return mProvider;
}

QString QgsProcessingToolboxModelProviderNode::providerId() const
{
return mProvider ? mProvider->id() : QString();
}

//
// QgsProcessingToolboxModelGroupNode
//
@@ -175,11 +175,17 @@ class GUI_EXPORT QgsProcessingToolboxModelProviderNode : public QgsProcessingToo
/**
* Returns the provider ID.
*/
QString providerId() const;
QString providerId() const { return mProviderId; }

private:

QgsProcessingProvider *mProvider = nullptr;
// NOTE: we store both the provider ID and a pointer to the provider here intentionally.
// We store the provider pointer to avoid having to lookup the provider from the registry
// everytime the node is used (which kills performance in the filter proxy model), but
// we also store the provider id string in order to identify the provider that the node
// is linked to for cleanups after the provider is removed.
QString mProviderId;
QPointer< QgsProcessingProvider > mProvider;

};

0 comments on commit 80159c2

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