Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 23, 2023
1 parent f794b17 commit 4c77819
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Expand Up @@ -41,11 +41,15 @@ This should only be called once -- calling multiple times will result in duplica
void executePython( const QString &commands );
%Docstring
Emitted when the provider needs to execute python ``commands`` in the Processing context.

.. versionadded:: 3.32
%End

void createTest( const QString &command );
%Docstring
Emitted when the provider needs to create a Processing test with the given python ``command``.

.. versionadded:: 3.32
%End

};
Expand Down
7 changes: 5 additions & 2 deletions src/gui/processing/qgsprocessinghistoryprovider.cpp
Expand Up @@ -81,6 +81,7 @@ void QgsProcessingHistoryProvider::portOldLog()
}
}

///@cond PRIVATE

class ProcessingHistoryNode : public QgsHistoryEntryGroup
{
Expand Down Expand Up @@ -178,7 +179,7 @@ class ProcessingHistoryNode : public QgsHistoryEntryGroup
execAlgorithmDialogCommand
};

mProvider->execute( script.join( '\n' ) );
mProvider->emitExecute( script.join( '\n' ) );
}

void populateContextMenu( QMenu *menu, const QgsHistoryWidgetContext & ) override
Expand Down Expand Up @@ -253,6 +254,8 @@ class ProcessingHistoryNode : public QgsHistoryEntryGroup

};

///@endcond

QgsHistoryEntryNode *QgsProcessingHistoryProvider::createNodeForEntry( const QgsHistoryEntry &entry, const QgsHistoryWidgetContext & )
{
return new ProcessingHistoryNode( entry, this );
Expand All @@ -264,7 +267,7 @@ QString QgsProcessingHistoryProvider::oldLogPath() const
return userDir + QStringLiteral( "/processing.log" );
}

void QgsProcessingHistoryProvider::execute( const QString &commands )
void QgsProcessingHistoryProvider::emitExecute( const QString &commands )
{
emit executePython( commands );
}
Expand Down
6 changes: 5 additions & 1 deletion src/gui/processing/qgsprocessinghistoryprovider.h
Expand Up @@ -50,18 +50,22 @@ class GUI_EXPORT QgsProcessingHistoryProvider : public QgsAbstractHistoryProvide

/**
* Emitted when the provider needs to execute python \a commands in the Processing context.
*
* \since QGIS 3.32
*/
void executePython( const QString &commands );

/**
* Emitted when the provider needs to create a Processing test with the given python \a command.
*
* \since QGIS 3.32
*/
void createTest( const QString &command );

private:

//! Executes some python commands
void execute( const QString &commands );
void emitExecute( const QString &commands );

void emitCreateTest( const QString &command );

Expand Down

0 comments on commit 4c77819

Please sign in to comment.