aboutsummaryrefslogtreecommitdiff
path: root/src/qt/peertablemodel.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-02-22 09:52:02 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-03-07 16:58:11 +0200
commit9a9f180df0d51396fee2468681df6dd935b0248e (patch)
tree635435f3f33317ee60b5741975c4d753e270bcd1 /src/qt/peertablemodel.cpp
parent778a64af209e4fa692a3aca8376ba1bd5e1af881 (diff)
downloadbitcoin-9a9f180df0d51396fee2468681df6dd935b0248e.tar.xz
qt, refactor: Drop no longer used PeerTableModel::sort function
Diffstat (limited to 'src/qt/peertablemodel.cpp')
-rw-r--r--src/qt/peertablemodel.cpp45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp
index 387f5d5b37..63bfe5f570 100644
--- a/src/qt/peertablemodel.cpp
+++ b/src/qt/peertablemodel.cpp
@@ -11,49 +11,15 @@
#include <utility>
-#include <QDebug>
#include <QList>
#include <QTimer>
-bool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const
-{
- const CNodeStats *pLeft = &(left.nodeStats);
- const CNodeStats *pRight = &(right.nodeStats);
-
- if (order == Qt::DescendingOrder)
- std::swap(pLeft, pRight);
-
- switch (static_cast<PeerTableModel::ColumnIndex>(column)) {
- case PeerTableModel::NetNodeId:
- return pLeft->nodeid < pRight->nodeid;
- case PeerTableModel::Address:
- return pLeft->addrName.compare(pRight->addrName) < 0;
- case PeerTableModel::ConnectionType:
- return pLeft->m_conn_type < pRight->m_conn_type;
- case PeerTableModel::Network:
- return pLeft->m_network < pRight->m_network;
- case PeerTableModel::Ping:
- return pLeft->m_min_ping_time < pRight->m_min_ping_time;
- case PeerTableModel::Sent:
- return pLeft->nSendBytes < pRight->nSendBytes;
- case PeerTableModel::Received:
- return pLeft->nRecvBytes < pRight->nRecvBytes;
- case PeerTableModel::Subversion:
- return pLeft->cleanSubVer.compare(pRight->cleanSubVer) < 0;
- } // no default case, so the compiler can warn about missing cases
- assert(false);
-}
-
// private implementation
class PeerTablePriv
{
public:
/** Local cache of peer information */
QList<CNodeCombinedStats> cachedNodeStats;
- /** Column to sort nodes by (default to unsorted) */
- int sortColumn{-1};
- /** Order (ascending or descending) to sort nodes by */
- Qt::SortOrder sortOrder;
/** Index of rows by node ID */
std::map<NodeId, int> mapNodeRows;
@@ -76,10 +42,6 @@ public:
}
}
- if (sortColumn >= 0)
- // sort cacheNodeStats (use stable sort to prevent rows jumping around unnecessarily)
- std::stable_sort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));
-
// build index map
mapNodeRows.clear();
int row = 0;
@@ -245,10 +207,3 @@ int PeerTableModel::getRowByNodeId(NodeId nodeid)
return it->second;
}
-
-void PeerTableModel::sort(int column, Qt::SortOrder order)
-{
- priv->sortColumn = column;
- priv->sortOrder = order;
- refresh();
-}