|
|
|
@ -385,7 +385,7 @@ QStandardItem* PeerListWidget::addPeer(const QString& ip, const peer_info& peer)
@@ -385,7 +385,7 @@ QStandardItem* PeerListWidget::addPeer(const QString& ip, const peer_info& peer)
|
|
|
|
|
m_missingFlags.insert(ip); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
m_listModel->setData(m_listModel->index(row, PeerListDelegate::CONNECTION), getConnectionString(peer.connection_type)); |
|
|
|
|
m_listModel->setData(m_listModel->index(row, PeerListDelegate::CONNECTION), getConnectionString(peer)); |
|
|
|
|
QString flags, tooltip; |
|
|
|
|
getFlags(peer, flags, tooltip); |
|
|
|
|
m_listModel->setData(m_listModel->index(row, PeerListDelegate::FLAGS), flags); |
|
|
|
@ -411,7 +411,7 @@ void PeerListWidget::updatePeer(const QString& ip, const peer_info& peer) {
@@ -411,7 +411,7 @@ void PeerListWidget::updatePeer(const QString& ip, const peer_info& peer) {
|
|
|
|
|
m_missingFlags.remove(ip); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
m_listModel->setData(m_listModel->index(row, PeerListDelegate::CONNECTION), getConnectionString(peer.connection_type)); |
|
|
|
|
m_listModel->setData(m_listModel->index(row, PeerListDelegate::CONNECTION), getConnectionString(peer)); |
|
|
|
|
QString flags, tooltip; |
|
|
|
|
getFlags(peer, flags, tooltip); |
|
|
|
|
m_listModel->setData(m_listModel->index(row, PeerListDelegate::FLAGS), flags); |
|
|
|
@ -442,13 +442,18 @@ void PeerListWidget::handleSortColumnChanged(int col)
@@ -442,13 +442,18 @@ void PeerListWidget::handleSortColumnChanged(int col)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QString PeerListWidget::getConnectionString(int connection_type) |
|
|
|
|
QString PeerListWidget::getConnectionString(const peer_info& peer) |
|
|
|
|
{ |
|
|
|
|
#if LIBTORRENT_VERSION_NUM < 10000 |
|
|
|
|
if (peer.connection_type & peer_info::bittorrent_utp) { |
|
|
|
|
#else |
|
|
|
|
if (peer.flags & peer_info::utp_socket) { |
|
|
|
|
#endif |
|
|
|
|
return QString::fromUtf8("μTP"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QString connection; |
|
|
|
|
switch(connection_type) { |
|
|
|
|
case peer_info::bittorrent_utp: |
|
|
|
|
connection = "uTP"; |
|
|
|
|
break; |
|
|
|
|
switch(peer.connection_type) { |
|
|
|
|
case peer_info::http_seed: |
|
|
|
|
case peer_info::web_seed: |
|
|
|
|
connection = "Web"; |
|
|
|
@ -556,7 +561,11 @@ void PeerListWidget::getFlags(const peer_info& peer, QString& flags, QString& to
@@ -556,7 +561,11 @@ void PeerListWidget::getFlags(const peer_info& peer, QString& flags, QString& to
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//P = Peer is using uTorrent uTP
|
|
|
|
|
#if LIBTORRENT_VERSION_NUM < 10000 |
|
|
|
|
if (peer.connection_type & peer_info::bittorrent_utp) { |
|
|
|
|
#else |
|
|
|
|
if (peer.flags & peer_info::utp_socket) { |
|
|
|
|
#endif |
|
|
|
|
flags += "P "; |
|
|
|
|
tooltip += QString::fromUtf8("μTP"); |
|
|
|
|
tooltip += ", "; |
|
|
|
|