Use QString literals

This patch covers src/gui and some leftovers from previous commit.
This commit is contained in:
Chocobo1
2022-03-12 22:00:58 +08:00
parent 5341478036
commit 802ec5a14e
59 changed files with 912 additions and 902 deletions

View File

@@ -269,7 +269,7 @@ void PeerListWidget::showPeerListMenu()
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->setToolTipsVisible(true);
QAction *addNewPeer = menu->addAction(UIThemeManager::instance()->getIcon("user-group-new"), tr("Add peers...")
QAction *addNewPeer = menu->addAction(UIThemeManager::instance()->getIcon(u"user-group-new"_qs), tr("Add peers...")
, this, [this, torrent]()
{
const QVector<BitTorrent::PeerAddress> peersList = PeersAdditionDialog::askForPeers(this);
@@ -282,10 +282,10 @@ void PeerListWidget::showPeerListMenu()
else if (peerCount > 0)
QMessageBox::information(this, tr("Adding peers"), tr("Peers are added to this torrent."));
});
QAction *copyPeers = menu->addAction(UIThemeManager::instance()->getIcon("edit-copy"), tr("Copy IP:port")
QAction *copyPeers = menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_qs), tr("Copy IP:port")
, this, &PeerListWidget::copySelectedPeers);
menu->addSeparator();
QAction *banPeers = menu->addAction(UIThemeManager::instance()->getIcon("user-group-delete"), tr("Ban peer permanently")
QAction *banPeers = menu->addAction(UIThemeManager::instance()->getIcon(u"user-group-delete"_qs), tr("Ban peer permanently")
, this, &PeerListWidget::banSelectedPeers);
// disable actions
@@ -352,13 +352,13 @@ void PeerListWidget::copySelectedPeers()
const QString ip = m_listModel->item(row, PeerListColumns::IP_HIDDEN)->text();
const QString port = m_listModel->item(row, PeerListColumns::PORT)->text();
if (!ip.contains('.')) // IPv6
selectedPeers << ('[' + ip + "]:" + port);
if (!ip.contains(u'.')) // IPv6
selectedPeers << (u'[' + ip + u"]:" + port);
else // IPv4
selectedPeers << (ip + ':' + port);
selectedPeers << (ip + u':' + port);
}
QApplication::clipboard()->setText(selectedPeers.join('\n'));
QApplication::clipboard()->setText(selectedPeers.join(u'\n'));
}
void PeerListWidget::clear()
@@ -460,7 +460,7 @@ void PeerListWidget::updatePeer(const BitTorrent::Torrent *torrent, const BitTor
setModelData(row, PeerListColumns::FLAGS, peer.flags(), peer.flags(), {}, peer.flagsDescription());
const QString client = peer.client().toHtmlEscaped();
setModelData(row, PeerListColumns::CLIENT, client, client, {}, client);
setModelData(row, PeerListColumns::PROGRESS, (Utils::String::fromDouble(peer.progress() * 100, 1) + '%'), peer.progress(), intDataTextAlignment);
setModelData(row, PeerListColumns::PROGRESS, (Utils::String::fromDouble(peer.progress() * 100, 1) + u'%'), peer.progress(), intDataTextAlignment);
const QString downSpeed = (hideValues && (peer.payloadDownSpeed() <= 0)) ? QString {} : Utils::Misc::friendlyUnit(peer.payloadDownSpeed(), true);
setModelData(row, PeerListColumns::DOWN_SPEED, downSpeed, peer.payloadDownSpeed(), intDataTextAlignment);
const QString upSpeed = (hideValues && (peer.payloadUpSpeed() <= 0)) ? QString {} : Utils::Misc::friendlyUnit(peer.payloadUpSpeed(), true);
@@ -469,14 +469,14 @@ void PeerListWidget::updatePeer(const BitTorrent::Torrent *torrent, const BitTor
setModelData(row, PeerListColumns::TOT_DOWN, totalDown, peer.totalDownload(), intDataTextAlignment);
const QString totalUp = (hideValues && (peer.totalUpload() <= 0)) ? QString {} : Utils::Misc::friendlyUnit(peer.totalUpload());
setModelData(row, PeerListColumns::TOT_UP, totalUp, peer.totalUpload(), intDataTextAlignment);
setModelData(row, PeerListColumns::RELEVANCE, (Utils::String::fromDouble(peer.relevance() * 100, 1) + '%'), peer.relevance(), intDataTextAlignment);
setModelData(row, PeerListColumns::RELEVANCE, (Utils::String::fromDouble(peer.relevance() * 100, 1) + u'%'), peer.relevance(), intDataTextAlignment);
const PathList filePaths = torrent->info().filesForPiece(peer.downloadingPieceIndex());
QStringList downloadingFiles;
downloadingFiles.reserve(filePaths.size());
for (const Path &filePath : filePaths)
downloadingFiles.append(filePath.toString());
const QString downloadingFilesDisplayValue = downloadingFiles.join(';');
const QString downloadingFilesDisplayValue = downloadingFiles.join(u';');
setModelData(row, PeerListColumns::DOWNLOADING_PIECE, downloadingFilesDisplayValue, downloadingFilesDisplayValue, {}, downloadingFiles.join(QLatin1Char('\n')));
if (m_resolver)

View File

@@ -64,7 +64,7 @@ void PeersAdditionDialog::validateInput()
QMessageBox::Ok);
return;
}
for (const QString &peer : asConst(m_ui->textEditPeers->toPlainText().trimmed().split('\n')))
for (const QString &peer : asConst(m_ui->textEditPeers->toPlainText().trimmed().split(u'\n')))
{
const BitTorrent::PeerAddress addr = BitTorrent::PeerAddress::parse(peer);
if (!addr.ip.isNull())

View File

@@ -135,9 +135,9 @@ PropertiesWidget::PropertiesWidget(QWidget *parent)
// Tracker list
m_trackerList = new TrackerListWidget(this);
m_ui->trackerUpButton->setIcon(UIThemeManager::instance()->getIcon("go-up"));
m_ui->trackerUpButton->setIcon(UIThemeManager::instance()->getIcon(u"go-up"_qs));
m_ui->trackerUpButton->setIconSize(Utils::Gui::smallIconSize());
m_ui->trackerDownButton->setIcon(UIThemeManager::instance()->getIcon("go-down"));
m_ui->trackerDownButton->setIcon(UIThemeManager::instance()->getIcon(u"go-down"_qs));
m_ui->trackerDownButton->setIconSize(Utils::Gui::smallIconSize());
connect(m_ui->trackerUpButton, &QPushButton::clicked, m_trackerList, &TrackerListWidget::moveSelectionUp);
connect(m_ui->trackerDownButton, &QPushButton::clicked, m_trackerList, &TrackerListWidget::moveSelectionDown);
@@ -385,7 +385,7 @@ void PropertiesWidget::readSettings()
{
const Preferences *const pref = Preferences::instance();
// Restore splitter sizes
QStringList sizesStr = pref->getPropSplitterSizes().split(',');
QStringList sizesStr = pref->getPropSplitterSizes().split(u',');
if (sizesStr.size() == 2)
{
m_slideSizes << sizesStr.first().toInt();
@@ -414,7 +414,7 @@ void PropertiesWidget::saveSettings()
sizes = m_slideSizes;
if (sizes.size() == 2)
pref->setPropSplitterSizes(QString::number(sizes.first()) + ',' + QString::number(sizes.last()));
pref->setPropSplitterSizes(QString::number(sizes.first()) + u',' + QString::number(sizes.last()));
pref->setPropFileListState(m_ui->filesList->header()->saveState());
// Remember current tab
pref->setPropCurTab(m_tabBar->currentIndex());
@@ -445,9 +445,9 @@ void PropertiesWidget::loadDynamicData()
m_ui->labelDlTotalVal->setText(tr("%1 (%2 this session)").arg(Utils::Misc::friendlyUnit(m_torrent->totalDownload())
, Utils::Misc::friendlyUnit(m_torrent->totalPayloadDownload())));
m_ui->labelUpLimitVal->setText(m_torrent->uploadLimit() <= 0 ? QString::fromUtf8(C_INFINITY) : Utils::Misc::friendlyUnit(m_torrent->uploadLimit(), true));
m_ui->labelUpLimitVal->setText(m_torrent->uploadLimit() <= 0 ? C_INFINITY : Utils::Misc::friendlyUnit(m_torrent->uploadLimit(), true));
m_ui->labelDlLimitVal->setText(m_torrent->downloadLimit() <= 0 ? QString::fromUtf8(C_INFINITY) : Utils::Misc::friendlyUnit(m_torrent->downloadLimit(), true));
m_ui->labelDlLimitVal->setText(m_torrent->downloadLimit() <= 0 ? C_INFINITY : Utils::Misc::friendlyUnit(m_torrent->downloadLimit(), true));
QString elapsedString;
if (m_torrent->isSeed())
@@ -460,7 +460,7 @@ void PropertiesWidget::loadDynamicData()
m_ui->labelConnectionsVal->setText(tr("%1 (%2 max)", "%1 and %2 are numbers, e.g. 3 (10 max)")
.arg(m_torrent->connectionsCount())
.arg(m_torrent->connectionsLimit() < 0 ? QString::fromUtf8(C_INFINITY) : QString::number(m_torrent->connectionsLimit())));
.arg(m_torrent->connectionsLimit() < 0 ? C_INFINITY : QString::number(m_torrent->connectionsLimit())));
m_ui->labelETAVal->setText(Utils::Misc::userFriendlyDuration(m_torrent->eta(), MAX_ETA));
@@ -469,7 +469,7 @@ void PropertiesWidget::loadDynamicData()
// Update ratio info
const qreal ratio = m_torrent->realRatio();
m_ui->labelShareRatioVal->setText(ratio > BitTorrent::Torrent::MAX_RATIO ? QString::fromUtf8(C_INFINITY) : Utils::String::fromDouble(ratio, 2));
m_ui->labelShareRatioVal->setText(ratio > BitTorrent::Torrent::MAX_RATIO ? C_INFINITY : Utils::String::fromDouble(ratio, 2));
m_ui->labelSeedsVal->setText(tr("%1 (%2 total)", "%1 and %2 are numbers, e.g. 3 (10 total)")
.arg(QString::number(m_torrent->seedsCount())
@@ -513,7 +513,7 @@ void PropertiesWidget::loadDynamicData()
// Progress
qreal progress = m_torrent->progress() * 100.;
m_ui->labelProgressVal->setText(Utils::String::fromDouble(progress, 1) + '%');
m_ui->labelProgressVal->setText(Utils::String::fromDouble(progress, 1) + u'%');
m_downloadedPieces->setProgress(m_torrent->pieces(), m_torrent->downloadingPieces());
}
else
@@ -646,11 +646,11 @@ void PropertiesWidget::displayFilesListMenu()
{
const QModelIndex index = selectedRows[0];
menu->addAction(UIThemeManager::instance()->getIcon("folder-documents"), tr("Open")
menu->addAction(UIThemeManager::instance()->getIcon(u"folder-documents"_qs), tr("Open")
, this, [this, index]() { openItem(index); });
menu->addAction(UIThemeManager::instance()->getIcon("inode-directory"), tr("Open Containing Folder")
menu->addAction(UIThemeManager::instance()->getIcon(u"inode-directory"_qs), tr("Open Containing Folder")
, this, [this, index]() { openParentFolder(index); });
menu->addAction(UIThemeManager::instance()->getIcon("edit-rename"), tr("Rename...")
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-rename"_qs), tr("Rename...")
, this, [this]() { m_ui->filesList->renameSelectedFile(*m_torrent); });
menu->addSeparator();
}
@@ -745,16 +745,16 @@ void PropertiesWidget::displayWebSeedListMenu()
QMenu *menu = new QMenu(this);
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->addAction(UIThemeManager::instance()->getIcon("list-add"), tr("New Web seed"), this, &PropertiesWidget::askWebSeed);
menu->addAction(UIThemeManager::instance()->getIcon(u"list-add"_qs), tr("New Web seed"), this, &PropertiesWidget::askWebSeed);
if (!rows.isEmpty())
{
menu->addAction(UIThemeManager::instance()->getIcon("list-remove"), tr("Remove Web seed")
menu->addAction(UIThemeManager::instance()->getIcon(u"list-remove"_qs), tr("Remove Web seed")
, this, &PropertiesWidget::deleteSelectedUrlSeeds);
menu->addSeparator();
menu->addAction(UIThemeManager::instance()->getIcon("edit-copy"), tr("Copy Web seed URL")
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_qs), tr("Copy Web seed URL")
, this, &PropertiesWidget::copySelectedWebSeedsToClipboard);
menu->addAction(UIThemeManager::instance()->getIcon("edit-rename"), tr("Edit Web seed URL")
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-rename"_qs), tr("Edit Web seed URL")
, this, &PropertiesWidget::editWebSeed);
}
@@ -817,7 +817,7 @@ void PropertiesWidget::askWebSeed()
qDebug("Adding %s web seed", qUtf8Printable(urlSeed));
if (!m_ui->listWebSeeds->findItems(urlSeed, Qt::MatchFixedString).empty())
{
QMessageBox::warning(this, "qBittorrent",
QMessageBox::warning(this, u"qBittorrent"_qs,
tr("This URL seed is already in the list."),
QMessageBox::Ok);
return;
@@ -853,7 +853,7 @@ void PropertiesWidget::copySelectedWebSeedsToClipboard() const
for (const QListWidgetItem *item : selectedItems)
urlsToCopy << item->text();
QApplication::clipboard()->setText(urlsToCopy.join('\n'));
QApplication::clipboard()->setText(urlsToCopy.join(u'\n'));
}
void PropertiesWidget::editWebSeed()

View File

@@ -46,7 +46,7 @@ PropTabBar::PropTabBar(QWidget *parent)
// General tab
QPushButton *mainInfosButton = new QPushButton(
#ifndef Q_OS_MACOS
UIThemeManager::instance()->getIcon("document-properties"),
UIThemeManager::instance()->getIcon(u"document-properties"_qs),
#endif
tr("General"), parent);
mainInfosButton->setShortcut(Qt::ALT + Qt::Key_G);
@@ -55,7 +55,7 @@ PropTabBar::PropTabBar(QWidget *parent)
// Trackers tab
QPushButton *trackersButton = new QPushButton(
#ifndef Q_OS_MACOS
UIThemeManager::instance()->getIcon("network-server"),
UIThemeManager::instance()->getIcon(u"network-server"_qs),
#endif
tr("Trackers"), parent);
trackersButton->setShortcut(Qt::ALT + Qt::Key_C);
@@ -64,7 +64,7 @@ PropTabBar::PropTabBar(QWidget *parent)
// Peers tab
QPushButton *peersButton = new QPushButton(
#ifndef Q_OS_MACOS
UIThemeManager::instance()->getIcon("edit-find-user"),
UIThemeManager::instance()->getIcon(u"edit-find-user"_qs),
#endif
tr("Peers"), parent);
peersButton->setShortcut(Qt::ALT + Qt::Key_R);
@@ -73,7 +73,7 @@ PropTabBar::PropTabBar(QWidget *parent)
// URL seeds tab
QPushButton *URLSeedsButton = new QPushButton(
#ifndef Q_OS_MACOS
UIThemeManager::instance()->getIcon("network-server"),
UIThemeManager::instance()->getIcon(u"network-server"_qs),
#endif
tr("HTTP Sources"), parent);
URLSeedsButton->setShortcut(Qt::ALT + Qt::Key_B);
@@ -82,7 +82,7 @@ PropTabBar::PropTabBar(QWidget *parent)
// Files tab
QPushButton *filesButton = new QPushButton(
#ifndef Q_OS_MACOS
UIThemeManager::instance()->getIcon("inode-directory"),
UIThemeManager::instance()->getIcon(u"inode-directory"_qs),
#endif
tr("Content"), parent);
filesButton->setShortcut(Qt::ALT + Qt::Key_Z);
@@ -93,7 +93,7 @@ PropTabBar::PropTabBar(QWidget *parent)
// Speed tab
QPushButton *speedButton = new QPushButton(
#ifndef Q_OS_MACOS
UIThemeManager::instance()->getIcon("office-chart-line"),
UIThemeManager::instance()->getIcon(u"office-chart-line"_qs),
#endif
tr("Speed"), parent);
speedButton->setShortcut(Qt::ALT + Qt::Key_D);

View File

@@ -94,7 +94,7 @@ namespace
// check is there need for digits after decimal separator
const int precision = (argValue < 10) ? friendlyUnitPrecision(unit) : 0;
return QLocale::system().toString(argValue, 'f', precision)
+ QString::fromUtf8(C_NON_BREAKING_SPACE)
+ C_NON_BREAKING_SPACE
+ unitString(unit, true);
}
}

View File

@@ -65,7 +65,7 @@ SpeedWidget::SpeedWidget(PropertiesWidget *parent)
m_hlayout = new QHBoxLayout();
m_hlayout->setContentsMargins(0, 0, 0, 0);
m_periodLabel = new QLabel("<b>" + tr("Period:") + "</b>");
m_periodLabel = new QLabel(u"<b>" + tr("Period:") + u"</b>");
m_periodCombobox = new QComboBox();
m_periodCombobox->addItem(tr("1 Minute"));

View File

@@ -93,13 +93,13 @@ TrackerListWidget::TrackerListWidget(PropertiesWidget *properties)
connect(header(), &QHeaderView::sortIndicatorChanged, this, &TrackerListWidget::saveSettings);
// Set DHT, PeX, LSD items
m_DHTItem = new QTreeWidgetItem({ "", "** [DHT] **", "", "0", "", "", "0" });
m_DHTItem = new QTreeWidgetItem({ u""_qs, u"** [DHT] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs });
insertTopLevelItem(0, m_DHTItem);
setRowColor(0, QColor("grey"));
m_PEXItem = new QTreeWidgetItem({ "", "** [PeX] **", "", "0", "", "", "0" });
m_PEXItem = new QTreeWidgetItem({ u""_qs, u"** [PeX] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs });
insertTopLevelItem(1, m_PEXItem);
setRowColor(1, QColor("grey"));
m_LSDItem = new QTreeWidgetItem({ "", "** [LSD] **", "", "0", "", "", "0" });
m_LSDItem = new QTreeWidgetItem({ u""_qs, u"** [LSD] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs });
insertTopLevelItem(2, m_LSDItem);
setRowColor(2, QColor("grey"));
@@ -257,18 +257,18 @@ void TrackerListWidget::clear()
qDeleteAll(m_trackerItems);
m_trackerItems.clear();
m_DHTItem->setText(COL_STATUS, "");
m_DHTItem->setText(COL_SEEDS, "");
m_DHTItem->setText(COL_LEECHES, "");
m_DHTItem->setText(COL_MSG, "");
m_PEXItem->setText(COL_STATUS, "");
m_PEXItem->setText(COL_SEEDS, "");
m_PEXItem->setText(COL_LEECHES, "");
m_PEXItem->setText(COL_MSG, "");
m_LSDItem->setText(COL_STATUS, "");
m_LSDItem->setText(COL_SEEDS, "");
m_LSDItem->setText(COL_LEECHES, "");
m_LSDItem->setText(COL_MSG, "");
m_DHTItem->setText(COL_STATUS, {});
m_DHTItem->setText(COL_SEEDS, {});
m_DHTItem->setText(COL_LEECHES, {});
m_DHTItem->setText(COL_MSG, {});
m_PEXItem->setText(COL_STATUS, {});
m_PEXItem->setText(COL_SEEDS, {});
m_PEXItem->setText(COL_LEECHES, {});
m_PEXItem->setText(COL_MSG, {});
m_LSDItem->setText(COL_STATUS, {});
m_LSDItem->setText(COL_SEEDS, {});
m_LSDItem->setText(COL_LEECHES, {});
m_LSDItem->setText(COL_MSG, {});
}
void TrackerListWidget::loadStickyItems(const BitTorrent::Torrent *torrent)
@@ -445,10 +445,10 @@ void TrackerListWidget::copyTrackerUrl()
for (const QTreeWidgetItem *item : selectedTrackerItems)
{
QString trackerURL = item->data(COL_URL, Qt::DisplayRole).toString();
qDebug() << QString("Copy: ") + trackerURL;
qDebug() << "Copy: " + trackerURL;
urlsToCopy << trackerURL;
}
QApplication::clipboard()->setText(urlsToCopy.join('\n'));
QApplication::clipboard()->setText(urlsToCopy.join(u'\n'));
}
@@ -578,25 +578,25 @@ void TrackerListWidget::showTrackerListMenu()
menu->setAttribute(Qt::WA_DeleteOnClose);
// Add actions
menu->addAction(UIThemeManager::instance()->getIcon("list-add"), tr("Add a new tracker...")
menu->addAction(UIThemeManager::instance()->getIcon(u"list-add"_qs), tr("Add a new tracker...")
, this, &TrackerListWidget::askForTrackers);
if (!getSelectedTrackerItems().isEmpty())
{
menu->addAction(UIThemeManager::instance()->getIcon("edit-rename"),tr("Edit tracker URL...")
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-rename"_qs),tr("Edit tracker URL...")
, this, &TrackerListWidget::editSelectedTracker);
menu->addAction(UIThemeManager::instance()->getIcon("list-remove"), tr("Remove tracker")
menu->addAction(UIThemeManager::instance()->getIcon(u"list-remove"_qs), tr("Remove tracker")
, this, &TrackerListWidget::deleteSelectedTrackers);
menu->addAction(UIThemeManager::instance()->getIcon("edit-copy"), tr("Copy tracker URL")
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_qs), tr("Copy tracker URL")
, this, &TrackerListWidget::copyTrackerUrl);
}
if (!torrent->isPaused())
{
menu->addAction(UIThemeManager::instance()->getIcon("view-refresh"), tr("Force reannounce to selected trackers")
menu->addAction(UIThemeManager::instance()->getIcon(u"view-refresh"_qs), tr("Force reannounce to selected trackers")
, this, &TrackerListWidget::reannounceSelected);
menu->addSeparator();
menu->addAction(UIThemeManager::instance()->getIcon("view-refresh"), tr("Force reannounce to all trackers")
menu->addAction(UIThemeManager::instance()->getIcon(u"view-refresh"_qs), tr("Force reannounce to all trackers")
, this, [this]()
{
BitTorrent::Torrent *h = m_properties->getCurrentTorrent();

View File

@@ -46,7 +46,7 @@ TrackersAdditionDialog::TrackersAdditionDialog(QWidget *parent, BitTorrent::Torr
{
m_ui->setupUi(this);
// Icons
m_ui->uTorrentListButton->setIcon(UIThemeManager::instance()->getIcon("download"));
m_ui->uTorrentListButton->setIcon(UIThemeManager::instance()->getIcon(u"download"_qs));
}
TrackersAdditionDialog::~TrackersAdditionDialog()
@@ -91,7 +91,7 @@ void TrackersAdditionDialog::torrentListDownloadFinished(const Net::DownloadResu
return;
}
const QStringList trackersFromUser = m_ui->textEditTrackersList->toPlainText().split('\n');
const QStringList trackersFromUser = m_ui->textEditTrackersList->toPlainText().split(u'\n');
QVector<BitTorrent::TrackerEntry> existingTrackers = m_torrent->trackers();
existingTrackers.reserve(trackersFromUser.size());
for (const QString &userURL : trackersFromUser)
@@ -102,21 +102,21 @@ void TrackersAdditionDialog::torrentListDownloadFinished(const Net::DownloadResu
}
// Add new trackers to the list
if (!m_ui->textEditTrackersList->toPlainText().isEmpty() && !m_ui->textEditTrackersList->toPlainText().endsWith('\n'))
m_ui->textEditTrackersList->insertPlainText("\n");
if (!m_ui->textEditTrackersList->toPlainText().isEmpty() && !m_ui->textEditTrackersList->toPlainText().endsWith(u'\n'))
m_ui->textEditTrackersList->insertPlainText(u"\n"_qs);
int nb = 0;
QBuffer buffer;
buffer.setData(result.data);
buffer.open(QBuffer::ReadOnly);
while (!buffer.atEnd())
{
const QString line = buffer.readLine().trimmed();
const auto line = QString::fromUtf8(buffer.readLine().trimmed());
if (line.isEmpty()) continue;
BitTorrent::TrackerEntry newTracker {line};
if (!existingTrackers.contains(newTracker))
{
m_ui->textEditTrackersList->insertPlainText(line + '\n');
m_ui->textEditTrackersList->insertPlainText(line + u'\n');
++nb;
}
}