Skip to content

Commit df17fe0

Browse files
committed
Bugfix: Qt/RPCConsole: Put column enum in the right places
QModelIndex::data argument is a role, not a column
1 parent addfdeb commit df17fe0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/qt/rpcconsole.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -975,11 +975,11 @@ void RPCConsole::disconnectSelectedNode()
975975
return;
976976

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

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

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

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

10291029
LookupSubNet(strNode.toStdString().c_str(), possibleSubnet);

0 commit comments

Comments
 (0)