MCPcopy Create free account
hub / github.com/PrismLauncher/PrismLauncher / executeTask

Method executeTask

launcher/java/JavaInstallList.cpp:156–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void JavaListLoadTask::executeTask()
157{
158 setStatus(tr("Detecting Java installations..."));
159
160 JavaUtils ju;
161 QList<QString> candidate_paths = m_only_managed_versions ? getPrismJavaBundle() : ju.FindJavaPaths();
162
163 ConcurrentTask::Ptr job(new ConcurrentTask("Java detection", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt()));
164 m_job.reset(job);
165 connect(m_job.get(), &Task::finished, this, &JavaListLoadTask::javaCheckerFinished);
166 connect(m_job.get(), &Task::progress, this, &Task::setProgress);
167
168 qDebug() << "Probing the following Java paths: ";
169 int id = 0;
170 for (QString candidate : candidate_paths) {
171 auto checker = new JavaChecker(candidate, "", 0, 0, 0, id);
172 connect(checker, &JavaChecker::checkFinished, [this](const JavaChecker::Result& result) { m_results << result; });
173 job->addTask(Task::Ptr(checker));
174 id++;
175 }
176
177 m_job->start();
178}
179
180void JavaListLoadTask::javaCheckerFinished()
181{

Callers

nothing calls this directly

Calls 7

getPrismJavaBundleFunction · 0.85
FindJavaPathsMethod · 0.80
addTaskMethod · 0.80
getMethod · 0.45
settingsMethod · 0.45
resetMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected