mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-20 14:05:23 +01:00
qt, refactor: Replace WalletFrame::addWallet with WalletFrame::addView
No need to pass an instance of the WalletModel class to this method. Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
This commit is contained in:
parent
92ddc02a16
commit
d319c4dae9
3 changed files with 6 additions and 6 deletions
|
@ -677,7 +677,7 @@ void BitcoinGUI::addWallet(WalletModel* walletModel)
|
|||
if (!walletFrame) return;
|
||||
|
||||
WalletView* wallet_view = new WalletView(walletModel, platformStyle, walletFrame);
|
||||
if (!walletFrame->addWallet(walletModel, wallet_view)) return;
|
||||
if (!walletFrame->addView(wallet_view)) return;
|
||||
|
||||
rpcConsole->addWallet(walletModel);
|
||||
if (m_wallet_selector->count() == 0) {
|
||||
|
|
|
@ -64,11 +64,11 @@ void WalletFrame::setClientModel(ClientModel *_clientModel)
|
|||
}
|
||||
}
|
||||
|
||||
bool WalletFrame::addWallet(WalletModel* walletModel, WalletView* walletView)
|
||||
bool WalletFrame::addView(WalletView* walletView)
|
||||
{
|
||||
if (!clientModel || !walletModel) return false;
|
||||
if (!clientModel) return false;
|
||||
|
||||
if (mapWalletViews.count(walletModel) > 0) return false;
|
||||
if (mapWalletViews.count(walletView->getWalletModel()) > 0) return false;
|
||||
|
||||
walletView->setClientModel(clientModel);
|
||||
walletView->showOutOfSyncWarning(bOutOfSync);
|
||||
|
@ -81,7 +81,7 @@ bool WalletFrame::addWallet(WalletModel* walletModel, WalletView* walletView)
|
|||
}
|
||||
|
||||
walletStack->addWidget(walletView);
|
||||
mapWalletViews[walletModel] = walletView;
|
||||
mapWalletViews[walletView->getWalletModel()] = walletView;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
|
||||
void setClientModel(ClientModel *clientModel);
|
||||
|
||||
bool addWallet(WalletModel* walletModel, WalletView* walletView);
|
||||
bool addView(WalletView* walletView);
|
||||
void setCurrentWallet(WalletModel* wallet_model);
|
||||
void removeWallet(WalletModel* wallet_model);
|
||||
void removeAllWallets();
|
||||
|
|
Loading…
Add table
Reference in a new issue