mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Fix coding style
This commit is contained in:
parent
c8c7ed4a2e
commit
4022799881
79 changed files with 717 additions and 772 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue