coins: prefer tx label

This commit is contained in:
tobtoht 2024-01-01 17:58:59 +01:00
parent a2a185b46c
commit 4cde3d4eb1
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
4 changed files with 9 additions and 0 deletions

View file

@ -68,6 +68,7 @@ void Coins::refresh()
ci->m_subaddrAccount = td.m_subaddr_index.major;
ci->m_address = QString::fromStdString(m_wallet2->get_subaddress_as_str(td.m_subaddr_index)); // todo: this is expensive, cache maybe?
ci->m_addressLabel = QString::fromStdString(m_wallet2->get_subaddress_label(td.m_subaddr_index));
ci->m_txNote = QString::fromStdString(m_wallet2->get_tx_note(td.m_txid));
ci->m_keyImage = QString::fromStdString(epee::string_tools::pod_to_hex(td.m_key_image));
ci->m_unlockTime = td.m_tx.unlock_time;
ci->m_unlocked = m_wallet2->is_transfer_unlocked(td);

View file

@ -120,6 +120,10 @@ bool CoinsInfo::change() const {
return m_change;
}
QString CoinsInfo::txNote() const {
return m_txNote;
}
CoinsInfo::CoinsInfo(QObject *parent)
: QObject(parent)
, m_blockHeight(0)

View file

@ -39,6 +39,7 @@ public:
bool coinbase() const;
QString description() const;
bool change() const;
QString txNote() const;
void setUnlocked(bool unlocked);
@ -70,6 +71,7 @@ private:
bool m_coinbase;
QString m_description;
bool m_change;
QString m_txNote;
};
#endif //FEATHER_COINSINFO_H

View file

@ -228,6 +228,8 @@ QVariant CoinsModel::parseTransactionInfo(const CoinsInfo &cInfo, int column, in
case Label: {
if (!cInfo.description().isEmpty())
return cInfo.description();
if (!cInfo.txNote().isEmpty())
return cInfo.txNote();
return cInfo.addressLabel();
}
case Spent: