mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 13:43:43 +01:00
GUI: remove now unneeded 'm_balances' field from overviewpage
This commit is contained in:
@@ -148,8 +148,6 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_balances.balance = -1;
|
||||
|
||||
// use a SingleColorIcon for the "out of sync warning" icon
|
||||
QIcon icon = m_platform_style->SingleColorIcon(QStringLiteral(":/icons/warning"));
|
||||
ui->labelTransactionsStatus->setIcon(icon);
|
||||
@@ -178,8 +176,9 @@ void OverviewPage::handleTransactionClicked(const QModelIndex &index)
|
||||
void OverviewPage::setPrivacy(bool privacy)
|
||||
{
|
||||
m_privacy = privacy;
|
||||
if (m_balances.balance != -1) {
|
||||
setBalance(m_balances);
|
||||
const auto& balances = walletModel->getCachedBalance();
|
||||
if (balances.balance != -1) {
|
||||
setBalance(balances);
|
||||
}
|
||||
|
||||
ui->listTransactions->setVisible(!m_privacy);
|
||||
@@ -198,7 +197,6 @@ OverviewPage::~OverviewPage()
|
||||
void OverviewPage::setBalance(const interfaces::WalletBalances& balances)
|
||||
{
|
||||
BitcoinUnit unit = walletModel->getOptionsModel()->getDisplayUnit();
|
||||
m_balances = balances;
|
||||
if (walletModel->wallet().isLegacy()) {
|
||||
if (walletModel->wallet().privateKeysDisabled()) {
|
||||
ui->labelBalance->setText(BitcoinUnits::formatWithPrivacy(unit, balances.watch_only_balance, BitcoinUnits::SeparatorStyle::ALWAYS, m_privacy));
|
||||
@@ -306,10 +304,10 @@ void OverviewPage::changeEvent(QEvent* e)
|
||||
|
||||
void OverviewPage::updateDisplayUnit()
|
||||
{
|
||||
if(walletModel && walletModel->getOptionsModel())
|
||||
{
|
||||
if (m_balances.balance != -1) {
|
||||
setBalance(m_balances);
|
||||
if (walletModel && walletModel->getOptionsModel()) {
|
||||
const auto& balances = walletModel->getCachedBalance();
|
||||
if (balances.balance != -1) {
|
||||
setBalance(balances);
|
||||
}
|
||||
|
||||
// Update txdelegate->unit with the current unit
|
||||
|
||||
Reference in New Issue
Block a user