Changeset View
Changeset View
Standalone View
Standalone View
src/qt/peertablemodel.cpp
Show All 22 Lines | bool NodeLessThan::operator()(const CNodeCombinedStats &left, | ||||
if (order == Qt::DescendingOrder) { | if (order == Qt::DescendingOrder) { | ||||
std::swap(pLeft, pRight); | std::swap(pLeft, pRight); | ||||
} | } | ||||
switch (column) { | switch (column) { | ||||
case PeerTableModel::NetNodeId: | case PeerTableModel::NetNodeId: | ||||
return pLeft->nodeid < pRight->nodeid; | return pLeft->nodeid < pRight->nodeid; | ||||
case PeerTableModel::Address: | case PeerTableModel::Address: | ||||
return pLeft->addrName.compare(pRight->addrName) < 0; | return pLeft->m_addr_name.compare(pRight->m_addr_name) < 0; | ||||
case PeerTableModel::Network: | case PeerTableModel::Network: | ||||
return pLeft->m_network < pRight->m_network; | return pLeft->m_network < pRight->m_network; | ||||
case PeerTableModel::Ping: | case PeerTableModel::Ping: | ||||
return pLeft->m_min_ping_time < pRight->m_min_ping_time; | return pLeft->m_min_ping_time < pRight->m_min_ping_time; | ||||
case PeerTableModel::Sent: | case PeerTableModel::Sent: | ||||
return pLeft->nSendBytes < pRight->nSendBytes; | return pLeft->nSendBytes < pRight->nSendBytes; | ||||
case PeerTableModel::Received: | case PeerTableModel::Received: | ||||
return pLeft->nRecvBytes < pRight->nRecvBytes; | return pLeft->nRecvBytes < pRight->nRecvBytes; | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | QVariant PeerTableModel::data(const QModelIndex &index, int role) const { | ||||
if (role == Qt::DisplayRole) { | if (role == Qt::DisplayRole) { | ||||
switch (index.column()) { | switch (index.column()) { | ||||
case NetNodeId: | case NetNodeId: | ||||
return (qint64)rec->nodeStats.nodeid; | return (qint64)rec->nodeStats.nodeid; | ||||
case Address: | case Address: | ||||
// prepend to peer address down-arrow symbol for inbound | // prepend to peer address down-arrow symbol for inbound | ||||
// connection and up-arrow for outbound connection | // connection and up-arrow for outbound connection | ||||
return QString(rec->nodeStats.fInbound ? "↓ " : "↑ ") + | return QString(rec->nodeStats.fInbound ? "↓ " : "↑ ") + | ||||
QString::fromStdString(rec->nodeStats.addrName); | QString::fromStdString(rec->nodeStats.m_addr_name); | ||||
case Network: | case Network: | ||||
return GUIUtil::NetworkToQString(rec->nodeStats.m_network); | return GUIUtil::NetworkToQString(rec->nodeStats.m_network); | ||||
case Ping: | case Ping: | ||||
return GUIUtil::formatPingTime(rec->nodeStats.m_min_ping_time); | return GUIUtil::formatPingTime(rec->nodeStats.m_min_ping_time); | ||||
case Sent: | case Sent: | ||||
return GUIUtil::formatBytes(rec->nodeStats.nSendBytes); | return GUIUtil::formatBytes(rec->nodeStats.nSendBytes); | ||||
case Received: | case Received: | ||||
return GUIUtil::formatBytes(rec->nodeStats.nRecvBytes); | return GUIUtil::formatBytes(rec->nodeStats.nRecvBytes); | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |