mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
@@ -28,8 +28,6 @@
|
||||
|
||||
#include "peerinfo.h"
|
||||
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
#include <QBitArray>
|
||||
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
@@ -211,15 +209,9 @@ qlonglong PeerInfo::totalDownload() const
|
||||
|
||||
QBitArray PeerInfo::pieces() const
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM < 10200)
|
||||
using PieceIndex = int;
|
||||
#else
|
||||
using PieceIndex = lt::piece_index_t;
|
||||
#endif
|
||||
|
||||
QBitArray result(m_nativeInfo.pieces.size());
|
||||
for (int i = 0; i < result.size(); ++i) {
|
||||
if (m_nativeInfo.pieces[PieceIndex {i}])
|
||||
if (m_nativeInfo.pieces[lt::piece_index_t {i}])
|
||||
result.setBit(i, true);
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user