mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Update trackers edition code
- current tracker is now updated regularly when properties are displayed
This commit is contained in:
parent
f839d6fe41
commit
3e36cd3c46
3 changed files with 34 additions and 9 deletions
10
src/misc.h
10
src/misc.h
|
@ -31,6 +31,9 @@
|
|||
#include <QPair>
|
||||
#include <QThread>
|
||||
|
||||
#include <libtorrent/torrent_info.hpp>
|
||||
using namespace libtorrent;
|
||||
|
||||
#define MAX_CHAR_TMP 128
|
||||
|
||||
/* Miscellaneaous functions that can be useful */
|
||||
|
@ -144,6 +147,13 @@ class misc : public QObject{
|
|||
return QString();
|
||||
}
|
||||
|
||||
static void fixTrackersTiers(std::vector<announce_entry> trackers){
|
||||
unsigned int nbTrackers = trackers.size();
|
||||
for(unsigned int i=0; i<nbTrackers; ++i){
|
||||
trackers[i].tier = i;
|
||||
}
|
||||
}
|
||||
|
||||
// Insertion sort, used instead of bubble sort because it is
|
||||
// approx. 5 times faster.
|
||||
template <class T> static void insertSort(QList<QPair<int, T> > &list, const QPair<int, T>& value, Qt::SortOrder sortOrder){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue