Skip to content
Permalink
Browse files

Merge pull request #38598 from qgis-bot/backport-38587-to-release-3_14

[Backport release-3_14] Fail model run if an algorithm is not available on the system
  • Loading branch information
m-kuhn committed Sep 5, 2020
2 parents c13d82f + d6209fe commit d031ec03298fb97a334139b43100955099d3e806
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/core/processing/models/qgsprocessingmodelalgorithm.cpp
@@ -264,12 +264,21 @@ QVariantMap QgsProcessingModelAlgorithm::processAlgorithm( const QVariantMap &pa
{
QSet< QString > toExecute;
QMap< QString, QgsProcessingModelChildAlgorithm >::const_iterator childIt = mChildAlgorithms.constBegin();
QSet< QString > broken;
for ( ; childIt != mChildAlgorithms.constEnd(); ++childIt )
{
if ( childIt->isActive() && childIt->algorithm() )
toExecute.insert( childIt->childId() );
if ( childIt->isActive() )
{
if ( childIt->algorithm() )
toExecute.insert( childIt->childId() );
else
broken.insert( childIt->childId() );
}
}

if ( !broken.empty() )
throw QgsProcessingException( QCoreApplication::translate( "QgsProcessingModelAlgorithm", "Cannot run model, the following algorithms are not available on this system: %1" ).arg( broken.values().join( QStringLiteral( ", " ) ) ) );

QElapsedTimer totalTime;
totalTime.start();

@@ -1933,4 +1942,3 @@ QVariantMap QgsProcessingModelAlgorithm::designerParameterValues() const
}

///@endcond

0 comments on commit d031ec0

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