Skip to content

Commit

Permalink
qt: Drop BitcoinGUI* WalletFrame data member
Browse files Browse the repository at this point in the history
This changes removes bitcoingui->walletframe->bitcoingui circular
dependency.

This commit does not change behavior.
  • Loading branch information
hebasto committed May 29, 2021
1 parent f73e5c9 commit 62cb8d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/qt/walletframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <qt/walletframe.h>

#include <qt/bitcoingui.h>
#include <qt/overviewpage.h>
#include <qt/walletmodel.h>
#include <qt/walletview.h>
Expand All @@ -17,9 +16,8 @@
#include <QPushButton>
#include <QVBoxLayout>

WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, BitcoinGUI* _gui)
: QFrame(_gui),
gui(_gui),
WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, QWidget* parent)
: QFrame(parent),
platformStyle(_platformStyle),
m_size_hint(OverviewPage{platformStyle, nullptr}.sizeHint())
{
Expand Down Expand Up @@ -62,7 +60,7 @@ void WalletFrame::setClientModel(ClientModel *_clientModel)

bool WalletFrame::addWallet(WalletModel* walletModel, WalletView* walletView)
{
if (!gui || !clientModel || !walletModel) return false;
if (!clientModel || !walletModel) return false;

if (mapWalletViews.count(walletModel) > 0) return false;

Expand Down
4 changes: 1 addition & 3 deletions src/qt/walletframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <QFrame>
#include <QMap>

class BitcoinGUI;
class ClientModel;
class PlatformStyle;
class SendCoinsRecipient;
Expand All @@ -31,7 +30,7 @@ class WalletFrame : public QFrame
Q_OBJECT

public:
explicit WalletFrame(const PlatformStyle *platformStyle, BitcoinGUI *_gui = nullptr);
explicit WalletFrame(const PlatformStyle* platformStyle, QWidget* parent);
~WalletFrame();

void setClientModel(ClientModel *clientModel);
Expand All @@ -55,7 +54,6 @@ class WalletFrame : public QFrame

private:
QStackedWidget *walletStack;
BitcoinGUI *gui;
ClientModel *clientModel;
QMap<WalletModel*, WalletView*> mapWalletViews;

Expand Down
1 change: 0 additions & 1 deletion test/lint/lint-circular-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ EXPECTED_CIRCULAR_DEPENDENCIES=(
"index/coinstatsindex -> node/coinstats -> index/coinstatsindex"
"policy/fees -> txmempool -> policy/fees"
"qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel"
"qt/bitcoingui -> qt/walletframe -> qt/bitcoingui"
"qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel"
"qt/sendcoinsdialog -> qt/walletmodel -> qt/sendcoinsdialog"
"qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel"
Expand Down

0 comments on commit 62cb8d9

Please sign in to comment.