@@ -33,6 +33,10 @@ bool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombine
33
33
return pLeft->cleanSubVer .compare (pRight->cleanSubVer ) < 0 ;
34
34
case PeerTableModel::Ping:
35
35
return pLeft->dMinPing < pRight->dMinPing ;
36
+ case PeerTableModel::Sent:
37
+ return pLeft->nSendBytes < pRight->nSendBytes ;
38
+ case PeerTableModel::Received:
39
+ return pLeft->nRecvBytes < pRight->nRecvBytes ;
36
40
}
37
41
38
42
return false ;
@@ -114,7 +118,7 @@ PeerTableModel::PeerTableModel(ClientModel *parent) :
114
118
clientModel(parent),
115
119
timer(0 )
116
120
{
117
- columns << tr (" NodeId" ) << tr (" Node/Service" ) << tr (" User Agent " ) << tr (" Ping " );
121
+ columns << tr (" NodeId" ) << tr (" Node/Service" ) << tr (" Ping " ) << tr ( " Sent " ) << tr (" Received " ) << tr ( " User Agent " );
118
122
priv.reset (new PeerTablePriv ());
119
123
// default to unsorted
120
124
priv->sortColumn = -1 ;
@@ -173,10 +177,20 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const
173
177
return QString::fromStdString (rec->nodeStats .cleanSubVer );
174
178
case Ping:
175
179
return GUIUtil::formatPingTime (rec->nodeStats .dMinPing );
180
+ case Sent:
181
+ return GUIUtil::formatBytes (rec->nodeStats .nSendBytes );
182
+ case Received:
183
+ return GUIUtil::formatBytes (rec->nodeStats .nRecvBytes );
176
184
}
177
185
} else if (role == Qt::TextAlignmentRole) {
178
- if (index.column () == Ping)
179
- return (QVariant)(Qt::AlignRight | Qt::AlignVCenter);
186
+ switch (index.column ()) {
187
+ case Ping:
188
+ case Sent:
189
+ case Received:
190
+ return QVariant (Qt::AlignRight | Qt::AlignVCenter);
191
+ default :
192
+ return QVariant ();
193
+ }
180
194
}
181
195
182
196
return QVariant ();
0 commit comments