mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-12 15:57:57 +00:00
Clean up code
This commit is contained in:
parent
3b0ac0962e
commit
21aabfdcb5
@ -66,11 +66,8 @@ namespace
|
|||||||
|
|
||||||
QString getScheme(const QString &tracker)
|
QString getScheme(const QString &tracker)
|
||||||
{
|
{
|
||||||
const QUrl url {tracker};
|
const QString scheme = QUrl(tracker).scheme();
|
||||||
QString scheme = url.scheme();
|
return !scheme.isEmpty() ? scheme : u"http"_qs;
|
||||||
if (scheme.isEmpty())
|
|
||||||
scheme = u"http"_qs;
|
|
||||||
return scheme;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getHost(const QString &tracker)
|
QString getHost(const QString &tracker)
|
||||||
@ -360,7 +357,6 @@ void StatusFilterWidget::torrentAboutToBeDeleted(BitTorrent::Torrent *const torr
|
|||||||
|
|
||||||
TrackerFiltersList::TrackerFiltersList(QWidget *parent, TransferListWidget *transferList, const bool downloadFavicon)
|
TrackerFiltersList::TrackerFiltersList(QWidget *parent, TransferListWidget *transferList, const bool downloadFavicon)
|
||||||
: BaseFilterWidget(parent, transferList)
|
: BaseFilterWidget(parent, transferList)
|
||||||
, m_totalTorrents(0)
|
|
||||||
, m_downloadTrackerFavicon(downloadFavicon)
|
, m_downloadTrackerFavicon(downloadFavicon)
|
||||||
{
|
{
|
||||||
auto *allTrackers = new QListWidgetItem(this);
|
auto *allTrackers = new QListWidgetItem(this);
|
||||||
|
@ -157,12 +157,12 @@ private:
|
|||||||
QListWidgetItem *item = nullptr;
|
QListWidgetItem *item = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
QHash<QString, TrackerData> m_trackers;
|
QHash<QString, TrackerData> m_trackers; // <tracker host, tracker data>
|
||||||
QHash<BitTorrent::TorrentID, QSet<QString>> m_errors; // <torrent ID, tracker hosts>
|
QHash<BitTorrent::TorrentID, QSet<QString>> m_errors; // <torrent ID, tracker hosts>
|
||||||
QHash<BitTorrent::TorrentID, QSet<QString>> m_warnings; // <torrent ID, tracker hosts>
|
QHash<BitTorrent::TorrentID, QSet<QString>> m_warnings; // <torrent ID, tracker hosts>
|
||||||
PathList m_iconPaths;
|
PathList m_iconPaths;
|
||||||
int m_totalTorrents;
|
int m_totalTorrents = 0;
|
||||||
bool m_downloadTrackerFavicon;
|
bool m_downloadTrackerFavicon = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TransferListFiltersWidget final : public QFrame
|
class TransferListFiltersWidget final : public QFrame
|
||||||
|
Loading…
Reference in New Issue
Block a user