provider: Fixed applying of IPS patches. Handle applying asynchronously

This commit is contained in:
WerWolv
2022-01-09 21:27:59 +01:00
parent 4e636381fd
commit d38d261bbc
8 changed files with 149 additions and 51 deletions

View File

@@ -16,15 +16,26 @@ namespace hex {
SharedData::runningTasks.remove(this);
}
void Task::setMaxValue(u64 maxValue) {
this->m_maxValue = maxValue;
}
void Task::update(u64 currValue) {
if (this->m_currValue < this->m_maxValue)
this->m_currValue = currValue;
}
double Task::getProgress() const {
if (this->m_maxValue == 0)
return 100;
return static_cast<double>(this->m_currValue) / static_cast<double>(this->m_maxValue);
}
bool Task::isPending() const {
return this->m_maxValue == 0;
}
const std::string& Task::getName() const {
return this->m_name;
}