Remove pointless const_cast in ProgressWidget

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2025-09-17 11:24:10 +01:00
parent 24726ea621
commit 7c9c9432dd
2 changed files with 6 additions and 6 deletions

View File

@@ -39,7 +39,7 @@ void ProgressWidget::progressFormat(QString format)
m_bar->setFormat(format);
}
void ProgressWidget::watch(const Task* task)
void ProgressWidget::watch(Task* task)
{
if (!task)
return;
@@ -61,11 +61,11 @@ void ProgressWidget::watch(const Task* task)
connect(m_task, &Task::started, this, &ProgressWidget::show);
}
void ProgressWidget::start(const Task* task)
void ProgressWidget::start(Task* task)
{
watch(task);
if (!m_task->isRunning())
QMetaObject::invokeMethod(const_cast<Task*>(m_task), "start", Qt::QueuedConnection);
QMetaObject::invokeMethod(m_task, "start", Qt::QueuedConnection);
}
bool ProgressWidget::exec(std::shared_ptr<Task> task)