Browse Source

Fix torrent availability computation

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
f61bccf700
  1. 3
      src/pieceavailabilitybar.h
  2. 4
      src/propertieswidget.cpp

3
src/pieceavailabilitybar.h

@ -51,7 +51,7 @@ public: @@ -51,7 +51,7 @@ public:
setFixedHeight(BAR_HEIGHT);
}
double setAvailability(const std::vector<int>& avail) {
void setAvailability(const std::vector<int>& avail) {
double average = 0;
if(avail.empty()) {
// Empty bar
@ -95,7 +95,6 @@ public: @@ -95,7 +95,6 @@ public:
}
}
update();
return average;
}
void clear() {

4
src/propertieswidget.cpp

@ -355,8 +355,8 @@ void PropertiesWidget::loadDynamicData() { @@ -355,8 +355,8 @@ void PropertiesWidget::loadDynamicData() {
showPiecesAvailability(true);
std::vector<int> avail;
h.piece_availability(avail);
double avail_average = pieces_availability->setAvailability(avail);
avail_average_lbl->setText(QString::number(avail_average, 'f', 1));
pieces_availability->setAvailability(avail);
avail_average_lbl->setText(QString::number(h.get_torrent_handle().status().distributed_copies, 'f', 1));
} else {
showPiecesAvailability(false);
}

Loading…
Cancel
Save