MCPcopy Create free account
hub / github.com/MITK/MITK / OnProcessFinished

Method OnProcessFinished

Modules/PythonInstaller/src/QmitkPipInstaller.cpp:230–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void QmitkPipInstaller::OnProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
231{
232 // Cancellation: the process was killed by Cancel(). Run cleanup and emit the
233 // terminal signal here, off the original Cancel() call stack, so the UI
234 // thread is not blocked while we tear down the venv.
235 if (m_State == State::Cancelling)
236 {
237 this->FinalizeCancel();
238 return;
239 }
240
241 bool success = exitStatus == QProcess::NormalExit && exitCode == 0;
242 auto numPackages = static_cast<int>(m_ResolvedPackages.size());
243
244 switch (m_State)
245 {
246 case State::CreatingVirtualEnv:
247 {
248 if (!success)
249 {
250 m_State = State::Failed;
251 emit ErrorOccurred("Failed to create virtual environment.");
252 emit InstallFinished(false);
253 return;
254 }
255
256 if (!mitk::PythonHelper::ActivateVirtualEnv(m_Spec.venvName))
257 {
258 m_State = State::Failed;
259 emit ErrorOccurred("Failed to activate virtual environment.");
260 emit InstallFinished(false);
261 return;
262 }
263
264 if (m_Spec.upgradePipFirst)
265 {
266 this->StartPipUpgrade();
267 }
268 else
269 {
270 emit ResolveStarted();
271 this->StartResolveGroup();
272 }
273 break;
274 }
275
276 case State::UpgradingPip:
277 {
278 // pip upgrade failure is non-fatal - proceed to resolve first group.
279 m_State = State::Resolving;
280 emit ResolveStarted();
281 this->StartResolveGroup();
282 break;
283 }
284
285 case State::Resolving:
286 {
287 if (!success)

Callers

nothing calls this directly

Calls 11

FinalizeCancelMethod · 0.95
StartPipUpgradeMethod · 0.95
StartResolveGroupMethod · 0.95
ParseResolveReportMethod · 0.95
StartInstallPackageMethod · 0.95
AdvanceToNextGroupMethod · 0.95
StartPostInstallStepMethod · 0.95
ActivateVirtualEnvFunction · 0.85
QStringClass · 0.50
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected