diff --git a/src/analysis/processing/qgsmetadataalgorithms.cpp b/src/analysis/processing/qgsmetadataalgorithms.cpp index e9798162b7d1..628148e8644b 100644 --- a/src/analysis/processing/qgsmetadataalgorithms.cpp +++ b/src/analysis/processing/qgsmetadataalgorithms.cpp @@ -46,7 +46,7 @@ QString QgsCopyLayerMetadataAlgorithm::groupId() const QString QgsCopyLayerMetadataAlgorithm::shortHelpString() const { - return QObject::tr( "Copies metadata from an input layer to a target layer.\n\nAny existing metadata in the target layer will be replaced." ); + return QObject::tr( "Copies metadata from an source layer to a target layer.\n\nAny existing metadata in the target layer will be replaced." ); } QgsCopyLayerMetadataAlgorithm *QgsCopyLayerMetadataAlgorithm::createInstance() const @@ -56,7 +56,7 @@ QgsCopyLayerMetadataAlgorithm *QgsCopyLayerMetadataAlgorithm::createInstance() c void QgsCopyLayerMetadataAlgorithm::initAlgorithm( const QVariantMap & ) { - addParameter( new QgsProcessingParameterMapLayer( QStringLiteral( "INPUT" ), QObject::tr( "Source layer" ) ) ); + addParameter( new QgsProcessingParameterMapLayer( QStringLiteral( "SOURCE" ), QObject::tr( "Source layer" ) ) ); addParameter( new QgsProcessingParameterMapLayer( QStringLiteral( "TARGET" ), QObject::tr( "Target layer" ) ) ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "DEFAULT" ), QObject::tr( "Save metadata as default" ), false ) ); addOutput( new QgsProcessingOutputMapLayer( QStringLiteral( "OUTPUT" ), QObject::tr( "Updated layer" ) ) ); @@ -64,19 +64,19 @@ void QgsCopyLayerMetadataAlgorithm::initAlgorithm( const QVariantMap & ) bool QgsCopyLayerMetadataAlgorithm::prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback * ) { - QgsMapLayer *inputLayer = parameterAsLayer( parameters, QStringLiteral( "INPUT" ), context ); + QgsMapLayer *sourceLayer = parameterAsLayer( parameters, QStringLiteral( "SOURCE" ), context ); QgsMapLayer *targetLayer = parameterAsLayer( parameters, QStringLiteral( "TARGET" ), context ); const bool saveAsDefault = parameterAsBool( parameters, QStringLiteral( "DEFAULT" ), context ); - if ( !inputLayer ) - throw QgsProcessingException( QObject::tr( "Invalid input layer" ) ); + if ( !sourceLayer ) + throw QgsProcessingException( QObject::tr( "Invalid source layer" ) ); if ( !targetLayer ) throw QgsProcessingException( QObject::tr( "Invalid target layer" ) ); mLayerId = targetLayer->id(); - targetLayer->setMetadata( inputLayer->metadata() ); + targetLayer->setMetadata( sourceLayer->metadata() ); if ( saveAsDefault ) { bool ok; @@ -348,7 +348,7 @@ QString QgsUpdateLayerMetadataAlgorithm::groupId() const QString QgsUpdateLayerMetadataAlgorithm::shortHelpString() const { - return QObject::tr( "Copies all non-empty metadata fields from an input layer to a target layer.\n\nLeaves empty input fields unchaged in the target." ); + return QObject::tr( "Copies all non-empty metadata fields from an source layer to a target layer.\n\nLeaves empty input fields unchanged in the target." ); } QgsUpdateLayerMetadataAlgorithm *QgsUpdateLayerMetadataAlgorithm::createInstance() const @@ -358,18 +358,18 @@ QgsUpdateLayerMetadataAlgorithm *QgsUpdateLayerMetadataAlgorithm::createInstance void QgsUpdateLayerMetadataAlgorithm::initAlgorithm( const QVariantMap & ) { - addParameter( new QgsProcessingParameterMapLayer( QStringLiteral( "INPUT" ), QObject::tr( "Source layer" ) ) ); + addParameter( new QgsProcessingParameterMapLayer( QStringLiteral( "SOURCE" ), QObject::tr( "Source layer" ) ) ); addParameter( new QgsProcessingParameterMapLayer( QStringLiteral( "TARGET" ), QObject::tr( "Target layer" ) ) ); addOutput( new QgsProcessingOutputMapLayer( QStringLiteral( "OUTPUT" ), QObject::tr( "Updated layer" ) ) ); } bool QgsUpdateLayerMetadataAlgorithm::prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback * ) { - QgsMapLayer *inputLayer = parameterAsLayer( parameters, QStringLiteral( "INPUT" ), context ); + QgsMapLayer *sourceLayer = parameterAsLayer( parameters, QStringLiteral( "SOURCE" ), context ); QgsMapLayer *targetLayer = parameterAsLayer( parameters, QStringLiteral( "TARGET" ), context ); - if ( !inputLayer ) - throw QgsProcessingException( QObject::tr( "Invalid input layer" ) ); + if ( !sourceLayer ) + throw QgsProcessingException( QObject::tr( "Invalid source layer" ) ); if ( !targetLayer ) throw QgsProcessingException( QObject::tr( "Invalid target layer" ) ); @@ -377,7 +377,7 @@ bool QgsUpdateLayerMetadataAlgorithm::prepareAlgorithm( const QVariantMap ¶m mLayerId = targetLayer->id(); std::unique_ptr md( targetLayer->metadata().clone() ); - md->combine( &inputLayer->metadata() ); + md->combine( &sourceLayer->metadata() ); targetLayer->setMetadata( *md.get() ); return true; diff --git a/tests/src/analysis/testqgsprocessingalgspt2.cpp b/tests/src/analysis/testqgsprocessingalgspt2.cpp index ce32ba563dc3..a9c5271ff5f8 100644 --- a/tests/src/analysis/testqgsprocessingalgspt2.cpp +++ b/tests/src/analysis/testqgsprocessingalgspt2.cpp @@ -1885,8 +1885,8 @@ void TestQgsProcessingAlgsPt2::generateElevationProfileImage() void TestQgsProcessingAlgsPt2::copyMetadata() { - std::unique_ptr inputLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); - QVERIFY( inputLayer->isValid() ); + std::unique_ptr sourceLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); + QVERIFY( sourceLayer->isValid() ); std::unique_ptr targetLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "target" ), QStringLiteral( "memory" ) ); QVERIFY( targetLayer->isValid() ); @@ -1894,13 +1894,13 @@ void TestQgsProcessingAlgsPt2::copyMetadata() QgsLayerMetadata md; md.setTitle( QStringLiteral( "Title" ) ); md.setAbstract( QStringLiteral( "Abstract" ) ); - inputLayer->setMetadata( md ); + sourceLayer->setMetadata( md ); std::unique_ptr alg( QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:copylayermetadata" ) ) ); QVERIFY( alg != nullptr ); QVariantMap parameters; - parameters.insert( QStringLiteral( "INPUT" ), QVariant::fromValue( inputLayer.get() ) ); + parameters.insert( QStringLiteral( "SOURCE" ), QVariant::fromValue( sourceLayer.get() ) ); parameters.insert( QStringLiteral( "TARGET" ), QVariant::fromValue( targetLayer.get() ) ); bool ok = false; @@ -2037,8 +2037,8 @@ void TestQgsProcessingAlgsPt2::addHistoryMetadata() void TestQgsProcessingAlgsPt2::updateMetadata() { - std::unique_ptr inputLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); - QVERIFY( inputLayer->isValid() ); + std::unique_ptr sourceLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "input" ), QStringLiteral( "memory" ) ); + QVERIFY( sourceLayer->isValid() ); std::unique_ptr targetLayer = std::make_unique( QStringLiteral( "Point?crs=epsg:4326&field=pk:int&field=col1:string" ), QStringLiteral( "target" ), QStringLiteral( "memory" ) ); QVERIFY( targetLayer->isValid() ); @@ -2047,7 +2047,7 @@ void TestQgsProcessingAlgsPt2::updateMetadata() mdInput.setTitle( QStringLiteral( "New title" ) ); mdInput.setAbstract( QStringLiteral( "New abstract" ) ); mdInput.setLanguage( QStringLiteral( "Language" ) ); - inputLayer->setMetadata( mdInput ); + sourceLayer->setMetadata( mdInput ); QgsLayerMetadata mdTarget; mdTarget.setTitle( QStringLiteral( "Title" ) ); @@ -2059,7 +2059,7 @@ void TestQgsProcessingAlgsPt2::updateMetadata() QVERIFY( alg != nullptr ); QVariantMap parameters; - parameters.insert( QStringLiteral( "INPUT" ), QVariant::fromValue( inputLayer.get() ) ); + parameters.insert( QStringLiteral( "SOURCE" ), QVariant::fromValue( sourceLayer.get() ) ); parameters.insert( QStringLiteral( "TARGET" ), QVariant::fromValue( targetLayer.get() ) ); bool ok = false;