mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Peers can now be sorted by country
This commit is contained in:
parent
328e4fd860
commit
a83fbf5a98
2 changed files with 15 additions and 1 deletions
|
@ -45,7 +45,7 @@
|
|||
#include <vector>
|
||||
#include "qinisettings.h"
|
||||
|
||||
PeerListWidget::PeerListWidget(PropertiesWidget *parent): properties(parent), display_flags(false) {
|
||||
PeerListWidget::PeerListWidget(PropertiesWidget *parent): QTreeView(parent), properties(parent), display_flags(false) {
|
||||
// Visual settings
|
||||
setRootIsDecorated(false);
|
||||
setItemsExpandable(false);
|
||||
|
@ -78,6 +78,9 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent): properties(parent), di
|
|||
loadSettings();
|
||||
// IP to Hostname resolver
|
||||
updatePeerHostNameResolutionState();
|
||||
// SIGNAL/SLOT
|
||||
connect(header(), SIGNAL(sectionClicked(int)), SLOT(handleSortColumnChanged(int)));
|
||||
handleSortColumnChanged(header()->sortIndicatorSection());
|
||||
}
|
||||
|
||||
PeerListWidget::~PeerListWidget() {
|
||||
|
@ -400,3 +403,13 @@ void PeerListWidget::handleResolved(QString ip, QString hostname) {
|
|||
//listModel->setData(listModel->index(item->row(), IP), hostname);
|
||||
}
|
||||
}
|
||||
|
||||
void PeerListWidget::handleSortColumnChanged(int col)
|
||||
{
|
||||
if(col == 0) {
|
||||
qDebug("Sorting by decoration");
|
||||
proxyModel->setSortRole(Qt::ToolTipRole);
|
||||
} else {
|
||||
proxyModel->setSortRole(Qt::DisplayRole);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue