Replace QList by QVector

This commit is contained in:
Chocobo1 2019-08-02 12:55:06 +08:00
parent 6cc7c700b8
commit e90a2c00a5
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
30 changed files with 94 additions and 73 deletions

View file

@ -239,7 +239,7 @@ void PeerListWidget::showPeerListMenu(const QPoint &)
const QAction *addPeerAct = menu->addAction(UIThemeManager::instance()->getIcon("user-group-new"), tr("Add a new peer..."));
connect(addPeerAct, &QAction::triggered, this, [this, torrent]()
{
const QList<BitTorrent::PeerAddress> peersList = PeersAdditionDialog::askForPeers(this);
const QVector<BitTorrent::PeerAddress> peersList = PeersAdditionDialog::askForPeers(this);
int peerCount = 0;
for (const BitTorrent::PeerAddress &addr : peersList) {
if (torrent->connectPeer(addr)) {
@ -336,7 +336,7 @@ void PeerListWidget::loadPeers(BitTorrent::TorrentHandle *const torrent, bool fo
{
if (!torrent) return;
const QList<BitTorrent::PeerInfo> peers = torrent->peers();
const QVector<BitTorrent::PeerInfo> peers = torrent->peers();
QSet<QString> oldPeersSet = m_peerItems.keys().toSet();
for (const BitTorrent::PeerInfo &peer : peers) {