- Found a way not to use FullAllocationMode list in order to save memory in cpu

This commit is contained in:
Christophe Dumez
2007-08-29 14:30:30 +00:00
parent db6180b737
commit 27e76962d1
5 changed files with 16 additions and 24 deletions

View File

@@ -131,7 +131,7 @@ size_type QTorrentHandle::actual_size() const{
Q_ASSERT(h.is_valid());
size_type size = 0;
std::vector<int> piece_priorities = h.piece_priorities();
for(unsigned int i = 0; i<piece_priorities.size(); ++i){
for(unsigned int i = 0; i<piece_priorities.size(); ++i) {
if(piece_priorities[i])
size += h.get_torrent_info().piece_size(i);
}
@@ -139,6 +139,15 @@ size_type QTorrentHandle::actual_size() const{
return size;
}
bool QTorrentHandle::has_filtered_pieces() const {
Q_ASSERT(h.is_valid());
std::vector<int> piece_priorities = h.piece_priorities();
for(unsigned int i = 0; i<piece_priorities.size(); ++i) {
if(!piece_priorities[i]) return true;
}
return false;
}
int QTorrentHandle::download_limit() const {
Q_ASSERT(h.is_valid());
return h.download_limit();