tasks now emit floats rather than integers

Simplifies code for tasks.
This commit is contained in:
itsmattkc
2020-05-19 02:44:38 +10:00
parent b9cd83eff1
commit cb383d760b
10 changed files with 28 additions and 11 deletions
+6 -1
View File
@@ -60,7 +60,7 @@ TaskViewItem::TaskViewItem(Task* task, QWidget *parent) :
layout->addWidget(task_status_lbl_);
// Connect to the task
connect(task_, &Task::ProgressChanged, progress_bar_, &QProgressBar::setValue);
connect(task_, &Task::ProgressChanged, this, &TaskViewItem::UpdateProgress);
connect(cancel_btn_, &QPushButton::clicked, task_, &Task::Cancel, Qt::DirectConnection);
}
@@ -69,4 +69,9 @@ void TaskViewItem::Failed()
task_status_lbl_->setText(task_->GetError());
}
void TaskViewItem::UpdateProgress(double d)
{
progress_bar_->setValue(qRound(100.0 * d));
}
OLIVE_NAMESPACE_EXIT