mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user