mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 22:14:32 +00:00
Revert "Remove obsolete IP_HIDDEN column from peer list." Closes #970.
This reverts commit c8d51e91f415dcef4ce77569cb8d9ac794c41c5f.
This commit is contained in:
parent
ff789fc493
commit
5bf9d7d69a
@ -40,7 +40,7 @@ class PeerListDelegate: public QItemDelegate {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
enum PeerListColumns {COUNTRY, IP, CONNECTION, FLAGS, CLIENT, PROGRESS, DOWN_SPEED, UP_SPEED,
|
enum PeerListColumns {COUNTRY, IP, CONNECTION, FLAGS, CLIENT, PROGRESS, DOWN_SPEED, UP_SPEED,
|
||||||
TOT_DOWN, TOT_UP, COL_COUNT};
|
TOT_DOWN, TOT_UP, IP_HIDDEN, COL_COUNT};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PeerListDelegate(QObject *parent) : QItemDelegate(parent) {}
|
PeerListDelegate(QObject *parent) : QItemDelegate(parent) {}
|
||||||
|
@ -79,15 +79,16 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent):
|
|||||||
//Explicitly set the column visibility. When columns are added/removed
|
//Explicitly set the column visibility. When columns are added/removed
|
||||||
//between versions this prevents some of them being hidden due to
|
//between versions this prevents some of them being hidden due to
|
||||||
//incorrect restoreState() being used.
|
//incorrect restoreState() being used.
|
||||||
for (unsigned int i=0; i<PeerListDelegate::COL_COUNT; i++)
|
for (unsigned int i=0; i<PeerListDelegate::IP_HIDDEN; i++)
|
||||||
showColumn(i);
|
showColumn(i);
|
||||||
|
hideColumn(PeerListDelegate::IP_HIDDEN);
|
||||||
hideColumn(PeerListDelegate::COL_COUNT);
|
hideColumn(PeerListDelegate::COL_COUNT);
|
||||||
if (!Preferences().resolvePeerCountries())
|
if (!Preferences().resolvePeerCountries())
|
||||||
hideColumn(PeerListDelegate::COUNTRY);
|
hideColumn(PeerListDelegate::COUNTRY);
|
||||||
//To also migitate the above issue, we have to resize each column when
|
//To also migitate the above issue, we have to resize each column when
|
||||||
//its size is 0, because explicitely 'showing' the column isn't enough
|
//its size is 0, because explicitely 'showing' the column isn't enough
|
||||||
//in the above scenario.
|
//in the above scenario.
|
||||||
for (unsigned int i=0; i<PeerListDelegate::COL_COUNT; i++)
|
for (unsigned int i=0; i<PeerListDelegate::IP_HIDDEN; i++)
|
||||||
if (!columnWidth(i))
|
if (!columnWidth(i))
|
||||||
resizeColumnToContents(i);
|
resizeColumnToContents(i);
|
||||||
// Context menu
|
// Context menu
|
||||||
@ -148,7 +149,7 @@ void PeerListWidget::showPeerListMenu(const QPoint&)
|
|||||||
QStringList selectedPeerIPs;
|
QStringList selectedPeerIPs;
|
||||||
foreach (const QModelIndex &index, selectedIndexes) {
|
foreach (const QModelIndex &index, selectedIndexes) {
|
||||||
int row = m_proxyModel->mapToSource(index).row();
|
int row = m_proxyModel->mapToSource(index).row();
|
||||||
QString myip = m_listModel->data(m_listModel->index(row, PeerListDelegate::IP)).toString();
|
QString myip = m_listModel->data(m_listModel->index(row, PeerListDelegate::IP_HIDDEN)).toString();
|
||||||
selectedPeerIPs << myip;
|
selectedPeerIPs << myip;
|
||||||
}
|
}
|
||||||
// Add Peer Action
|
// Add Peer Action
|
||||||
@ -368,6 +369,7 @@ QStandardItem* PeerListWidget::addPeer(const QString& ip, const peer_info& peer)
|
|||||||
// Adding Peer to peer list
|
// Adding Peer to peer list
|
||||||
m_listModel->insertRow(row);
|
m_listModel->insertRow(row);
|
||||||
m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP), ip);
|
m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP), ip);
|
||||||
|
m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP_HIDDEN), ip);
|
||||||
if (m_displayFlags) {
|
if (m_displayFlags) {
|
||||||
const QIcon ico = GeoIPManager::CountryISOCodeToIcon(peer.country);
|
const QIcon ico = GeoIPManager::CountryISOCodeToIcon(peer.country);
|
||||||
if (!ico.isNull()) {
|
if (!ico.isNull()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user