Merge #18060: gui: Drop PeerTableModel dependency to ClientModel

ff59bcd3213ef61f2167c0aa60fcaf5afbc20c61 gui: Drop PeerTableModel dependency to ClientModel (João Barbosa)

Pull request description:

  Class `PeerTableModel` doesn't actually depend on `ClientModel`.

ACKs for top commit:
  Empact:
    Code Review ACK ff59bcd321
  hebasto:
    ACK ff59bcd3213ef61f2167c0aa60fcaf5afbc20c61, tested on Linux Mint 19.3. No changes in behavior are observed.

Tree-SHA512: 29fa3c316c05b8f7b9340e5859bbb8c3a0b826aa7c865c892cfa13b5ad30f822fcaae4e01555f7860cd1727f20b7ef555a808235522a04a6eebaaa7b605f8595
This commit is contained in:
fanquake 2020-02-04 14:32:14 +08:00 committed by PastaPastaPasta
parent 6376fa035c
commit 8c3fcf162c
3 changed files with 2 additions and 7 deletions

View File

@ -4,7 +4,6 @@
#include <qt/peertablemodel.h> #include <qt/peertablemodel.h>
#include <qt/clientmodel.h>
#include <qt/guiconstants.h> #include <qt/guiconstants.h>
#include <qt/guiutil.h> #include <qt/guiutil.h>
@ -101,10 +100,9 @@ public:
} }
}; };
PeerTableModel::PeerTableModel(interfaces::Node& node, ClientModel *parent) : PeerTableModel::PeerTableModel(interfaces::Node& node, QObject* parent) :
QAbstractTableModel(parent), QAbstractTableModel(parent),
m_node(node), m_node(node),
clientModel(parent),
timer(nullptr) timer(nullptr)
{ {
columns << tr("NodeId") << tr("Node/Service") << tr("Ping") << tr("Sent") << tr("Received") << tr("User Agent"); columns << tr("NodeId") << tr("Node/Service") << tr("Ping") << tr("Sent") << tr("Received") << tr("User Agent");

View File

@ -13,7 +13,6 @@
#include <QAbstractTableModel> #include <QAbstractTableModel>
#include <QStringList> #include <QStringList>
class ClientModel;
class PeerTablePriv; class PeerTablePriv;
namespace interfaces { namespace interfaces {
@ -51,7 +50,7 @@ class PeerTableModel : public QAbstractTableModel
Q_OBJECT Q_OBJECT
public: public:
explicit PeerTableModel(interfaces::Node& node, ClientModel *parent = nullptr); explicit PeerTableModel(interfaces::Node& node, QObject* parent);
~PeerTableModel(); ~PeerTableModel();
const CNodeCombinedStats *getNodeStats(int idx); const CNodeCombinedStats *getNodeStats(int idx);
int getRowByNodeId(NodeId nodeid); int getRowByNodeId(NodeId nodeid);
@ -83,7 +82,6 @@ public Q_SLOTS:
private: private:
interfaces::Node& m_node; interfaces::Node& m_node;
ClientModel *clientModel;
QStringList columns; QStringList columns;
std::unique_ptr<PeerTablePriv> priv; std::unique_ptr<PeerTablePriv> priv;
QTimer *timer; QTimer *timer;

View File

@ -14,7 +14,6 @@ EXPECTED_CIRCULAR_DEPENDENCIES=(
"policy/fees -> txmempool -> policy/fees" "policy/fees -> txmempool -> policy/fees"
"qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel" "qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel"
"qt/bitcoingui -> qt/walletframe -> qt/bitcoingui" "qt/bitcoingui -> qt/walletframe -> qt/bitcoingui"
"qt/clientmodel -> qt/peertablemodel -> qt/clientmodel"
"qt/paymentserver -> qt/walletmodel -> qt/paymentserver" "qt/paymentserver -> qt/walletmodel -> qt/paymentserver"
"qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel" "qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel"
"qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel" "qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel"