Skip to content

Commit

Permalink
Fix some QStringLiterals
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Oct 25, 2019
1 parent 221cfc3 commit f44136d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/app/qgsmergeattributesdialog.cpp
Expand Up @@ -114,7 +114,7 @@ void QgsMergeAttributesDialog::createTableWidgetContents()
for ( int idx = 0; idx < mFields.count(); ++idx )
{
const QgsEditorWidgetSetup setup = QgsGui::editorWidgetRegistry()->findBest( mVectorLayer, mFields.at( idx ).name() );
if ( setup.type() == QStringLiteral( "Hidden" ) || setup.type() == QStringLiteral( "Immutable" ) )
if ( setup.type() == QLatin1String( "Hidden" ) || setup.type() == QLatin1String( "Immutable" ) )
{
mHiddenAttributes.insert( idx );
continue;
Expand Down Expand Up @@ -201,7 +201,7 @@ void QgsMergeAttributesDialog::createTableWidgetContents()
if ( currentComboBox )
{
currentComboBox->blockSignals( true );
currentComboBox->setCurrentIndex( currentComboBox->findData( "manual" ) );
currentComboBox->setCurrentIndex( currentComboBox->findData( QStringLiteral( "manual" ) ) );
currentComboBox->blockSignals( false );
}
}
Expand Down Expand Up @@ -232,16 +232,16 @@ QComboBox *QgsMergeAttributesDialog::createMergeComboBox( QVariant::Type columnT
break;
}
case QVariant::String:
newComboBox->addItem( tr( "Concatenation" ), "concat" );
newComboBox->addItem( tr( "Concatenation" ), QStringLiteral( "concat" ) );
break;

//TODO - add date/time/datetime handling
default:
break;
}

newComboBox->addItem( tr( "Skip attribute" ), "skip" );
newComboBox->addItem( tr( "Manual value" ), "manual" );
newComboBox->addItem( tr( "Skip attribute" ), QStringLiteral( "skip" ) );
newComboBox->addItem( tr( "Manual value" ), QStringLiteral( "manual" ) );

connect( newComboBox, &QComboBox::currentTextChanged,
this, &QgsMergeAttributesDialog::comboValueChanged );
Expand Down Expand Up @@ -329,11 +329,11 @@ void QgsMergeAttributesDialog::refreshMergedValue( int col )
{
mergeResult = concatenationAttribute( col );
}
else if ( mergeBehaviorString == QStringLiteral( "skip" ) )
else if ( mergeBehaviorString == QLatin1String( "skip" ) )
{
mergeResult = tr( "Skipped" );
}
else if ( mergeBehaviorString == QStringLiteral( "manual" ) )
else if ( mergeBehaviorString == QLatin1String( "manual" ) )
{
return; //nothing to do
}
Expand All @@ -356,7 +356,7 @@ void QgsMergeAttributesDialog::refreshMergedValue( int col )

// Result formatting
QString stringVal;
if ( mergeBehaviorString != QStringLiteral( "skip" ) && mergeBehaviorString != QStringLiteral( "manual" ) )
if ( mergeBehaviorString != QLatin1String( "skip" ) && mergeBehaviorString != QLatin1String( "manual" ) )
{
const QgsEditorWidgetSetup setup = mFields.at( fieldIdx ).editorWidgetSetup();
const QgsFieldFormatter *formatter = QgsApplication::fieldFormatterRegistry()->fieldFormatter( setup.type() );
Expand Down Expand Up @@ -467,7 +467,7 @@ void QgsMergeAttributesDialog::mFromSelectedPushButton_clicked()

if ( mVectorLayer->fields().at( i ).constraints().constraints() & QgsFieldConstraints::ConstraintUnique )
{
currentComboBox->setCurrentIndex( currentComboBox->findData( "skip" ) );
currentComboBox->setCurrentIndex( currentComboBox->findData( QStringLiteral( "skip" ) ) );
}
else
{
Expand Down Expand Up @@ -556,7 +556,7 @@ void QgsMergeAttributesDialog::tableWidgetCellChanged( int row, int column )
if ( currentComboBox )
{
currentComboBox->blockSignals( true );
currentComboBox->setCurrentIndex( currentComboBox->findData( "manual" ) );
currentComboBox->setCurrentIndex( currentComboBox->findData( QStringLiteral( "manual" ) ) );
currentComboBox->blockSignals( false );
}
}
Expand Down Expand Up @@ -648,7 +648,7 @@ void QgsMergeAttributesDialog::setAllToSkip()
QComboBox *currentComboBox = qobject_cast<QComboBox *>( mTableWidget->cellWidget( 0, i ) );
if ( currentComboBox )
{
currentComboBox->setCurrentIndex( currentComboBox->findData( "skip" ) );
currentComboBox->setCurrentIndex( currentComboBox->findData( QStringLiteral( "skip" ) ) );
}
}
}

0 comments on commit f44136d

Please sign in to comment.