mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-17 16:28:14 +00:00
WalletManager: displayAmount should be static
This commit is contained in:
parent
b7b1221221
commit
2fd3974194
4 changed files with 7 additions and 7 deletions
|
@ -75,7 +75,7 @@ void QrCodeScanner::processCode(int type, const QString &data)
|
|||
emit notifyError(error, true);
|
||||
}
|
||||
qDebug() << "Parsed URI : " << address << " " << payment_id << " " << amount << " " << tx_description << " " << recipient_name << " " << error;
|
||||
QString s_amount = WalletManager::instance()->displayAmount(amount);
|
||||
QString s_amount = WalletManager::displayAmount(amount);
|
||||
qDebug() << "Amount passed " << s_amount ;
|
||||
emit decoded(address, payment_id, s_amount, tx_description, recipient_name, parsed_unknown_parameters);
|
||||
}
|
||||
|
|
|
@ -61,14 +61,14 @@ quint64 TransactionInfo::atomicAmount() const
|
|||
|
||||
QString TransactionInfo::displayAmount() const
|
||||
{
|
||||
return WalletManager::instance()->displayAmount(m_amount);
|
||||
return WalletManager::displayAmount(m_amount);
|
||||
}
|
||||
|
||||
QString TransactionInfo::fee() const
|
||||
{
|
||||
if(m_fee == 0)
|
||||
return "";
|
||||
return WalletManager::instance()->displayAmount(m_fee);
|
||||
return WalletManager::displayAmount(m_fee);
|
||||
}
|
||||
|
||||
quint64 TransactionInfo::blockHeight() const
|
||||
|
@ -132,7 +132,7 @@ QString TransactionInfo::destinations_formatted() const
|
|||
for (auto const& t: m_transfers) {
|
||||
if (!destinations.isEmpty())
|
||||
destinations += "<br> ";
|
||||
destinations += WalletManager::instance()->displayAmount(t->amount()) + ": " + t->address();
|
||||
destinations += WalletManager::displayAmount(t->amount()) + ": " + t->address();
|
||||
}
|
||||
return destinations;
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ QString WalletManager::maximumAllowedAmountAsString() const
|
|||
return WalletManager::displayAmount(WalletManager::maximumAllowedAmount());
|
||||
}
|
||||
|
||||
QString WalletManager::displayAmount(quint64 amount) const
|
||||
QString WalletManager::displayAmount(quint64 amount)
|
||||
{
|
||||
return QString::fromStdString(Monero::Wallet::displayAmount(amount));
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ QVariantMap WalletManager::parse_uri_to_object(const QString &uri) const
|
|||
if (this->parse_uri(uri, address, payment_id, amount, tx_description, recipient_name, unknown_parameters, error)) {
|
||||
result.insert("address", address);
|
||||
result.insert("payment_id", payment_id);
|
||||
result.insert("amount", amount > 0 ? this->displayAmount(amount) : "");
|
||||
result.insert("amount", amount > 0 ? displayAmount(amount) : "");
|
||||
result.insert("tx_description", tx_description);
|
||||
result.insert("recipient_name", recipient_name);
|
||||
} else {
|
||||
|
|
|
@ -129,7 +129,7 @@ public:
|
|||
Q_INVOKABLE QString errorString() const;
|
||||
|
||||
//! since we can't call static method from QML, move it to this class
|
||||
Q_INVOKABLE QString displayAmount(quint64 amount) const;
|
||||
Q_INVOKABLE static QString displayAmount(quint64 amount);
|
||||
Q_INVOKABLE quint64 amountFromString(const QString &amount) const;
|
||||
Q_INVOKABLE quint64 amountFromDouble(double amount) const;
|
||||
Q_INVOKABLE quint64 maximumAllowedAmount() const;
|
||||
|
|
Loading…
Reference in a new issue