Skip to content

Commit d8298e7

Browse files
committed
qt, refactor: Drop superfluous type conversions
1 parent f4e96c2 commit d8298e7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/qt/psbtoperationsdialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ void PSBTOperationsDialog::saveTransaction() {
167167
}
168168

169169
void PSBTOperationsDialog::updateTransactionDisplay() {
170-
m_ui->transactionDescription->setText(QString::fromStdString(renderTransaction(m_transaction_data)));
170+
m_ui->transactionDescription->setText(renderTransaction(m_transaction_data));
171171
showTransactionStatus(m_transaction_data);
172172
}
173173

174-
std::string PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction &psbtx)
174+
QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction &psbtx)
175175
{
176-
QString tx_description = "";
176+
QString tx_description;
177177
CAmount totalAmount = 0;
178178
for (const CTxOut& out : psbtx.tx->vout) {
179179
CTxDestination address;
@@ -217,7 +217,7 @@ std::string PSBTOperationsDialog::renderTransaction(const PartiallySignedTransac
217217
tx_description.append(tr("Transaction has %1 unsigned inputs.").arg(QString::number(num_unsigned)));
218218
}
219219

220-
return tx_description.toStdString();
220+
return tx_description;
221221
}
222222

223223
void PSBTOperationsDialog::showStatus(const QString &msg, StatusLevel level) {

src/qt/psbtoperationsdialog.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define BITCOIN_QT_PSBTOPERATIONSDIALOG_H
77

88
#include <QDialog>
9+
#include <QString>
910

1011
#include <psbt.h>
1112
#include <qt/clientmodel.h>
@@ -46,7 +47,7 @@ public Q_SLOTS:
4647

4748
size_t couldSignInputs(const PartiallySignedTransaction &psbtx);
4849
void updateTransactionDisplay();
49-
std::string renderTransaction(const PartiallySignedTransaction &psbtx);
50+
QString renderTransaction(const PartiallySignedTransaction &psbtx);
5051
void showStatus(const QString &msg, StatusLevel level);
5152
void showTransactionStatus(const PartiallySignedTransaction &psbtx);
5253
};

0 commit comments

Comments
 (0)