Skip to content

Commit

Permalink
[processing] Fix model input combo box content for {file,folder} dest…
Browse files Browse the repository at this point in the history
…ination parameters
  • Loading branch information
nirvn committed Aug 12, 2024
1 parent 5a9061c commit 29bf082
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9023,6 +9023,23 @@ QgsAbstractProcessingParameterWidgetWrapper *QgsProcessingFileDestinationWidgetW
return new QgsProcessingFileDestinationWidgetWrapper( parameter, type );
}

QStringList QgsProcessingFileDestinationWidgetWrapper::compatibleParameterTypes() const
{
return QStringList()
<< QgsProcessingParameterString::typeName()
<< QgsProcessingParameterFile::typeName();
}

QStringList QgsProcessingFileDestinationWidgetWrapper::compatibleOutputTypes() const
{
return QStringList() << QgsProcessingOutputFile::typeName()
<< QgsProcessingOutputString::typeName()
<< QgsProcessingOutputVariant::typeName()
<< QgsProcessingOutputRasterLayer::typeName()
<< QgsProcessingOutputVectorLayer::typeName()
<< QgsProcessingOutputMapLayer::typeName();
}

QString QgsProcessingFileDestinationWidgetWrapper::modelerExpressionFormatString() const
{
return tr( "path to file destination" );
Expand All @@ -9048,6 +9065,21 @@ QgsAbstractProcessingParameterWidgetWrapper *QgsProcessingFolderDestinationWidge
return new QgsProcessingFolderDestinationWidgetWrapper( parameter, type );
}

QStringList QgsProcessingFolderDestinationWidgetWrapper::compatibleParameterTypes() const
{
return QStringList()
<< QgsProcessingParameterString::typeName()
<< QgsProcessingParameterFile::typeName();
}

QStringList QgsProcessingFolderDestinationWidgetWrapper::compatibleOutputTypes() const
{
return QStringList() << QgsProcessingOutputFile::typeName()
<< QgsProcessingOutputFolder::typeName()
<< QgsProcessingOutputString::typeName()
<< QgsProcessingOutputVariant::typeName();
}

QString QgsProcessingFolderDestinationWidgetWrapper::modelerExpressionFormatString() const
{
return tr( "path to folder destination" );
Expand Down
4 changes: 4 additions & 0 deletions src/gui/processing/qgsprocessingwidgetwrapperimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,8 @@ class GUI_EXPORT QgsProcessingFileDestinationWidgetWrapper : public QgsProcessin
QgsAbstractProcessingParameterWidgetWrapper *createWidgetWrapper( const QgsProcessingParameterDefinition *parameter, QgsProcessingGui::WidgetType type ) override;

protected:
QStringList compatibleParameterTypes() const override;
QStringList compatibleOutputTypes() const override;
QString modelerExpressionFormatString() const override;

};
Expand All @@ -2430,6 +2432,8 @@ class GUI_EXPORT QgsProcessingFolderDestinationWidgetWrapper : public QgsProcess
QgsAbstractProcessingParameterWidgetWrapper *createWidgetWrapper( const QgsProcessingParameterDefinition *parameter, QgsProcessingGui::WidgetType type ) override;

protected:
QStringList compatibleParameterTypes() const override;
QStringList compatibleOutputTypes() const override;
QString modelerExpressionFormatString() const override;

};
Expand Down

0 comments on commit 29bf082

Please sign in to comment.