Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] Handle field comments and aliases in refactor fields
algorithm
  • Loading branch information
nyalldawson committed Apr 21, 2023
1 parent 7b0bfaf commit 807ff7b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/analysis/processing/qgsalgorithmrefactorfields.cpp
Expand Up @@ -113,7 +113,13 @@ bool QgsRefactorFieldsAlgorithm::prepareAlgorithm( const QVariantMap &parameters
const int length = fieldDef.value( QStringLiteral( "length" ), 0 ).toInt();
const int precision = fieldDef.value( QStringLiteral( "precision" ), 0 ).toInt();

mFields.append( QgsField( name, type, typeName, length, precision, QString(), subType ) );
const QString alias = fieldDef.value( QStringLiteral( "alias" ) ).toString();
const QString comment = fieldDef.value( QStringLiteral( "comment" ) ).toString();

QgsField newField( name, type, typeName, length, precision, QString(), subType );
newField.setAlias( alias );
newField.setComment( comment );
mFields.append( newField );

const QString expressionString = fieldDef.value( QStringLiteral( "expression" ) ).toString();
if ( !expressionString.isEmpty() )
Expand Down

0 comments on commit 807ff7b

Please sign in to comment.