Revamp tracker list widget

Internally redesign tracker list widget using Qt Model/View architecture.
Make tracker list sortable by any column.

PR #19633.
Closes #261.
This commit is contained in:
Vladimir Golovnev
2023-10-03 08:42:05 +03:00
committed by GitHub
parent 70b438e6d9
commit c051ee9409
30 changed files with 1786 additions and 1106 deletions

View File

@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2015-2022 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2015-2023 Vladimir Golovnev <glassez@yandex.ru>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -29,13 +29,12 @@
#include "trackerentry.h"
#include <QList>
#include <QVector>
QVector<BitTorrent::TrackerEntry> BitTorrent::parseTrackerEntries(const QStringView str)
QList<BitTorrent::TrackerEntry> BitTorrent::parseTrackerEntries(const QStringView str)
{
const QList<QStringView> trackers = str.split(u'\n'); // keep the empty parts to track tracker tier
QVector<BitTorrent::TrackerEntry> entries;
QList<BitTorrent::TrackerEntry> entries;
entries.reserve(trackers.size());
int trackerTier = 0;