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

Method start

launcher/tasks/Task.cpp:75–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void Task::start()
76{
77 switch (m_state) {
78 case State::Inactive: {
79 if (m_show_debug)
80 qCDebug(taskLogC) << "Task" << describe() << "starting for the first time";
81 break;
82 }
83 case State::AbortedByUser: {
84 if (m_show_debug)
85 qCDebug(taskLogC) << "Task" << describe() << "restarting for after being aborted by user";
86 break;
87 }
88 case State::Failed: {
89 if (m_show_debug)
90 qCDebug(taskLogC) << "Task" << describe() << "restarting for after failing at first";
91 break;
92 }
93 case State::Succeeded: {
94 if (m_show_debug)
95 qCDebug(taskLogC) << "Task" << describe() << "restarting for after succeeding at first";
96 break;
97 }
98 case State::Running: {
99 if (m_show_debug)
100 qCWarning(taskLogC) << "The launcher tried to start task" << describe() << "while it was already running!";
101 return;
102 }
103 }
104 // NOTE: only fall through to here in end states
105 m_state = State::Running;
106 emit started();
107 executeTask();
108}
109
110void Task::emitFailed(QString reason)
111{

Callers 15

downloadFromUrlMethod · 0.45
processZipPackMethod · 0.45
processFlameMethod · 0.45
processModrinthMethod · 0.45
runMethod · 0.45
checkFinishedMethod · 0.45
launchInstanceMethod · 0.45
runPrivilegedMethod · 0.45
executeTaskMethod · 0.45
childSucceededMethod · 0.45
beginProfilingImplMethod · 0.45
beginProfilingImplMethod · 0.45

Calls

no outgoing calls

Tested by 14

test_linkMethod · 0.36
test_link_single_fileMethod · 0.36
start_timerMethod · 0.36
test_basicRunMethod · 0.36