From 42efa21ef35c169774778279b50a78ed59bbd0e6 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Wed, 4 Jun 2014 22:18:29 +0300 Subject: [PATCH] Fix libtorrent 0.15.x compilation. --- src/webui/btjson.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index 355aab568..0f9138297 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -122,7 +122,11 @@ static const char KEY_TRANSFER_UPSPEED[] = "up_info"; static QVariantMap toMap(const QTorrentHandle& h) { +#if LIBTORRENT_VERSION_NUM >= 1600 libtorrent::torrent_status status = h.status(torrent_handle::query_accurate_download_counters); +#else + libtorrent::torrent_status status = h.status(); +#endif QVariantMap ret; ret[KEY_TORRENT_HASH] = h.hash(); @@ -284,8 +288,13 @@ QByteArray btjson::getPropertiesForTorrent(const QString& hash) try { QTorrentHandle h = QBtSession::instance()->getTorrentHandle(hash); +#if LIBTORRENT_VERSION_NUM >= 1600 libtorrent::torrent_status status = h.status(torrent_handle::query_accurate_download_counters); if (!status.has_metadata) +#else + libtorrent::torrent_status status = h.status(); + if (!h.has_metadata()) +#endif return QByteArray(); // Save path