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

@@ -487,14 +487,9 @@ void BitcoinApplication::initializeResult(bool success)
for (CWalletRef pwallet : vpwallets) {
WalletModel * const walletModel = new WalletModel(platformStyle, pwallet, optionsModel);
QString WalletName = QString::fromStdString(pwallet->GetName());
if (WalletName.endsWith(".dat")) {
WalletName.truncate(WalletName.size() - 4);
}
window->addWallet(WalletName, walletModel);
window->addWallet(walletModel);
if (fFirstWallet) {
window->setCurrentWallet(WalletName);
window->setCurrentWallet(walletModel->getWalletName());
fFirstWallet = false;
}