Skip to content

Commit

Permalink
Bugfix: Qt/RPCConsole: Put column enum in the right places
Browse files Browse the repository at this point in the history
QModelIndex::data argument is a role, not a column
  • Loading branch information
luke-jr committed Dec 2, 2016
1 parent addfdeb commit df17fe0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,11 +975,11 @@ void RPCConsole::disconnectSelectedNode()
return;

// Get selected peer addresses
QList<QModelIndex> nodes = GUIUtil::getEntryData(ui->peerWidget, 0);
QList<QModelIndex> nodes = GUIUtil::getEntryData(ui->peerWidget, PeerTableModel::NetNodeId);
for(int i = 0; i < nodes.count(); i++)
{
// Get currently selected peer address
NodeId id = nodes.at(i).data(PeerTableModel::NetNodeId).toInt();
NodeId id = nodes.at(i).data().toInt();
// Find the node, disconnect it and clear the selected node
if(g_connman->DisconnectNode(id))
clearSelectedNode();
Expand All @@ -992,11 +992,11 @@ void RPCConsole::banSelectedNode(int bantime)
return;

// Get selected peer addresses
QList<QModelIndex> nodes = GUIUtil::getEntryData(ui->peerWidget, 0);
QList<QModelIndex> nodes = GUIUtil::getEntryData(ui->peerWidget, PeerTableModel::NetNodeId);
for(int i = 0; i < nodes.count(); i++)
{
// Get currently selected peer address
NodeId id = nodes.at(i).data(PeerTableModel::NetNodeId).toInt();
NodeId id = nodes.at(i).data().toInt();

// Get currently selected peer address
int detailNodeRow = clientModel->getPeerTableModel()->getRowByNodeId(id);
Expand All @@ -1019,11 +1019,11 @@ void RPCConsole::unbanSelectedNode()
return;

// Get selected ban addresses
QList<QModelIndex> nodes = GUIUtil::getEntryData(ui->banlistWidget, 0);
QList<QModelIndex> nodes = GUIUtil::getEntryData(ui->banlistWidget, BanTableModel::Address);
for(int i = 0; i < nodes.count(); i++)
{
// Get currently selected ban address
QString strNode = nodes.at(i).data(BanTableModel::Address).toString();
QString strNode = nodes.at(i).data().toString();
CSubNet possibleSubnet;

LookupSubNet(strNode.toStdString().c_str(), possibleSubnet);
Expand Down

0 comments on commit df17fe0

Please sign in to comment.