"Downloaded pieces" bar now displays in yellow the pieces being downloaded

This commit is contained in:
Christophe Dumez
2010-03-18 22:58:32 +00:00
parent 419d719ab8
commit af3755bf91
4 changed files with 45 additions and 12 deletions

View File

@@ -451,6 +451,16 @@ bool QTorrentHandle::has_error() const {
return h.status().error.empty();
}
void QTorrentHandle::downloading_pieces(bitfield &bf) const {
Q_ASSERT(h.is_valid());
std::vector<partial_piece_info> queue;
h.get_download_queue(queue);
for(std::vector<partial_piece_info>::iterator it=queue.begin(); it!= queue.end(); it++) {
bf.set_bit(it->piece_index);
}
return;
}
//
// Setters
//