MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / watch

Method watch

launcher/ui/widgets/ProgressWidget.cpp:42–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void ProgressWidget::watch(const Task* task)
43{
44 if (!task)
45 return;
46
47 if (m_task)
48 disconnect(m_task, nullptr, this, nullptr);
49
50 m_task = task;
51
52 connect(m_task, &Task::finished, this, &ProgressWidget::handleTaskFinish);
53 connect(m_task, &Task::status, this, &ProgressWidget::handleTaskStatus);
54 // TODO: should we connect &Task::details
55 connect(m_task, &Task::progress, this, &ProgressWidget::handleTaskProgress);
56 connect(m_task, &Task::destroyed, this, &ProgressWidget::taskDestroyed);
57
58 if (m_task->isRunning())
59 show();
60 else
61 connect(m_task, &Task::started, this, &ProgressWidget::show);
62}
63
64void ProgressWidget::start(const Task* task)
65{

Callers 6

triggerSearchMethod · 0.80
triggerSearchMethod · 0.80
triggerSearchMethod · 0.80
triggerSearchMethod · 0.80
triggerSearchMethod · 0.80
triggerSearchMethod · 0.80

Calls 1

isRunningMethod · 0.45

Tested by

no test coverage detected