Skip to content

Commit

Permalink
[QA] adabt QT_NO_KEYWORDS for QT ban implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschnelli committed Sep 16, 2015
1 parent 07f70b2 commit 7f90ea7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/qt/bantablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class BanTablePriv
#if QT_VERSION >= 0x040700
cachedBanlist.reserve(banMap.size());
#endif
foreach (const PAIRTYPE(CSubNet, CBanEntry)& banentry, banMap)
for (banmap_t::iterator it = banMap.begin(); it != banMap.end(); it++)
{
CCombinedBan banEntry;
banEntry.subnet = banentry.first;
banEntry.banEntry = banentry.second;
banEntry.subnet = (*it).first;
banEntry.banEntry = (*it).second;
cachedBanlist.append(banEntry);
}

Expand Down Expand Up @@ -161,9 +161,9 @@ QModelIndex BanTableModel::index(int row, int column, const QModelIndex &parent)

void BanTableModel::refresh()
{
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
priv->refreshBanlist();
emit layoutChanged();
Q_EMIT layoutChanged();
}

void BanTableModel::sort(int column, Qt::SortOrder order)
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bantablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class BanTableModel : public QAbstractTableModel
bool shouldShow();
/*@}*/

public slots:
public Q_SLOTS:
void refresh();

private:
Expand Down
5 changes: 2 additions & 3 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <QKeyEvent>
#include <QMenu>
#include <QScrollBar>
#include <QSignalMapper>
#include <QThread>
#include <QTime>
#include <QTimer>
Expand Down Expand Up @@ -242,7 +243,7 @@ RPCConsole::RPCConsole(const PlatformStyle *platformStyle, QWidget *parent) :
clientModel(0),
historyPtr(0),
cachedNodeid(-1),
platformStyle(platformStyle)
platformStyle(platformStyle),
peersTableContextMenu(0),
banTableContextMenu(0)
{
Expand Down Expand Up @@ -807,7 +808,6 @@ void RPCConsole::banSelectedNode(int bantime)
SplitHostPort(nStr, port, addr);

CNode::Ban(CNetAddr(addr), BanReasonManuallyAdded, bantime);
DumpBanlist(); // store banlist to disk
bannedNode->fDisconnect = true;

clearSelectedNode();
Expand All @@ -827,7 +827,6 @@ void RPCConsole::unbanSelectedNode()
if (possibleSubnet.IsValid())
{
CNode::Unban(possibleSubnet);
DumpBanlist(); // store banlist to disk
clientModel->getBanTableModel()->refresh();
}
}
Expand Down

0 comments on commit 7f90ea7

Please sign in to comment.