Skip to content

Commit

Permalink
Merge pull request gridcoin-community#2255 from jamescowens/fix_conso…
Browse files Browse the repository at this point in the history
…lidation_no_label

qt: Prevent pasting (no label) as label in consolidation transaction
  • Loading branch information
jamescowens authored Aug 1, 2021
2 parents 7c2f109 + 12660e3 commit 5546565
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,6 @@ void SendCoinsDialog::coinControlConsolidateWizardButtonClicked()

void SendCoinsDialog::selectedConsolidationRecipient(SendCoinsRecipient consolidationRecipient)
{
LogPrintf("INFO: %s: SLOT called.", __func__);

ui->coinControlChangeCheckBox->setChecked(true);
ui->coinControlChangeEdit->setText(consolidationRecipient.address);

Expand All @@ -505,6 +503,12 @@ void SendCoinsDialog::selectedConsolidationRecipient(SendCoinsRecipient consolid
}
}

// The AddressTableModel substitutes the translated "(no label)" when the label is empty. If we use
// that here, we will end up pasting a literal lable of "(no label)". Because the translation (tr) should
// be consistent between here and the AddressTableModel::data, it should match the conditional and be put
// back to the desired empty QString.
if (consolidationRecipient.label == tr("(no label)")) consolidationRecipient.label = QString();

pasteEntry(consolidationRecipient);
}

Expand Down

0 comments on commit 5546565

Please sign in to comment.