Skip to content

Commit

Permalink
simplify conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Dec 16, 2024
1 parent 9950377 commit 6cfa8ef
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/analysis/processing/qgsmetadataalgorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ bool QgsSetMetadataFieldsAlgorithm::prepareAlgorithm( const QVariantMap &paramet
if ( parameters.value( QStringLiteral( "IDENTIFIER" ) ).isValid() )
{
const QString identifier = parameterAsString( parameters, QStringLiteral( "IDENTIFIER" ), context );
if ( !identifier.isEmpty() || ( identifier.isEmpty() && !ignoreEmpty ) )
if ( !identifier.isEmpty() || !ignoreEmpty )
{
md->setIdentifier( identifier );
}
Expand All @@ -471,7 +471,7 @@ bool QgsSetMetadataFieldsAlgorithm::prepareAlgorithm( const QVariantMap &paramet
if ( parameters.value( QStringLiteral( "PARENT_IDENTIFIER" ) ).isValid() )
{
const QString parentIdentifier = parameterAsString( parameters, QStringLiteral( "PARENT_IDENTIFIER" ), context );
if ( !parentIdentifier.isEmpty() || ( parentIdentifier.isEmpty() && !ignoreEmpty ) )
if ( !parentIdentifier.isEmpty() || !ignoreEmpty )
{
md->setParentIdentifier( parentIdentifier );
}
Expand All @@ -480,7 +480,7 @@ bool QgsSetMetadataFieldsAlgorithm::prepareAlgorithm( const QVariantMap &paramet
if ( parameters.value( QStringLiteral( "TITLE" ) ).isValid() )
{
const QString title = parameterAsString( parameters, QStringLiteral( "TITLE" ), context );
if ( !title.isEmpty() || ( title.isEmpty() && !ignoreEmpty ) )
if ( !title.isEmpty() || !ignoreEmpty )
{
md->setTitle( title );
}
Expand All @@ -489,7 +489,7 @@ bool QgsSetMetadataFieldsAlgorithm::prepareAlgorithm( const QVariantMap &paramet
if ( parameters.value( QStringLiteral( "TYPE" ) ).isValid() )
{
const QString type = parameterAsString( parameters, QStringLiteral( "TYPE" ), context );
if ( !type.isEmpty() || ( type.isEmpty() && !ignoreEmpty ) )
if ( !type.isEmpty() || !ignoreEmpty )
{
md->setType( type );
}
Expand All @@ -498,7 +498,7 @@ bool QgsSetMetadataFieldsAlgorithm::prepareAlgorithm( const QVariantMap &paramet
if ( parameters.value( QStringLiteral( "LANGUAGE" ) ).isValid() )
{
const QString language = parameterAsString( parameters, QStringLiteral( "LANGUAGE" ), context );
if ( !language.isEmpty() || ( language.isEmpty() && !ignoreEmpty ) )
if ( !language.isEmpty() || !ignoreEmpty )
{
md->setLanguage( language );
}
Expand All @@ -507,7 +507,7 @@ bool QgsSetMetadataFieldsAlgorithm::prepareAlgorithm( const QVariantMap &paramet
if ( parameters.value( QStringLiteral( "ENCODING" ) ).isValid() )
{
const QString encoding = parameterAsString( parameters, QStringLiteral( "ENCODING" ), context );
if ( !encoding.isEmpty() || ( encoding.isEmpty() && !ignoreEmpty ) )
if ( !encoding.isEmpty() || !ignoreEmpty )
{
md->setEncoding( encoding );
}
Expand All @@ -516,7 +516,7 @@ bool QgsSetMetadataFieldsAlgorithm::prepareAlgorithm( const QVariantMap &paramet
if ( parameters.value( QStringLiteral( "ABSTRACT" ) ).isValid() )
{
const QString abstract = parameterAsString( parameters, QStringLiteral( "ABSTRACT" ), context );
if ( !abstract.isEmpty() || ( abstract.isEmpty() && !ignoreEmpty ) )
if ( !abstract.isEmpty() || !ignoreEmpty )
{
md->setAbstract( abstract );
}
Expand All @@ -534,7 +534,7 @@ bool QgsSetMetadataFieldsAlgorithm::prepareAlgorithm( const QVariantMap &paramet
if ( parameters.value( QStringLiteral( "FEES" ) ).isValid() )
{
const QString fees = parameterAsString( parameters, QStringLiteral( "FEES" ), context );
if ( !fees.isEmpty() || ( fees.isEmpty() && !ignoreEmpty ) )
if ( !fees.isEmpty() || !ignoreEmpty )
{
md->setFees( fees );
}
Expand Down

0 comments on commit 6cfa8ef

Please sign in to comment.