|
|
@ -204,6 +204,7 @@ Bittorrent* PropertiesWidget::getBTSession() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) { |
|
|
|
void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) { |
|
|
|
|
|
|
|
clear(); |
|
|
|
h = _h; |
|
|
|
h = _h; |
|
|
|
if(!h.is_valid()) { |
|
|
|
if(!h.is_valid()) { |
|
|
|
clear(); |
|
|
|
clear(); |
|
|
@ -330,10 +331,12 @@ void PropertiesWidget::loadDynamicData() { |
|
|
|
// Downloaded pieces
|
|
|
|
// Downloaded pieces
|
|
|
|
downloaded_pieces->setProgress(h.pieces()); |
|
|
|
downloaded_pieces->setProgress(h.pieces()); |
|
|
|
// Pieces availability
|
|
|
|
// Pieces availability
|
|
|
|
std::vector<int> avail; |
|
|
|
if(h.has_metadata()) { |
|
|
|
h.piece_availability(avail); |
|
|
|
std::vector<int> avail; |
|
|
|
double avail_average = pieces_availability->setAvailability(avail); |
|
|
|
h.piece_availability(avail); |
|
|
|
avail_average_lbl->setText(QString::number(avail_average, 'f', 1)); |
|
|
|
double avail_average = pieces_availability->setAvailability(avail); |
|
|
|
|
|
|
|
avail_average_lbl->setText(QString::number(avail_average, 'f', 1)); |
|
|
|
|
|
|
|
} |
|
|
|
// Progress
|
|
|
|
// Progress
|
|
|
|
progress_lbl->setText(QString::number(h.progress()*100., 'f', 1)+"%"); |
|
|
|
progress_lbl->setText(QString::number(h.progress()*100., 'f', 1)+"%"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -353,10 +356,12 @@ void PropertiesWidget::loadDynamicData() { |
|
|
|
} |
|
|
|
} |
|
|
|
if(stackedProperties->currentIndex() == FILES_TAB) { |
|
|
|
if(stackedProperties->currentIndex() == FILES_TAB) { |
|
|
|
// Files progress
|
|
|
|
// Files progress
|
|
|
|
std::vector<size_type> fp; |
|
|
|
if(h.has_metadata()) { |
|
|
|
h.file_progress(fp); |
|
|
|
std::vector<size_type> fp; |
|
|
|
PropListModel->updateFilesPriorities(h.file_priorities()); |
|
|
|
h.file_progress(fp); |
|
|
|
PropListModel->updateFilesProgress(fp); |
|
|
|
PropListModel->updateFilesPriorities(h.file_priorities()); |
|
|
|
|
|
|
|
PropListModel->updateFilesProgress(fp); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch(invalid_handle e) {} |
|
|
|
} catch(invalid_handle e) {} |
|
|
|
} |
|
|
|
} |
|
|
|