|
|
@ -44,7 +44,7 @@ |
|
|
|
#include <libtorrent/torrent_info.hpp> |
|
|
|
#include <libtorrent/torrent_info.hpp> |
|
|
|
#include <libtorrent/bencode.hpp> |
|
|
|
#include <libtorrent/bencode.hpp> |
|
|
|
#include <libtorrent/entry.hpp> |
|
|
|
#include <libtorrent/entry.hpp> |
|
|
|
#if LIBTORRENT_VERSION_MINOR < 15 && LIBTORRENT_VERSION_MAJOR < 1 |
|
|
|
#if LIBTORRENT_VERSION_NUM < 001600 |
|
|
|
#include <boost/date_time/posix_time/posix_time_types.hpp> |
|
|
|
#include <boost/date_time/posix_time/posix_time_types.hpp> |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -93,7 +93,7 @@ QString QTorrentHandle::name() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString QTorrentHandle::creation_date() const { |
|
|
|
QString QTorrentHandle::creation_date() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
boost::optional<time_t> t = torrent_handle::get_torrent_info().creation_date(); |
|
|
|
boost::optional<time_t> t = torrent_handle::get_torrent_info().creation_date(); |
|
|
|
return t ? misc::toQString(*t) : ""; |
|
|
|
return t ? misc::toQString(*t) : ""; |
|
|
|
#else |
|
|
|
#else |
|
|
@ -103,7 +103,7 @@ QString QTorrentHandle::creation_date() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString QTorrentHandle::next_announce() const { |
|
|
|
QString QTorrentHandle::next_announce() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return misc::userFriendlyDuration(torrent_handle::status(0x0).next_announce.total_seconds()); |
|
|
|
return misc::userFriendlyDuration(torrent_handle::status(0x0).next_announce.total_seconds()); |
|
|
|
#else |
|
|
|
#else |
|
|
|
return misc::userFriendlyDuration(torrent_handle::status().next_announce.total_seconds()); |
|
|
|
return misc::userFriendlyDuration(torrent_handle::status().next_announce.total_seconds()); |
|
|
@ -111,7 +111,7 @@ QString QTorrentHandle::next_announce() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
qlonglong QTorrentHandle::next_announce_s() const { |
|
|
|
qlonglong QTorrentHandle::next_announce_s() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).next_announce.total_seconds(); |
|
|
|
return torrent_handle::status(0x0).next_announce.total_seconds(); |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().next_announce.total_seconds(); |
|
|
|
return torrent_handle::status().next_announce.total_seconds(); |
|
|
@ -119,7 +119,7 @@ qlonglong QTorrentHandle::next_announce_s() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float QTorrentHandle::progress() const { |
|
|
|
float QTorrentHandle::progress() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
torrent_status st = torrent_handle::status(query_accurate_download_counters); |
|
|
|
torrent_status st = torrent_handle::status(query_accurate_download_counters); |
|
|
|
#else |
|
|
|
#else |
|
|
|
torrent_status st = torrent_handle::status(); |
|
|
|
torrent_status st = torrent_handle::status(); |
|
|
@ -134,7 +134,7 @@ float QTorrentHandle::progress() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bitfield QTorrentHandle::pieces() const { |
|
|
|
bitfield QTorrentHandle::pieces() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(torrent_handle::query_pieces).pieces; |
|
|
|
return torrent_handle::status(torrent_handle::query_pieces).pieces; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().pieces; |
|
|
|
return torrent_handle::status().pieces; |
|
|
@ -142,7 +142,7 @@ bitfield QTorrentHandle::pieces() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString QTorrentHandle::current_tracker() const { |
|
|
|
QString QTorrentHandle::current_tracker() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return misc::toQString(torrent_handle::status(0x0).current_tracker); |
|
|
|
return misc::toQString(torrent_handle::status(0x0).current_tracker); |
|
|
|
#else |
|
|
|
#else |
|
|
|
return misc::toQString(torrent_handle::status().current_tracker); |
|
|
|
return misc::toQString(torrent_handle::status().current_tracker); |
|
|
@ -150,7 +150,7 @@ QString QTorrentHandle::current_tracker() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool QTorrentHandle::is_paused() const { |
|
|
|
bool QTorrentHandle::is_paused() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
torrent_status st = torrent_handle::status(0x0); |
|
|
|
torrent_status st = torrent_handle::status(0x0); |
|
|
|
return st.paused && !st.auto_managed; |
|
|
|
return st.paused && !st.auto_managed; |
|
|
|
#else |
|
|
|
#else |
|
|
@ -159,7 +159,7 @@ bool QTorrentHandle::is_paused() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool QTorrentHandle::is_queued() const { |
|
|
|
bool QTorrentHandle::is_queued() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
torrent_status st = torrent_handle::status(0x0); |
|
|
|
torrent_status st = torrent_handle::status(0x0); |
|
|
|
return st.paused && st.auto_managed; |
|
|
|
return st.paused && st.auto_managed; |
|
|
|
#else |
|
|
|
#else |
|
|
@ -185,7 +185,7 @@ bool QTorrentHandle::first_last_piece_first() const { |
|
|
|
// Get int first media file
|
|
|
|
// Get int first media file
|
|
|
|
int index = 0; |
|
|
|
int index = 0; |
|
|
|
for (index = 0; index < t.num_files(); ++index) { |
|
|
|
for (index = 0; index < t.num_files(); ++index) { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
QString path = misc::toQStringU(t.file_at(index).path); |
|
|
|
QString path = misc::toQStringU(t.file_at(index).path); |
|
|
|
#else |
|
|
|
#else |
|
|
|
QString path = misc::toQStringU(t.file_at(index).path.string()); |
|
|
|
QString path = misc::toQStringU(t.file_at(index).path.string()); |
|
|
@ -206,7 +206,7 @@ bool QTorrentHandle::first_last_piece_first() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_type QTorrentHandle::total_wanted_done() const { |
|
|
|
size_type QTorrentHandle::total_wanted_done() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(query_accurate_download_counters).total_wanted_done; |
|
|
|
return torrent_handle::status(query_accurate_download_counters).total_wanted_done; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().total_wanted_done; |
|
|
|
return torrent_handle::status().total_wanted_done; |
|
|
@ -214,7 +214,7 @@ size_type QTorrentHandle::total_wanted_done() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_type QTorrentHandle::total_wanted() const { |
|
|
|
size_type QTorrentHandle::total_wanted() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).total_wanted; |
|
|
|
return torrent_handle::status(0x0).total_wanted; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().total_wanted; |
|
|
|
return torrent_handle::status().total_wanted; |
|
|
@ -222,7 +222,7 @@ size_type QTorrentHandle::total_wanted() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
qreal QTorrentHandle::download_payload_rate() const { |
|
|
|
qreal QTorrentHandle::download_payload_rate() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).download_payload_rate; |
|
|
|
return torrent_handle::status(0x0).download_payload_rate; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().download_payload_rate; |
|
|
|
return torrent_handle::status().download_payload_rate; |
|
|
@ -230,7 +230,7 @@ qreal QTorrentHandle::download_payload_rate() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
qreal QTorrentHandle::upload_payload_rate() const { |
|
|
|
qreal QTorrentHandle::upload_payload_rate() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).upload_payload_rate; |
|
|
|
return torrent_handle::status(0x0).upload_payload_rate; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().upload_payload_rate; |
|
|
|
return torrent_handle::status().upload_payload_rate; |
|
|
@ -238,7 +238,7 @@ qreal QTorrentHandle::upload_payload_rate() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int QTorrentHandle::num_peers() const { |
|
|
|
int QTorrentHandle::num_peers() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).num_peers; |
|
|
|
return torrent_handle::status(0x0).num_peers; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().num_peers; |
|
|
|
return torrent_handle::status().num_peers; |
|
|
@ -246,7 +246,7 @@ int QTorrentHandle::num_peers() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int QTorrentHandle::num_seeds() const { |
|
|
|
int QTorrentHandle::num_seeds() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).num_seeds; |
|
|
|
return torrent_handle::status(0x0).num_seeds; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().num_seeds; |
|
|
|
return torrent_handle::status().num_seeds; |
|
|
@ -254,7 +254,7 @@ int QTorrentHandle::num_seeds() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int QTorrentHandle::num_complete() const { |
|
|
|
int QTorrentHandle::num_complete() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).num_complete; |
|
|
|
return torrent_handle::status(0x0).num_complete; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().num_complete; |
|
|
|
return torrent_handle::status().num_complete; |
|
|
@ -262,7 +262,7 @@ int QTorrentHandle::num_complete() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int QTorrentHandle::num_incomplete() const { |
|
|
|
int QTorrentHandle::num_incomplete() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).num_incomplete; |
|
|
|
return torrent_handle::status(0x0).num_incomplete; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().num_incomplete; |
|
|
|
return torrent_handle::status().num_incomplete; |
|
|
@ -270,7 +270,7 @@ int QTorrentHandle::num_incomplete() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString QTorrentHandle::save_path() const { |
|
|
|
QString QTorrentHandle::save_path() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return misc::toQStringU(torrent_handle::save_path()).replace("\\", "/"); |
|
|
|
return misc::toQStringU(torrent_handle::save_path()).replace("\\", "/"); |
|
|
|
#else |
|
|
|
#else |
|
|
|
return misc::toQStringU(torrent_handle::save_path().string()).replace("\\", "/"); |
|
|
|
return misc::toQStringU(torrent_handle::save_path().string()).replace("\\", "/"); |
|
|
@ -296,7 +296,7 @@ QStringList QTorrentHandle::url_seeds() const { |
|
|
|
|
|
|
|
|
|
|
|
// get the size of the torrent without the filtered files
|
|
|
|
// get the size of the torrent without the filtered files
|
|
|
|
size_type QTorrentHandle::actual_size() const { |
|
|
|
size_type QTorrentHandle::actual_size() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(query_accurate_download_counters).total_wanted; |
|
|
|
return torrent_handle::status(query_accurate_download_counters).total_wanted; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().total_wanted; |
|
|
|
return torrent_handle::status().total_wanted; |
|
|
@ -318,7 +318,7 @@ int QTorrentHandle::num_files() const { |
|
|
|
|
|
|
|
|
|
|
|
QString QTorrentHandle::filename_at(unsigned int index) const { |
|
|
|
QString QTorrentHandle::filename_at(unsigned int index) const { |
|
|
|
Q_ASSERT(index < (unsigned int)torrent_handle::get_torrent_info().num_files()); |
|
|
|
Q_ASSERT(index < (unsigned int)torrent_handle::get_torrent_info().num_files()); |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return fsutils::fileName(filepath_at(index)); |
|
|
|
return fsutils::fileName(filepath_at(index)); |
|
|
|
#else |
|
|
|
#else |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().file_at(index).path.leaf()); |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().file_at(index).path.leaf()); |
|
|
@ -331,7 +331,7 @@ size_type QTorrentHandle::filesize_at(unsigned int index) const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString QTorrentHandle::filepath_at(unsigned int index) const { |
|
|
|
QString QTorrentHandle::filepath_at(unsigned int index) const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().file_at(index).path); |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().file_at(index).path); |
|
|
|
#else |
|
|
|
#else |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().file_at(index).path.string()); |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().file_at(index).path.string()); |
|
|
@ -339,7 +339,7 @@ QString QTorrentHandle::filepath_at(unsigned int index) const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString QTorrentHandle::orig_filepath_at(unsigned int index) const { |
|
|
|
QString QTorrentHandle::orig_filepath_at(unsigned int index) const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().orig_files().at(index).path); |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().orig_files().at(index).path); |
|
|
|
#else |
|
|
|
#else |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().orig_files().at(index).path.string()); |
|
|
|
return misc::toQStringU(torrent_handle::get_torrent_info().orig_files().at(index).path.string()); |
|
|
@ -347,7 +347,7 @@ QString QTorrentHandle::orig_filepath_at(unsigned int index) const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
torrent_status::state_t QTorrentHandle::state() const { |
|
|
|
torrent_status::state_t QTorrentHandle::state() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).state; |
|
|
|
return torrent_handle::status(0x0).state; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().state; |
|
|
|
return torrent_handle::status().state; |
|
|
@ -363,7 +363,7 @@ QString QTorrentHandle::comment() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_type QTorrentHandle::total_failed_bytes() const { |
|
|
|
size_type QTorrentHandle::total_failed_bytes() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).total_failed_bytes; |
|
|
|
return torrent_handle::status(0x0).total_failed_bytes; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().total_failed_bytes; |
|
|
|
return torrent_handle::status().total_failed_bytes; |
|
|
@ -371,7 +371,7 @@ size_type QTorrentHandle::total_failed_bytes() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_type QTorrentHandle::total_redundant_bytes() const { |
|
|
|
size_type QTorrentHandle::total_redundant_bytes() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).total_redundant_bytes; |
|
|
|
return torrent_handle::status(0x0).total_redundant_bytes; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().total_redundant_bytes; |
|
|
|
return torrent_handle::status().total_redundant_bytes; |
|
|
@ -379,7 +379,7 @@ size_type QTorrentHandle::total_redundant_bytes() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool QTorrentHandle::is_checking() const { |
|
|
|
bool QTorrentHandle::is_checking() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
torrent_status st = torrent_handle::status(0x0); |
|
|
|
torrent_status st = torrent_handle::status(0x0); |
|
|
|
#else |
|
|
|
#else |
|
|
|
torrent_status st = torrent_handle::status(); |
|
|
|
torrent_status st = torrent_handle::status(); |
|
|
@ -388,7 +388,7 @@ bool QTorrentHandle::is_checking() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_type QTorrentHandle::total_done() const { |
|
|
|
size_type QTorrentHandle::total_done() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).total_done; |
|
|
|
return torrent_handle::status(0x0).total_done; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().total_done; |
|
|
|
return torrent_handle::status().total_done; |
|
|
@ -396,7 +396,7 @@ size_type QTorrentHandle::total_done() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_type QTorrentHandle::all_time_download() const { |
|
|
|
size_type QTorrentHandle::all_time_download() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).all_time_download; |
|
|
|
return torrent_handle::status(0x0).all_time_download; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().all_time_download; |
|
|
|
return torrent_handle::status().all_time_download; |
|
|
@ -404,7 +404,7 @@ size_type QTorrentHandle::all_time_download() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_type QTorrentHandle::all_time_upload() const { |
|
|
|
size_type QTorrentHandle::all_time_upload() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).all_time_upload; |
|
|
|
return torrent_handle::status(0x0).all_time_upload; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().all_time_upload; |
|
|
|
return torrent_handle::status().all_time_upload; |
|
|
@ -412,7 +412,7 @@ size_type QTorrentHandle::all_time_upload() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_type QTorrentHandle::total_payload_download() const { |
|
|
|
size_type QTorrentHandle::total_payload_download() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).total_payload_download; |
|
|
|
return torrent_handle::status(0x0).total_payload_download; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().total_payload_download; |
|
|
|
return torrent_handle::status().total_payload_download; |
|
|
@ -420,7 +420,7 @@ size_type QTorrentHandle::total_payload_download() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_type QTorrentHandle::total_payload_upload() const { |
|
|
|
size_type QTorrentHandle::total_payload_upload() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).total_payload_upload; |
|
|
|
return torrent_handle::status(0x0).total_payload_upload; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().total_payload_upload; |
|
|
|
return torrent_handle::status().total_payload_upload; |
|
|
@ -467,7 +467,7 @@ int QTorrentHandle::queue_position() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int QTorrentHandle::num_uploads() const { |
|
|
|
int QTorrentHandle::num_uploads() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).num_uploads; |
|
|
|
return torrent_handle::status(0x0).num_uploads; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().num_uploads; |
|
|
|
return torrent_handle::status().num_uploads; |
|
|
@ -485,7 +485,7 @@ bool QTorrentHandle::is_seed() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool QTorrentHandle::is_auto_managed() const { |
|
|
|
bool QTorrentHandle::is_auto_managed() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
torrent_status status = torrent_handle::status(0x0); |
|
|
|
torrent_status status = torrent_handle::status(0x0); |
|
|
|
return status.auto_managed; |
|
|
|
return status.auto_managed; |
|
|
|
#else |
|
|
|
#else |
|
|
@ -494,7 +494,7 @@ bool QTorrentHandle::is_auto_managed() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool QTorrentHandle::is_sequential_download() const { |
|
|
|
bool QTorrentHandle::is_sequential_download() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
torrent_status status = torrent_handle::status(0x0); |
|
|
|
torrent_status status = torrent_handle::status(0x0); |
|
|
|
return status.sequential_download; |
|
|
|
return status.sequential_download; |
|
|
|
#else |
|
|
|
#else |
|
|
@ -503,7 +503,7 @@ bool QTorrentHandle::is_sequential_download() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
qlonglong QTorrentHandle::active_time() const { |
|
|
|
qlonglong QTorrentHandle::active_time() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).active_time; |
|
|
|
return torrent_handle::status(0x0).active_time; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().active_time; |
|
|
|
return torrent_handle::status().active_time; |
|
|
@ -511,7 +511,7 @@ qlonglong QTorrentHandle::active_time() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
qlonglong QTorrentHandle::seeding_time() const { |
|
|
|
qlonglong QTorrentHandle::seeding_time() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).seeding_time; |
|
|
|
return torrent_handle::status(0x0).seeding_time; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().seeding_time; |
|
|
|
return torrent_handle::status().seeding_time; |
|
|
@ -519,7 +519,7 @@ qlonglong QTorrentHandle::seeding_time() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int QTorrentHandle::num_connections() const { |
|
|
|
int QTorrentHandle::num_connections() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).num_connections; |
|
|
|
return torrent_handle::status(0x0).num_connections; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().num_connections; |
|
|
|
return torrent_handle::status().num_connections; |
|
|
@ -527,7 +527,7 @@ int QTorrentHandle::num_connections() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int QTorrentHandle::connections_limit() const { |
|
|
|
int QTorrentHandle::connections_limit() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).connections_limit; |
|
|
|
return torrent_handle::status(0x0).connections_limit; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().connections_limit; |
|
|
|
return torrent_handle::status().connections_limit; |
|
|
@ -565,7 +565,7 @@ QString QTorrentHandle::root_path() const |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool QTorrentHandle::has_error() const { |
|
|
|
bool QTorrentHandle::has_error() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
torrent_status st = torrent_handle::status(0x0); |
|
|
|
torrent_status st = torrent_handle::status(0x0); |
|
|
|
return st.paused && !st.error.empty(); |
|
|
|
return st.paused && !st.error.empty(); |
|
|
|
#else |
|
|
|
#else |
|
|
@ -574,7 +574,7 @@ bool QTorrentHandle::has_error() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString QTorrentHandle::error() const { |
|
|
|
QString QTorrentHandle::error() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return misc::toQString(torrent_handle::status(0x0).error); |
|
|
|
return misc::toQString(torrent_handle::status(0x0).error); |
|
|
|
#else |
|
|
|
#else |
|
|
|
return misc::toQString(torrent_handle::status().error); |
|
|
|
return misc::toQString(torrent_handle::status().error); |
|
|
@ -594,7 +594,7 @@ void QTorrentHandle::downloading_pieces(bitfield &bf) const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool QTorrentHandle::has_metadata() const { |
|
|
|
bool QTorrentHandle::has_metadata() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(0x0).has_metadata; |
|
|
|
return torrent_handle::status(0x0).has_metadata; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::has_metadata(); |
|
|
|
return torrent_handle::has_metadata(); |
|
|
@ -602,7 +602,7 @@ bool QTorrentHandle::has_metadata() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float QTorrentHandle::distributed_copies() const { |
|
|
|
float QTorrentHandle::distributed_copies() const { |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 || LIBTORRENT_VERSION_MAJOR > 0 |
|
|
|
#if LIBTORRENT_VERSION_NUM >= 001600 |
|
|
|
return torrent_handle::status(query_distributed_copies).distributed_copies; |
|
|
|
return torrent_handle::status(query_distributed_copies).distributed_copies; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return torrent_handle::status().distributed_copies; |
|
|
|
return torrent_handle::status().distributed_copies; |
|
|
|