aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-05-09 22:31:00 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-05-09 22:33:58 +0200
commitb9219b233fdc4fe58b4aefbb30f3db09b064840c (patch)
tree4a55e54cd2e5782d0322646aef6d6983b0199264 /src/qt/walletmodel.cpp
parent3dd95cb5c2917f7216d0a06d163bc940ee9ad85a (diff)
parentf70ee34c71aeeb814fe65a69952343dccdb7b906 (diff)
downloadbitcoin-b9219b233fdc4fe58b4aefbb30f3db09b064840c.tar.xz
Merge bitcoin-core/gui#590: refactor: Declare `WalletModel` member functions with `const`
f70ee34c71aeeb814fe65a69952343dccdb7b906 qt, refactor: Declare `WalletModel` member functions with `const` (Hennadii Stepanov) Pull request description: After bitcoin/bitcoin#12830 the `WalletModel` class has two member functions: https://github.com/bitcoin-core/gui/blob/be7a5f2fc400e7a3ef72dedbdcf49dd6c96d4f9e/src/qt/walletmodel.h#L81 and https://github.com/bitcoin-core/gui/blob/be7a5f2fc400e7a3ef72dedbdcf49dd6c96d4f9e/src/qt/walletmodel.h#L154 This PR drops the former one as redundant, and declares `WalletModel` member functions with the `const` qualifier where appropriate. ACKs for top commit: promag: Code review ACK f70ee34c71aeeb814fe65a69952343dccdb7b906. kristapsk: cr ACK f70ee34c71aeeb814fe65a69952343dccdb7b906 w0xlt: Code Review ACK https://github.com/bitcoin-core/gui/pull/590/commits/f70ee34c71aeeb814fe65a69952343dccdb7b906 Tree-SHA512: 43e6661822c667229ea860fb94c2e3154c33773dbd9fca1f6f76cc31c5875a1a0e8caa65ddfc20dec2a43e29e7b2469b3b6fa148fe7ec000ded518b4958b2b38
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r--src/qt/walletmodel.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 070608ec0b..1f6c90af4a 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -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;
}