mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
[processing] Gracefully handle algorithms with no provider set
Fixes #51971
This commit is contained in:
parent
f453d2cc0d
commit
603ccb2904
@ -205,7 +205,7 @@ class AlgorithmDialog(QgsProcessingAlgorithmDialogBase):
|
|||||||
|
|
||||||
self.clearProgress()
|
self.clearProgress()
|
||||||
self.feedback.pushVersionInfo(self.algorithm().provider())
|
self.feedback.pushVersionInfo(self.algorithm().provider())
|
||||||
if self.algorithm().provider().warningMessage():
|
if self.algorithm().provider() and self.algorithm().provider().warningMessage():
|
||||||
self.feedback.reportError(self.algorithm().provider().warningMessage())
|
self.feedback.reportError(self.algorithm().provider().warningMessage())
|
||||||
|
|
||||||
self.feedback.pushInfo(
|
self.feedback.pushInfo(
|
||||||
|
@ -87,7 +87,11 @@ class AlgorithmLocatorFilter(QgsLocatorFilter):
|
|||||||
|
|
||||||
string = string.lower()
|
string = string.lower()
|
||||||
tagScore = 0
|
tagScore = 0
|
||||||
|
if a.provider():
|
||||||
tags = [*a.tags(), a.provider().name()]
|
tags = [*a.tags(), a.provider().name()]
|
||||||
|
else:
|
||||||
|
tags = a.tags()
|
||||||
|
|
||||||
if a.group():
|
if a.group():
|
||||||
tags.append(a.group())
|
tags.append(a.group())
|
||||||
|
|
||||||
@ -178,7 +182,11 @@ class InPlaceAlgorithmLocatorFilter(QgsLocatorFilter):
|
|||||||
|
|
||||||
string = string.lower()
|
string = string.lower()
|
||||||
tagScore = 0
|
tagScore = 0
|
||||||
|
if a.provider():
|
||||||
tags = [*a.tags(), a.provider().name()]
|
tags = [*a.tags(), a.provider().name()]
|
||||||
|
else:
|
||||||
|
tags = a.tags()
|
||||||
|
|
||||||
if a.group():
|
if a.group():
|
||||||
tags.append(a.group())
|
tags.append(a.group())
|
||||||
|
|
||||||
|
@ -1439,7 +1439,7 @@ void QgsProcessingModelAlgorithm::updateDestinationParameters()
|
|||||||
// add some metadata so we can easily link this parameter back to the child source
|
// add some metadata so we can easily link this parameter back to the child source
|
||||||
param->metadata().insert( QStringLiteral( "_modelChildId" ), outputIt->childId() );
|
param->metadata().insert( QStringLiteral( "_modelChildId" ), outputIt->childId() );
|
||||||
param->metadata().insert( QStringLiteral( "_modelChildOutputName" ), outputIt->name() );
|
param->metadata().insert( QStringLiteral( "_modelChildOutputName" ), outputIt->name() );
|
||||||
param->metadata().insert( QStringLiteral( "_modelChildProvider" ), childIt->algorithm()->provider()->id() );
|
param->metadata().insert( QStringLiteral( "_modelChildProvider" ), childIt->algorithm()->provider() ? childIt->algorithm()->provider()->id() : QString() );
|
||||||
|
|
||||||
param->setDescription( outputIt->description() );
|
param->setDescription( outputIt->description() );
|
||||||
param->setDefaultValue( outputIt->defaultValue() );
|
param->setDefaultValue( outputIt->defaultValue() );
|
||||||
|
@ -314,12 +314,12 @@ void QgsProcessingAlgorithmDialogBase::setAlgorithm( QgsProcessingAlgorithm *alg
|
|||||||
textShortHelp->show();
|
textShortHelp->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( algorithm->helpUrl().isEmpty() && algorithm->provider()->helpId().isEmpty() )
|
if ( algorithm->helpUrl().isEmpty() && ( !algorithm->provider() || algorithm->provider()->helpId().isEmpty() ) )
|
||||||
{
|
{
|
||||||
mButtonBox->removeButton( mButtonBox->button( QDialogButtonBox::Help ) );
|
mButtonBox->removeButton( mButtonBox->button( QDialogButtonBox::Help ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString warning = algorithm->provider()->warningMessage();
|
const QString warning = algorithm->provider() ? algorithm->provider()->warningMessage() : QString();
|
||||||
if ( !warning.isEmpty() )
|
if ( !warning.isEmpty() )
|
||||||
{
|
{
|
||||||
mMessageBar->pushMessage( warning, Qgis::MessageLevel::Warning );
|
mMessageBar->pushMessage( warning, Qgis::MessageLevel::Warning );
|
||||||
@ -449,7 +449,7 @@ void QgsProcessingAlgorithmDialogBase::finished( bool, const QVariantMap &, QgsP
|
|||||||
void QgsProcessingAlgorithmDialogBase::openHelp()
|
void QgsProcessingAlgorithmDialogBase::openHelp()
|
||||||
{
|
{
|
||||||
QUrl algHelp = mAlgorithm->helpUrl();
|
QUrl algHelp = mAlgorithm->helpUrl();
|
||||||
if ( algHelp.isEmpty() )
|
if ( algHelp.isEmpty() && mAlgorithm->provider() )
|
||||||
{
|
{
|
||||||
algHelp = QgsHelp::helpUrl( QStringLiteral( "processing_algs/%1/%2.html#%3" ).arg( mAlgorithm->provider()->helpId(), mAlgorithm->groupId(), QStringLiteral( "%1%2" ).arg( mAlgorithm->provider()->helpId() ).arg( mAlgorithm->name() ) ) );
|
algHelp = QgsHelp::helpUrl( QStringLiteral( "processing_algs/%1/%2.html#%3" ).arg( mAlgorithm->provider()->helpId(), mAlgorithm->groupId(), QStringLiteral( "%1%2" ).arg( mAlgorithm->provider()->helpId() ).arg( mAlgorithm->name() ) ) );
|
||||||
}
|
}
|
||||||
|
@ -856,6 +856,7 @@ int QgsProcessingExec::showAlgorithmHelp( const QString &inputId, bool useJson )
|
|||||||
addAlgorithmInformation( algorithmDetails, alg );
|
addAlgorithmInformation( algorithmDetails, alg );
|
||||||
json.insert( QStringLiteral( "algorithm_details" ), algorithmDetails );
|
json.insert( QStringLiteral( "algorithm_details" ), algorithmDetails );
|
||||||
QVariantMap providerJson;
|
QVariantMap providerJson;
|
||||||
|
if ( alg->provider() )
|
||||||
addProviderInformation( providerJson, alg->provider() );
|
addProviderInformation( providerJson, alg->provider() );
|
||||||
json.insert( QStringLiteral( "provider_details" ), providerJson );
|
json.insert( QStringLiteral( "provider_details" ), providerJson );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user