Browse Source

Clean up code

adaptive-webui-19844
Chocobo1 2 years ago
parent
commit
21aabfdcb5
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 8
      src/gui/transferlistfilterswidget.cpp
  2. 6
      src/gui/transferlistfilterswidget.h

8
src/gui/transferlistfilterswidget.cpp

@ -66,11 +66,8 @@ namespace @@ -66,11 +66,8 @@ namespace
QString getScheme(const QString &tracker)
{
const QUrl url {tracker};
QString scheme = url.scheme();
if (scheme.isEmpty())
scheme = u"http"_qs;
return scheme;
const QString scheme = QUrl(tracker).scheme();
return !scheme.isEmpty() ? scheme : u"http"_qs;
}
QString getHost(const QString &tracker)
@ -360,7 +357,6 @@ void StatusFilterWidget::torrentAboutToBeDeleted(BitTorrent::Torrent *const torr @@ -360,7 +357,6 @@ void StatusFilterWidget::torrentAboutToBeDeleted(BitTorrent::Torrent *const torr
TrackerFiltersList::TrackerFiltersList(QWidget *parent, TransferListWidget *transferList, const bool downloadFavicon)
: BaseFilterWidget(parent, transferList)
, m_totalTorrents(0)
, m_downloadTrackerFavicon(downloadFavicon)
{
auto *allTrackers = new QListWidgetItem(this);

6
src/gui/transferlistfilterswidget.h

@ -157,12 +157,12 @@ private: @@ -157,12 +157,12 @@ private:
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_warnings; // <torrent ID, tracker hosts>
PathList m_iconPaths;
int m_totalTorrents;
bool m_downloadTrackerFavicon;
int m_totalTorrents = 0;
bool m_downloadTrackerFavicon = false;
};
class TransferListFiltersWidget final : public QFrame

Loading…
Cancel
Save