Qt: Get wallet name from WalletModel rather than passing it around

This commit is contained in:
Luke Dashjr
2017-10-12 07:22:48 +00:00
committed by Jonas Schnelli
parent 12d8d2681e
commit b6d04fc7cc
7 changed files with 20 additions and 16 deletions

View File

@@ -538,10 +538,11 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
}
#ifdef ENABLE_WALLET
bool BitcoinGUI::addWallet(const QString& name, WalletModel *walletModel)
bool BitcoinGUI::addWallet(WalletModel *walletModel)
{
if(!walletFrame)
return false;
const QString name = walletModel->getWalletName();
setWalletActionsEnabled(true);
m_wallet_selector->addItem(name);
if (m_wallet_selector->count() == 2) {
@@ -551,8 +552,8 @@ bool BitcoinGUI::addWallet(const QString& name, WalletModel *walletModel)
appToolBar->addWidget(m_wallet_selector_label);
appToolBar->addWidget(m_wallet_selector);
}
rpcConsole->addWallet(name, walletModel);
return walletFrame->addWallet(name, walletModel);
rpcConsole->addWallet(walletModel);
return walletFrame->addWallet(walletModel);
}
bool BitcoinGUI::setCurrentWallet(const QString& name)