qt, refactor: Make BitcoinUnits::Unit a scoped enum

This commit is contained in:
Hennadii Stepanov
2021-01-21 22:28:16 +02:00
committed by William Casarin
parent 75832fdc37
commit aa23960fdf
18 changed files with 113 additions and 107 deletions

View File

@@ -34,9 +34,9 @@ class TxViewDelegate : public QAbstractItemDelegate
{
Q_OBJECT
public:
explicit TxViewDelegate(const PlatformStyle *_platformStyle, QObject *parent=nullptr):
QAbstractItemDelegate(parent), unit(BitcoinUnits::BTC),
platformStyle(_platformStyle)
explicit TxViewDelegate(const PlatformStyle* _platformStyle, QObject* parent = nullptr)
: QAbstractItemDelegate(parent), unit(BitcoinUnit::BTC),
platformStyle(_platformStyle)
{
connect(this, &TxViewDelegate::width_changed, this, &TxViewDelegate::sizeHintChanged);
}
@@ -125,7 +125,7 @@ public:
return {DECORATION_SIZE + 8 + minimum_text_width, DECORATION_SIZE};
}
int unit;
BitcoinUnit unit;
Q_SIGNALS:
//! An intermediate signal for emitting from the `paint() const` member function.
@@ -197,7 +197,7 @@ OverviewPage::~OverviewPage()
void OverviewPage::setBalance(const interfaces::WalletBalances& balances)
{
int unit = walletModel->getOptionsModel()->getDisplayUnit();
BitcoinUnit unit = walletModel->getOptionsModel()->getDisplayUnit();
m_balances = balances;
if (walletModel->wallet().isLegacy()) {
if (walletModel->wallet().privateKeysDisabled()) {