- Rewrited torrent resume code to make it cleaner and more generic

* magnet URI support should be easy to implement now
Warning: Since a lot of code was rewrited, some bugs may have been introduced
This commit is contained in:
Christophe Dumez 2009-08-16 03:09:20 +00:00
parent 360a327d7d
commit 2742a54d6e
11 changed files with 1879 additions and 1656 deletions

View file

@ -241,6 +241,11 @@ torrent_status::state_t QTorrentHandle::state() const {
return h.status().state;
}
std::vector<int> QTorrentHandle::file_priorities() const {
Q_ASSERT(h.is_valid());
return h.file_priorities();
}
QString QTorrentHandle::creator() const {
Q_ASSERT(h.is_valid());
return misc::toQString(h.get_torrent_info().creator());
@ -325,6 +330,11 @@ int QTorrentHandle::active_time() const {
return h.status().active_time;
}
bool QTorrentHandle::is_sequential_download() const {
Q_ASSERT(h.is_valid());
return h.is_sequential_download();
}
//
// Setters
//
@ -428,6 +438,11 @@ void QTorrentHandle::move_storage(QString new_path) const {
h.move_storage(new_path.toLocal8Bit().data());
}
void QTorrentHandle::file_priority(int index, int priority) const {
Q_ASSERT(h.is_valid());
h.file_priority(index, priority);
}
//
// Operators
//