[QA] adabt QT_NO_KEYWORDS for QT ban implementation

This commit is contained in:
Jonas Schnelli 2015-07-29 14:34:14 +02:00
parent 07f70b2dde
commit 7f90ea78cb
3 changed files with 8 additions and 9 deletions

View file

@ -54,11 +54,11 @@ public:
#if QT_VERSION >= 0x040700 #if QT_VERSION >= 0x040700
cachedBanlist.reserve(banMap.size()); cachedBanlist.reserve(banMap.size());
#endif #endif
foreach (const PAIRTYPE(CSubNet, CBanEntry)& banentry, banMap) for (banmap_t::iterator it = banMap.begin(); it != banMap.end(); it++)
{ {
CCombinedBan banEntry; CCombinedBan banEntry;
banEntry.subnet = banentry.first; banEntry.subnet = (*it).first;
banEntry.banEntry = banentry.second; banEntry.banEntry = (*it).second;
cachedBanlist.append(banEntry); cachedBanlist.append(banEntry);
} }
@ -161,9 +161,9 @@ QModelIndex BanTableModel::index(int row, int column, const QModelIndex &parent)
void BanTableModel::refresh() void BanTableModel::refresh()
{ {
emit layoutAboutToBeChanged(); Q_EMIT layoutAboutToBeChanged();
priv->refreshBanlist(); priv->refreshBanlist();
emit layoutChanged(); Q_EMIT layoutChanged();
} }
void BanTableModel::sort(int column, Qt::SortOrder order) void BanTableModel::sort(int column, Qt::SortOrder order)

View file

@ -60,7 +60,7 @@ public:
bool shouldShow(); bool shouldShow();
/*@}*/ /*@}*/
public slots: public Q_SLOTS:
void refresh(); void refresh();
private: private:

View file

@ -27,6 +27,7 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QMenu> #include <QMenu>
#include <QScrollBar> #include <QScrollBar>
#include <QSignalMapper>
#include <QThread> #include <QThread>
#include <QTime> #include <QTime>
#include <QTimer> #include <QTimer>
@ -242,7 +243,7 @@ RPCConsole::RPCConsole(const PlatformStyle *platformStyle, QWidget *parent) :
clientModel(0), clientModel(0),
historyPtr(0), historyPtr(0),
cachedNodeid(-1), cachedNodeid(-1),
platformStyle(platformStyle) platformStyle(platformStyle),
peersTableContextMenu(0), peersTableContextMenu(0),
banTableContextMenu(0) banTableContextMenu(0)
{ {
@ -807,7 +808,6 @@ void RPCConsole::banSelectedNode(int bantime)
SplitHostPort(nStr, port, addr); SplitHostPort(nStr, port, addr);
CNode::Ban(CNetAddr(addr), BanReasonManuallyAdded, bantime); CNode::Ban(CNetAddr(addr), BanReasonManuallyAdded, bantime);
DumpBanlist(); // store banlist to disk
bannedNode->fDisconnect = true; bannedNode->fDisconnect = true;
clearSelectedNode(); clearSelectedNode();
@ -827,7 +827,6 @@ void RPCConsole::unbanSelectedNode()
if (possibleSubnet.IsValid()) if (possibleSubnet.IsValid())
{ {
CNode::Unban(possibleSubnet); CNode::Unban(possibleSubnet);
DumpBanlist(); // store banlist to disk
clientModel->getBanTableModel()->refresh(); clientModel->getBanTableModel()->refresh();
} }
} }