mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
Fix libtorrent 0.15.x compilation.
This commit is contained in:
parent
09538393a6
commit
42efa21ef3
1 changed files with 9 additions and 0 deletions
|
@ -122,7 +122,11 @@ static const char KEY_TRANSFER_UPSPEED[] = "up_info";
|
||||||
|
|
||||||
static QVariantMap toMap(const QTorrentHandle& h)
|
static QVariantMap toMap(const QTorrentHandle& h)
|
||||||
{
|
{
|
||||||
|
#if LIBTORRENT_VERSION_NUM >= 1600
|
||||||
libtorrent::torrent_status status = h.status(torrent_handle::query_accurate_download_counters);
|
libtorrent::torrent_status status = h.status(torrent_handle::query_accurate_download_counters);
|
||||||
|
#else
|
||||||
|
libtorrent::torrent_status status = h.status();
|
||||||
|
#endif
|
||||||
|
|
||||||
QVariantMap ret;
|
QVariantMap ret;
|
||||||
ret[KEY_TORRENT_HASH] = h.hash();
|
ret[KEY_TORRENT_HASH] = h.hash();
|
||||||
|
@ -284,8 +288,13 @@ QByteArray btjson::getPropertiesForTorrent(const QString& hash)
|
||||||
try {
|
try {
|
||||||
QTorrentHandle h = QBtSession::instance()->getTorrentHandle(hash);
|
QTorrentHandle h = QBtSession::instance()->getTorrentHandle(hash);
|
||||||
|
|
||||||
|
#if LIBTORRENT_VERSION_NUM >= 1600
|
||||||
libtorrent::torrent_status status = h.status(torrent_handle::query_accurate_download_counters);
|
libtorrent::torrent_status status = h.status(torrent_handle::query_accurate_download_counters);
|
||||||
if (!status.has_metadata)
|
if (!status.has_metadata)
|
||||||
|
#else
|
||||||
|
libtorrent::torrent_status status = h.status();
|
||||||
|
if (!h.has_metadata())
|
||||||
|
#endif
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
|
|
||||||
// Save path
|
// Save path
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue