mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 04:12:36 -03:00
qt, refactor: Declare WalletModel
member functions with const
This commit is contained in:
parent
be7a5f2fc4
commit
f70ee34c71
2 changed files with 14 additions and 16 deletions
|
@ -145,7 +145,7 @@ void WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly)
|
|||
Q_EMIT notifyWatchonlyChanged(fHaveWatchonly);
|
||||
}
|
||||
|
||||
bool WalletModel::validateAddress(const QString &address)
|
||||
bool WalletModel::validateAddress(const QString& address) const
|
||||
{
|
||||
return IsValidDestinationString(address.toStdString());
|
||||
}
|
||||
|
@ -284,22 +284,22 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
|
|||
return SendCoinsReturn(OK);
|
||||
}
|
||||
|
||||
OptionsModel *WalletModel::getOptionsModel()
|
||||
OptionsModel* WalletModel::getOptionsModel() const
|
||||
{
|
||||
return optionsModel;
|
||||
}
|
||||
|
||||
AddressTableModel *WalletModel::getAddressTableModel()
|
||||
AddressTableModel* WalletModel::getAddressTableModel() const
|
||||
{
|
||||
return addressTableModel;
|
||||
}
|
||||
|
||||
TransactionTableModel *WalletModel::getTransactionTableModel()
|
||||
TransactionTableModel* WalletModel::getTransactionTableModel() const
|
||||
{
|
||||
return transactionTableModel;
|
||||
}
|
||||
|
||||
RecentRequestsTableModel *WalletModel::getRecentRequestsTableModel()
|
||||
RecentRequestsTableModel* WalletModel::getRecentRequestsTableModel() const
|
||||
{
|
||||
return recentRequestsTableModel;
|
||||
}
|
||||
|
@ -557,7 +557,7 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool WalletModel::displayAddress(std::string sAddress)
|
||||
bool WalletModel::displayAddress(std::string sAddress) const
|
||||
{
|
||||
CTxDestination dest = DecodeDestination(sAddress);
|
||||
bool res = false;
|
||||
|
@ -585,7 +585,7 @@ QString WalletModel::getDisplayName() const
|
|||
return name.isEmpty() ? "["+tr("default wallet")+"]" : name;
|
||||
}
|
||||
|
||||
bool WalletModel::isMultiwallet()
|
||||
bool WalletModel::isMultiwallet() const
|
||||
{
|
||||
return m_node.walletLoader().getWallets().size() > 1;
|
||||
}
|
||||
|
|
|
@ -77,15 +77,15 @@ public:
|
|||
Unlocked // wallet->IsCrypted() && !wallet->IsLocked()
|
||||
};
|
||||
|
||||
OptionsModel *getOptionsModel();
|
||||
AddressTableModel *getAddressTableModel();
|
||||
TransactionTableModel *getTransactionTableModel();
|
||||
RecentRequestsTableModel *getRecentRequestsTableModel();
|
||||
OptionsModel* getOptionsModel() const;
|
||||
AddressTableModel* getAddressTableModel() const;
|
||||
TransactionTableModel* getTransactionTableModel() const;
|
||||
RecentRequestsTableModel* getRecentRequestsTableModel() const;
|
||||
|
||||
EncryptionStatus getEncryptionStatus() const;
|
||||
|
||||
// Check address for validity
|
||||
bool validateAddress(const QString &address);
|
||||
bool validateAddress(const QString& address) const;
|
||||
|
||||
// Return status record for SendCoins, contains error id + information
|
||||
struct SendCoinsReturn
|
||||
|
@ -137,7 +137,7 @@ public:
|
|||
UnlockContext requestUnlock();
|
||||
|
||||
bool bumpFee(uint256 hash, uint256& new_hash);
|
||||
bool displayAddress(std::string sAddress);
|
||||
bool displayAddress(std::string sAddress) const;
|
||||
|
||||
static bool isWalletEnabled();
|
||||
|
||||
|
@ -149,9 +149,7 @@ public:
|
|||
QString getWalletName() const;
|
||||
QString getDisplayName() const;
|
||||
|
||||
bool isMultiwallet();
|
||||
|
||||
AddressTableModel* getAddressTableModel() const { return addressTableModel; }
|
||||
bool isMultiwallet() const;
|
||||
|
||||
void refresh(bool pk_hash_only = false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue