aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletview.h
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-08-07 17:01:16 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-08-26 16:27:56 +0300
commit404373bc6ac0589e9e28690c9d09114d626a3dc3 (patch)
tree88062f7855915e3aa40b05fa13b0f37948cd35c3 /src/qt/walletview.h
parent774a4f517cf63df345e6a4852cc0b135b0a9ab76 (diff)
downloadbitcoin-404373bc6ac0589e9e28690c9d09114d626a3dc3.tar.xz
qt, refactor: Pass WalletModel object to WalletView constructor
An instance of the WalletView class without walletModel data member being set is invalid. So, it is better to set it in the constructor.
Diffstat (limited to 'src/qt/walletview.h')
-rw-r--r--src/qt/walletview.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qt/walletview.h b/src/qt/walletview.h
index bb6ad0f69e..71c8368bfa 100644
--- a/src/qt/walletview.h
+++ b/src/qt/walletview.h
@@ -35,7 +35,7 @@ class WalletView : public QStackedWidget
Q_OBJECT
public:
- explicit WalletView(const PlatformStyle *platformStyle, QWidget *parent);
+ explicit WalletView(WalletModel* wallet_model, const PlatformStyle* platformStyle, QWidget* parent);
~WalletView();
/** Set the client model.
@@ -43,11 +43,6 @@ public:
*/
void setClientModel(ClientModel *clientModel);
WalletModel *getWalletModel() { return walletModel; }
- /** Set the wallet model.
- The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
- functionality.
- */
- void setWalletModel(WalletModel *walletModel);
bool handlePaymentRequest(const SendCoinsRecipient& recipient);
@@ -55,7 +50,12 @@ public:
private:
ClientModel *clientModel;
- WalletModel *walletModel;
+
+ //!
+ //! The wallet model represents a bitcoin wallet, and offers access to
+ //! the list of transactions, address book and sending functionality.
+ //!
+ WalletModel* const walletModel;
OverviewPage *overviewPage;
QWidget *transactionsPage;