Skip to content
Permalink
Browse files

Dox

  • Loading branch information
nyalldawson committed Jul 16, 2018
1 parent 8caecbb commit 45d856e9037c22db668dc516fc76ab004950910e
@@ -47,7 +47,7 @@ level group containing recently used algorithms.
%Docstring
Sets the processing ``registry`` associated with the view.

If \recentLog is specified then it will be used to create a "Recently used" top
If ``recentLog`` is specified then it will be used to create a "Recently used" top
level group containing recently used algorithms.
%End

@@ -138,10 +138,13 @@ void QgsProcessingToolboxModel::rebuild()
repopulateRecentAlgorithms( true );
}

const QList< QgsProcessingProvider * > providers = mRegistry->providers();
for ( QgsProcessingProvider *provider : providers )
if ( mRegistry )
{
addProvider( provider );
const QList< QgsProcessingProvider * > providers = mRegistry->providers();
for ( QgsProcessingProvider *provider : providers )
{
addProvider( provider );
}
}
endResetModel();
}
@@ -160,6 +163,12 @@ void QgsProcessingToolboxModel::repopulateRecentAlgorithms( bool resetting )
endRemoveRows();
}

if ( !mRegistry )
{
emit recentAlgorithmAdded();
return;
}

const QStringList recentAlgIds = mRecentLog->recentAlgorithmIds();
QList< const QgsProcessingAlgorithm * > recentAlgorithms;
recentAlgorithms.reserve( recentAlgIds.count() );
@@ -196,6 +205,9 @@ void QgsProcessingToolboxModel::repopulateRecentAlgorithms( bool resetting )

void QgsProcessingToolboxModel::providerAdded( const QString &id )
{
if ( !mRegistry )
return;

QgsProcessingProvider *provider = mRegistry->providerById( id );
if ( !provider )
return;
@@ -20,6 +20,7 @@
#include "qgis_gui.h"
#include <QAbstractItemModel>
#include <QSortFilterProxyModel>
#include <QPointer>

class QgsProcessingRegistry;
class QgsProcessingProvider;
@@ -375,8 +376,8 @@ class GUI_EXPORT QgsProcessingToolboxModel : public QAbstractItemModel

private:

QgsProcessingRegistry *mRegistry = nullptr;
QgsProcessingRecentAlgorithmLog *mRecentLog = nullptr;
QPointer< QgsProcessingRegistry > mRegistry;
QPointer< QgsProcessingRecentAlgorithmLog > mRecentLog;

std::unique_ptr< QgsProcessingToolboxModelGroupNode > mRootNode;
QgsProcessingToolboxModelRecentNode *mRecentNode = nullptr;
@@ -56,7 +56,7 @@ class GUI_EXPORT QgsProcessingToolboxTreeView : public QTreeView
/**
* Sets the processing \a registry associated with the view.
*
* If \recentLog is specified then it will be used to create a "Recently used" top
* If \a recentLog is specified then it will be used to create a "Recently used" top
* level group containing recently used algorithms.
*/
void setRegistry(

0 comments on commit 45d856e

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