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

Method next

launcher/minecraft/MinecraftUpdate.cpp:83–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void MinecraftUpdate::next()
84{
85 if(m_abort)
86 {
87 emitFailed(tr("Aborted by user."));
88 return;
89 }
90 if(m_failed_out_of_order)
91 {
92 emitFailed(m_fail_reason);
93 return;
94 }
95 m_currentTask ++;
96 if(m_currentTask > 0)
97 {
98 auto task = m_tasks[m_currentTask - 1];
99 disconnect(task.get(), &Task::succeeded, this, &MinecraftUpdate::subtaskSucceeded);
100 disconnect(task.get(), &Task::failed, this, &MinecraftUpdate::subtaskFailed);
101 disconnect(task.get(), &Task::aborted, this, &Task::abort);
102 disconnect(task.get(), &Task::progress, this, &MinecraftUpdate::progress);
103 disconnect(task.get(), &Task::status, this, &MinecraftUpdate::setStatus);
104 }
105 if(m_currentTask == m_tasks.size())
106 {
107 emitSucceeded();
108 return;
109 }
110 auto task = m_tasks[m_currentTask];
111 // if the task is already finished by the time we look at it, skip it
112 if(task->isFinished())
113 {
114 qCritical() << "MinecraftUpdate: Skipping finished subtask" << m_currentTask << ":" << task.get();
115 next();
116 }
117 connect(task.get(), &Task::succeeded, this, &MinecraftUpdate::subtaskSucceeded);
118 connect(task.get(), &Task::failed, this, &MinecraftUpdate::subtaskFailed);
119 connect(task.get(), &Task::aborted, this, &Task::abort);
120 connect(task.get(), &Task::progress, this, &MinecraftUpdate::progress);
121 connect(task.get(), &Task::status, this, &MinecraftUpdate::setStatus);
122 // if the task is already running, do not start it again
123 if(!task->isRunning())
124 {
125 task->start();
126 }
127}
128
129void MinecraftUpdate::subtaskSucceeded()
130{

Callers 15

extractFinishedMethod · 0.80
operator()Method · 0.80
discoverInstancesMethod · 0.80
deleteExistingFilesMethod · 0.80
createOverridesFunction · 0.80
extractFinishedMethod · 0.80
extractFinishedMethod · 0.80
fromInspectedFolderMethod · 0.80
abortMethod · 0.80
getDirectorySizeFunction · 0.80
drawBadgesFunction · 0.80
findBestIconInFunction · 0.80

Calls 6

nextFunction · 0.85
isFinishedMethod · 0.80
getMethod · 0.45
sizeMethod · 0.45
isRunningMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected