| 398 | } |
| 399 | |
| 400 | qint64 TorrentFileModel::getCheckedFileSize() |
| 401 | { |
| 402 | QList<TorrentFile *> items; |
| 403 | items.push_back(root); |
| 404 | qint64 checkedFileSize=0; |
| 405 | while(!items.empty()) |
| 406 | { |
| 407 | TorrentFile *currentItem=items.takeFirst(); |
| 408 | for(TorrentFile *child:currentItem->children) |
| 409 | { |
| 410 | if(child->children.count()>0) |
| 411 | items.push_back(child); |
| 412 | else if(child->index>0 && child->checkStatus==Qt::Checked) |
| 413 | checkedFileSize+=child->size; |
| 414 | } |
| 415 | } |
| 416 | return checkedFileSize; |
| 417 | } |
| 418 | |
| 419 | void TorrentFileModel::setNormColor(const QColor &color) |
| 420 | { |
no test coverage detected