Skip to content

Commit

Permalink
Protect the const-ituional correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Apr 10, 2018
1 parent 02da420 commit ffb2817
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ Interface base class for factories for algorithm configuration widgets.
public:
virtual ~QgsProcessingAlgorithmConfigurationWidgetFactory();

virtual QgsProcessingAlgorithmConfigurationWidget *create( QgsProcessingAlgorithm *algorithm ) const = 0 /Factory/;
virtual QgsProcessingAlgorithmConfigurationWidget *create( const QgsProcessingAlgorithm *algorithm ) const = 0 /Factory/;
%Docstring
Create a new configuration widget for ``algorithm``.
%End

virtual bool canCreateFor( QgsProcessingAlgorithm *algorithm ) const = 0;
virtual bool canCreateFor( const QgsProcessingAlgorithm *algorithm ) const = 0;
%Docstring
Check if this factory can create widgets for ``algorithm``.
%End
Expand Down
2 changes: 1 addition & 1 deletion python/gui/processing/qgsprocessingguiregistry.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ widgets.
.. versionadded:: 3.2
%End

QgsProcessingAlgorithmConfigurationWidget *algorithmConfigurationWidget( QgsProcessingAlgorithm *algorithm ) const;
QgsProcessingAlgorithmConfigurationWidget *algorithmConfigurationWidget( const QgsProcessingAlgorithm *algorithm ) const;
%Docstring
Get the configuration widget for an ``algorithm``. This widget will be shown
next to parameter widgets. Most algorithms do not have a configuration widget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ class CORE_EXPORT QgsProcessingAlgorithmConfigurationWidgetFactory
/**
* Create a new configuration widget for \a algorithm.
*/
virtual QgsProcessingAlgorithmConfigurationWidget *create( QgsProcessingAlgorithm *algorithm ) const = 0 SIP_FACTORY;
virtual QgsProcessingAlgorithmConfigurationWidget *create( const QgsProcessingAlgorithm *algorithm ) const = 0 SIP_FACTORY;

/**
* Check if this factory can create widgets for \a algorithm.
*/
virtual bool canCreateFor( QgsProcessingAlgorithm *algorithm ) const = 0;
virtual bool canCreateFor( const QgsProcessingAlgorithm *algorithm ) const = 0;
};


Expand Down
4 changes: 2 additions & 2 deletions src/gui/processing/qgsprocessingconfigurationwidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ void QgsFilterAlgorithmConfigurationWidget::addOutput()
mOutputExpressionWidget->setCellWidget( rowIndex, 2, new QCheckBox() );
}

QgsProcessingAlgorithmConfigurationWidget *QgsFilterAlgorithmConfigurationWidgetFactory::create( QgsProcessingAlgorithm *algorithm ) const
QgsProcessingAlgorithmConfigurationWidget *QgsFilterAlgorithmConfigurationWidgetFactory::create( const QgsProcessingAlgorithm *algorithm ) const
{
if ( algorithm->name() == QStringLiteral( "filter" ) )
return new QgsFilterAlgorithmConfigurationWidget();
else
return nullptr;
}

bool QgsFilterAlgorithmConfigurationWidgetFactory::canCreateFor( QgsProcessingAlgorithm *algorithm ) const
bool QgsFilterAlgorithmConfigurationWidgetFactory::canCreateFor( const QgsProcessingAlgorithm *algorithm ) const
{
if ( algorithm->name() == QStringLiteral( "filter" ) )
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/processing/qgsprocessingconfigurationwidgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class QgsFilterAlgorithmConfigurationWidget : public QgsProcessingAlgorithmConfi
class QgsFilterAlgorithmConfigurationWidgetFactory : public QgsProcessingAlgorithmConfigurationWidgetFactory
{
public:
virtual QgsProcessingAlgorithmConfigurationWidget *create( QgsProcessingAlgorithm *algorithm ) const override;
virtual bool canCreateFor( QgsProcessingAlgorithm *algorithm ) const override;
virtual QgsProcessingAlgorithmConfigurationWidget *create( const QgsProcessingAlgorithm *algorithm ) const override;
virtual bool canCreateFor( const QgsProcessingAlgorithm *algorithm ) const override;
};

///@endcond
Expand Down
2 changes: 1 addition & 1 deletion src/gui/processing/qgsprocessingguiregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void QgsProcessingGuiRegistry::removeAlgorithmConfigurationWidgetFactory( QgsPro
delete factory;
}

QgsProcessingAlgorithmConfigurationWidget *QgsProcessingGuiRegistry::algorithmConfigurationWidget( QgsProcessingAlgorithm *algorithm ) const
QgsProcessingAlgorithmConfigurationWidget *QgsProcessingGuiRegistry::algorithmConfigurationWidget( const QgsProcessingAlgorithm *algorithm ) const
{
for ( const auto *factory : mAlgorithmConfigurationWidgetFactories )
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/processing/qgsprocessingguiregistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class GUI_EXPORT QgsProcessingGuiRegistry
*
* \since QGIS 3.2
*/
QgsProcessingAlgorithmConfigurationWidget *algorithmConfigurationWidget( QgsProcessingAlgorithm *algorithm ) const;
QgsProcessingAlgorithmConfigurationWidget *algorithmConfigurationWidget( const QgsProcessingAlgorithm *algorithm ) const;

private:

Expand Down

0 comments on commit ffb2817

Please sign in to comment.