Skip to content

Commit

Permalink
gui: Remove unused return type in some BitcoinGUI methods
Browse files Browse the repository at this point in the history
  • Loading branch information
promag committed Jan 15, 2019
1 parent a5daf70 commit f411c8b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
24 changes: 11 additions & 13 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,9 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
}

#ifdef ENABLE_WALLET
bool BitcoinGUI::addWallet(WalletModel *walletModel)
void BitcoinGUI::addWallet(WalletModel* walletModel)
{
if(!walletFrame)
return false;
if (!walletFrame) return;
const QString display_name = walletModel->getDisplayName();
setWalletActionsEnabled(true);
m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel));
Expand All @@ -583,12 +582,12 @@ bool BitcoinGUI::addWallet(WalletModel *walletModel)
m_wallet_selector_action->setVisible(true);
}
rpcConsole->addWallet(walletModel);
return walletFrame->addWallet(walletModel);
walletFrame->addWallet(walletModel);
}

bool BitcoinGUI::removeWallet(WalletModel* walletModel)
void BitcoinGUI::removeWallet(WalletModel* walletModel)
{
if (!walletFrame) return false;
if (!walletFrame) return;
int index = m_wallet_selector->findData(QVariant::fromValue(walletModel));
m_wallet_selector->removeItem(index);
if (m_wallet_selector->count() == 0) {
Expand All @@ -598,20 +597,19 @@ bool BitcoinGUI::removeWallet(WalletModel* walletModel)
m_wallet_selector_action->setVisible(false);
}
rpcConsole->removeWallet(walletModel);
return walletFrame->removeWallet(walletModel);
walletFrame->removeWallet(walletModel);
}

bool BitcoinGUI::setCurrentWallet(WalletModel* wallet_model)
void BitcoinGUI::setCurrentWallet(WalletModel* wallet_model)
{
if(!walletFrame)
return false;
return walletFrame->setCurrentWallet(wallet_model);
if (!walletFrame) return;
walletFrame->setCurrentWallet(wallet_model);
}

bool BitcoinGUI::setCurrentWalletBySelectorIndex(int index)
void BitcoinGUI::setCurrentWalletBySelectorIndex(int index)
{
WalletModel* wallet_model = m_wallet_selector->itemData(index).value<WalletModel*>();
return setCurrentWallet(wallet_model);
setCurrentWallet(wallet_model);
}

void BitcoinGUI::removeAllWallets()
Expand Down
8 changes: 4 additions & 4 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class BitcoinGUI : public QMainWindow
The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
functionality.
*/
bool addWallet(WalletModel *walletModel);
bool removeWallet(WalletModel* walletModel);
void addWallet(WalletModel* walletModel);
void removeWallet(WalletModel* walletModel);
void removeAllWallets();
#endif // ENABLE_WALLET
bool enableWallet = false;
Expand Down Expand Up @@ -213,8 +213,8 @@ public Q_SLOTS:
void message(const QString &title, const QString &message, unsigned int style, bool *ret = nullptr);

#ifdef ENABLE_WALLET
bool setCurrentWallet(WalletModel* wallet_model);
bool setCurrentWalletBySelectorIndex(int index);
void setCurrentWallet(WalletModel* wallet_model);
void setCurrentWalletBySelectorIndex(int index);
/** Set the UI status indicators based on the currently selected wallet.
*/
void updateWalletStatus();
Expand Down

0 comments on commit f411c8b

Please sign in to comment.