Merge #15464: gui: Drop unused return values in WalletFrame

28c86de3b gui: Drop unused return values in WalletFrame (João Barbosa)

Pull request description:

  This is a small cleanup since the return value of `WalletFrame` methods are not used. This is in line with the usual async slot declaration.

Tree-SHA512: ff0ca098804118bba200a58cd796ff90e853a6430e58125bd178b7bfa9b2b763c13d17b81e8f3ebd94395cac249d80379ba1529680c47682ba6a2ed81492ba33
This commit is contained in:
Jonas Schnelli 2019-03-07 21:03:09 +01:00
commit d211edb349
No known key found for this signature in database
GPG key ID: 1EB776BB03C7922D
2 changed files with 10 additions and 20 deletions

View file

@ -40,15 +40,11 @@ void WalletFrame::setClientModel(ClientModel *_clientModel)
this->clientModel = _clientModel; this->clientModel = _clientModel;
} }
bool WalletFrame::addWallet(WalletModel *walletModel) void WalletFrame::addWallet(WalletModel *walletModel)
{ {
if (!gui || !clientModel || !walletModel) { if (!gui || !clientModel || !walletModel) return;
return false;
}
if (mapWalletViews.count(walletModel) > 0) { if (mapWalletViews.count(walletModel) > 0) return;
return false;
}
WalletView *walletView = new WalletView(platformStyle, this); WalletView *walletView = new WalletView(platformStyle, this);
walletView->setBitcoinGUI(gui); walletView->setBitcoinGUI(gui);
@ -72,31 +68,25 @@ bool WalletFrame::addWallet(WalletModel *walletModel)
}); });
connect(walletView, &WalletView::outOfSyncWarningClicked, this, &WalletFrame::outOfSyncWarningClicked); connect(walletView, &WalletView::outOfSyncWarningClicked, this, &WalletFrame::outOfSyncWarningClicked);
return true;
} }
bool WalletFrame::setCurrentWallet(WalletModel* wallet_model) void WalletFrame::setCurrentWallet(WalletModel* wallet_model)
{ {
if (mapWalletViews.count(wallet_model) == 0) if (mapWalletViews.count(wallet_model) == 0) return;
return false;
WalletView *walletView = mapWalletViews.value(wallet_model); WalletView *walletView = mapWalletViews.value(wallet_model);
walletStack->setCurrentWidget(walletView); walletStack->setCurrentWidget(walletView);
assert(walletView); assert(walletView);
walletView->updateEncryptionStatus(); walletView->updateEncryptionStatus();
return true;
} }
bool WalletFrame::removeWallet(WalletModel* wallet_model) void WalletFrame::removeWallet(WalletModel* wallet_model)
{ {
if (mapWalletViews.count(wallet_model) == 0) if (mapWalletViews.count(wallet_model) == 0) return;
return false;
WalletView *walletView = mapWalletViews.take(wallet_model); WalletView *walletView = mapWalletViews.take(wallet_model);
walletStack->removeWidget(walletView); walletStack->removeWidget(walletView);
delete walletView; delete walletView;
return true;
} }
void WalletFrame::removeAllWallets() void WalletFrame::removeAllWallets()

View file

@ -36,9 +36,9 @@ public:
void setClientModel(ClientModel *clientModel); void setClientModel(ClientModel *clientModel);
bool addWallet(WalletModel *walletModel); void addWallet(WalletModel *walletModel);
bool setCurrentWallet(WalletModel* wallet_model); void setCurrentWallet(WalletModel* wallet_model);
bool removeWallet(WalletModel* wallet_model); void removeWallet(WalletModel* wallet_model);
void removeAllWallets(); void removeAllWallets();
bool handlePaymentRequest(const SendCoinsRecipient& recipient); bool handlePaymentRequest(const SendCoinsRecipient& recipient);