Started to fix compilation with libtorrent v0.16

This commit is contained in:
Christophe Dumez
2011-04-16 20:08:32 +00:00
parent 0c2a121304
commit 4412476109
3 changed files with 36 additions and 5 deletions

View File

@@ -107,11 +107,21 @@ QString QTorrentHandle::current_tracker() const {
}
bool QTorrentHandle::is_paused() const {
#if LIBTORRENT_VERSION_MINOR > 15
torrent_status status = torrent_handle::status(0x0);
return status.paused && !status.auto_managed;
#else
return torrent_handle::is_paused() && !torrent_handle::is_auto_managed();
#endif
}
bool QTorrentHandle::is_queued() const {
#if LIBTORRENT_VERSION_MINOR > 15
torrent_status status = torrent_handle::status(0x0);
return status.paused && status.auto_managed;
#else
return torrent_handle::is_paused() && torrent_handle::is_auto_managed();
#endif
}
size_type QTorrentHandle::total_size() const {
@@ -422,6 +432,15 @@ void QTorrentHandle::downloading_pieces(bitfield &bf) const {
return;
}
bool QTorrentHandle::has_metadata() const {
#if LIBTORRENT_VERSION_MINOR > 15
torrent_status st = torrent_handle::status(0x0);
return st.has_metadata;
#else
return torrent_handle::has_metadata();
#endif
}
//
// Setters
//