mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-14 06:32:33 +01:00
Remove direct bitcoin calls from qt/bantablemodel.cpp
This commit is contained in:
committed by
John Newbery
parent
e0b66a3b7c
commit
3034a462a5
@@ -8,6 +8,7 @@
|
||||
#include <qt/guiconstants.h>
|
||||
#include <qt/guiutil.h>
|
||||
|
||||
#include <interface/node.h>
|
||||
#include <sync.h>
|
||||
#include <utiltime.h>
|
||||
|
||||
@@ -45,11 +46,10 @@ public:
|
||||
Qt::SortOrder sortOrder;
|
||||
|
||||
/** Pull a full list of banned nodes from CNode into our cache */
|
||||
void refreshBanlist()
|
||||
void refreshBanlist(interface::Node& node)
|
||||
{
|
||||
banmap_t banMap;
|
||||
if(g_connman)
|
||||
g_connman->GetBanned(banMap);
|
||||
node.getBanned(banMap);
|
||||
|
||||
cachedBanlist.clear();
|
||||
#if QT_VERSION >= 0x040700
|
||||
@@ -82,8 +82,9 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
BanTableModel::BanTableModel(ClientModel *parent) :
|
||||
BanTableModel::BanTableModel(interface::Node& node, ClientModel *parent) :
|
||||
QAbstractTableModel(parent),
|
||||
m_node(node),
|
||||
clientModel(parent)
|
||||
{
|
||||
columns << tr("IP/Netmask") << tr("Banned Until");
|
||||
@@ -168,7 +169,7 @@ QModelIndex BanTableModel::index(int row, int column, const QModelIndex &parent)
|
||||
void BanTableModel::refresh()
|
||||
{
|
||||
Q_EMIT layoutAboutToBeChanged();
|
||||
priv->refreshBanlist();
|
||||
priv->refreshBanlist(m_node);
|
||||
Q_EMIT layoutChanged();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user