Improve tracker entries handling

This commit is contained in:
Vladimir Golovnev (Glassez)
2021-03-01 16:06:08 +03:00
committed by sledgehammer999
parent 726455ac3e
commit b2c7d8211f
17 changed files with 194 additions and 215 deletions

View File

@@ -96,7 +96,7 @@ void TrackersAdditionDialog::torrentListDownloadFinished(const Net::DownloadResu
existingTrackers.reserve(trackersFromUser.size());
for (const QString &userURL : trackersFromUser)
{
const BitTorrent::TrackerEntry userTracker(userURL);
const BitTorrent::TrackerEntry userTracker {userURL};
if (!existingTrackers.contains(userTracker))
existingTrackers << userTracker;
}
@@ -113,7 +113,7 @@ void TrackersAdditionDialog::torrentListDownloadFinished(const Net::DownloadResu
const QString line = buffer.readLine().trimmed();
if (line.isEmpty()) continue;
BitTorrent::TrackerEntry newTracker(line);
BitTorrent::TrackerEntry newTracker {line};
if (!existingTrackers.contains(newTracker))
{
m_ui->textEditTrackersList->insertPlainText(line + '\n');