Skip to content

Commit 3b26b6a

Browse files
committed
qt: Remove TransactionTableModel::TxIDRole
1 parent 20e3b9a commit 3b26b6a

8 files changed

+8
-12
lines changed

src/qt/transactiondesc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
240240
if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty())
241241
strHTML += "<br><b>" + tr("Comment") + ":</b><br>" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "<br>";
242242

243-
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + rec->getTxID() + "<br>";
243+
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + rec->getTxHash() + "<br>";
244244
strHTML += "<b>" + tr("Transaction total size") + ":</b> " + QString::number(wtx.tx->GetTotalSize()) + " bytes<br>";
245245
strHTML += "<b>" + tr("Transaction virtual size") + ":</b> " + QString::number(GetVirtualTransactionSize(*wtx.tx)) + " bytes<br>";
246246
strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>";

src/qt/transactiondescdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TransactionDescDialog::TransactionDescDialog(const QModelIndex &idx, QWidget *pa
1414
ui(new Ui::TransactionDescDialog)
1515
{
1616
ui->setupUi(this);
17-
setWindowTitle(tr("Details for %1").arg(idx.data(TransactionTableModel::TxIDRole).toString()));
17+
setWindowTitle(tr("Details for %1").arg(idx.data(TransactionTableModel::TxHashRole).toString()));
1818
QString desc = idx.data(TransactionTableModel::LongDescriptionRole).toString();
1919
ui->detailText->setHtml(desc);
2020
}

src/qt/transactionfilterproxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
3636
bool involvesWatchAddress = index.data(TransactionTableModel::WatchonlyRole).toBool();
3737
QString address = index.data(TransactionTableModel::AddressRole).toString();
3838
QString label = index.data(TransactionTableModel::LabelRole).toString();
39-
QString txid = index.data(TransactionTableModel::TxIDRole).toString();
39+
QString txid = index.data(TransactionTableModel::TxHashRole).toString();
4040
qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong());
4141
int status = index.data(TransactionTableModel::StatusRole).toInt();
4242

src/qt/transactionrecord.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ bool TransactionRecord::statusUpdateNeeded() const
254254
return status.cur_num_blocks != chainActive.Height() || status.needsUpdate;
255255
}
256256

257-
QString TransactionRecord::getTxID() const
257+
QString TransactionRecord::getTxHash() const
258258
{
259259
return QString::fromStdString(hash.ToString());
260260
}

src/qt/transactionrecord.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class TransactionRecord
129129
bool involvesWatchAddress;
130130

131131
/** Return the unique identifier for this transaction (part) */
132-
QString getTxID() const;
132+
QString getTxHash() const;
133133

134134
/** Return the output index of the subtransaction */
135135
int getOutputIndex() const;

src/qt/transactiontablemodel.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,8 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const
615615
return walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(rec->address));
616616
case AmountRole:
617617
return qint64(rec->credit + rec->debit);
618-
case TxIDRole:
619-
return rec->getTxID();
620618
case TxHashRole:
621-
return QString::fromStdString(rec->hash.ToString());
619+
return rec->getTxHash();
622620
case TxHexRole:
623621
return priv->getTxHex(rec);
624622
case TxPlainTextRole:

src/qt/transactiontablemodel.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ class TransactionTableModel : public QAbstractTableModel
5656
LabelRole,
5757
/** Net amount of transaction */
5858
AmountRole,
59-
/** Unique identifier */
60-
TxIDRole,
6159
/** Transaction hash */
6260
TxHashRole,
6361
/** Transaction data, hex-encoded */

src/qt/transactionview.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ void TransactionView::exportClicked()
371371
writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
372372
writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
373373
writer.addColumn(BitcoinUnits::getAmountColumnTitle(model->getOptionsModel()->getDisplayUnit()), 0, TransactionTableModel::FormattedAmountRole);
374-
writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole);
374+
writer.addColumn(tr("ID"), 0, TransactionTableModel::TxHashRole);
375375

376376
if(!writer.write()) {
377377
Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
@@ -455,7 +455,7 @@ void TransactionView::copyAmount()
455455

456456
void TransactionView::copyTxID()
457457
{
458-
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxIDRole);
458+
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxHashRole);
459459
}
460460

461461
void TransactionView::copyTxHex()

0 commit comments

Comments
 (0)