mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
Fix coding style
This commit is contained in:
@@ -303,12 +303,12 @@ void PeerListWidget::copySelectedPeers()
|
||||
int row = m_proxyModel->mapToSource(index).row();
|
||||
QString ip = m_listModel->data(m_listModel->index(row, PeerListDelegate::IP_HIDDEN)).toString();
|
||||
QString myport = m_listModel->data(m_listModel->index(row, PeerListDelegate::PORT)).toString();
|
||||
if (ip.indexOf(".") == -1) // IPv6
|
||||
if (ip.indexOf('.') == -1) // IPv6
|
||||
selectedPeers << "[" + ip + "]:" + myport;
|
||||
else // IPv4
|
||||
selectedPeers << ip + ":" + myport;
|
||||
}
|
||||
QApplication::clipboard()->setText(selectedPeers.join("\n"));
|
||||
QApplication::clipboard()->setText(selectedPeers.join('\n'));
|
||||
}
|
||||
|
||||
void PeerListWidget::clear()
|
||||
@@ -339,7 +339,7 @@ void PeerListWidget::loadPeers(BitTorrent::TorrentHandle *const torrent, bool fo
|
||||
if (!torrent) return;
|
||||
|
||||
QList<BitTorrent::PeerInfo> peers = torrent->peers();
|
||||
QSet<QString> oldeersSet = m_peerItems.keys().toSet();
|
||||
QSet<QString> oldPeersSet = m_peerItems.keys().toSet();
|
||||
|
||||
foreach (const BitTorrent::PeerInfo &peer, peers) {
|
||||
BitTorrent::PeerAddress addr = peer.address();
|
||||
@@ -349,7 +349,7 @@ void PeerListWidget::loadPeers(BitTorrent::TorrentHandle *const torrent, bool fo
|
||||
if (m_peerItems.contains(peerIp)) {
|
||||
// Update existing peer
|
||||
updatePeer(peerIp, torrent, peer);
|
||||
oldeersSet.remove(peerIp);
|
||||
oldPeersSet.remove(peerIp);
|
||||
if (forceHostnameResolution && m_resolver)
|
||||
m_resolver->resolve(peerIp);
|
||||
}
|
||||
@@ -363,7 +363,7 @@ void PeerListWidget::loadPeers(BitTorrent::TorrentHandle *const torrent, bool fo
|
||||
}
|
||||
}
|
||||
// Delete peers that are gone
|
||||
QSetIterator<QString> it(oldeersSet);
|
||||
QSetIterator<QString> it(oldPeersSet);
|
||||
while (it.hasNext()) {
|
||||
const QString &ip = it.next();
|
||||
m_missingFlags.remove(ip);
|
||||
|
||||
Reference in New Issue
Block a user