MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / start

Method start

launcher/tasks/Task.cpp:61–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void Task::start()
62{
63 switch(m_state)
64 {
65 case State::Inactive:
66 {
67 if (m_show_debug)
68 qDebug() << "Task" << describe() << "starting for the first time";
69 break;
70 }
71 case State::AbortedByUser:
72 {
73 if (m_show_debug)
74 qDebug() << "Task" << describe() << "restarting for after being aborted by user";
75 break;
76 }
77 case State::Failed:
78 {
79 if (m_show_debug)
80 qDebug() << "Task" << describe() << "restarting for after failing at first";
81 break;
82 }
83 case State::Succeeded:
84 {
85 if (m_show_debug)
86 qDebug() << "Task" << describe() << "restarting for after succeeding at first";
87 break;
88 }
89 case State::Running:
90 {
91 if (m_show_debug)
92 qWarning() << "The launcher tried to start task" << describe() << "while it was already running!";
93 return;
94 }
95 }
96 // NOTE: only fall thorugh to here in end states
97 m_state = State::Running;
98 emit started();
99 executeTask();
100}
101
102void Task::emitFailed(QString reason)
103{

Callers 15

executeTaskMethod · 0.45
processFlameMethod · 0.45
processModrinthMethod · 0.45
launchMethod · 0.45
launchInstanceMethod · 0.45
executeTaskMethod · 0.45
childSuccededMethod · 0.45
beginProfilingImplMethod · 0.45
beginProfilingImplMethod · 0.45
onStepFinishedMethod · 0.45
executeTaskMethod · 0.45
executeTaskMethod · 0.45

Calls

no outgoing calls

Tested by 5

test_basicRunMethod · 0.36