MCPcopy Create free account
hub / github.com/KDAB/GammaRay / delayedInit

Method delayedInit

core/probe.cpp:347–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347void Probe::delayedInit()
348{
349 QCoreApplication::instance()->installEventFilter(this);
350
351 QString appName = qApp->applicationName();
352 if (appName.isEmpty() && !qApp->arguments().isEmpty()) {
353 appName = qApp->arguments().first().remove(qApp->applicationDirPath());
354 if (appName.startsWith('.'))
355 appName = appName.right(appName.length() - 1);
356 if (appName.startsWith('/'))
357 appName = appName.right(appName.length() - 1);
358 }
359 if (appName.isEmpty())
360 appName = tr("PID %1").arg(qApp->applicationPid());
361 m_server->setLabel(appName);
362 // The applicationName might be translated, so let's go with the application file base name
363 m_server->setKey(QFileInfo(qApp->applicationFilePath()).completeBaseName());
364 m_server->setPid(qApp->applicationPid());
365
366 if (ProbeSettings::value(QStringLiteral("RemoteAccessEnabled"), true).toBool()) {
367 const auto serverStarted = m_server->listen();
368 if (serverStarted) {
369 ProbeSettings::sendServerAddress(m_server->externalAddress());
370 } else {
371 ProbeSettings::sendServerLaunchError(m_server->errorString());
372 }
373 }
374
375 if (ProbeSettings::value(QStringLiteral("InProcessUi"), false).toBool())
376 showInProcessUi();
377}
378
379void Probe::shutdown()
380{

Callers

nothing calls this directly

Calls 11

applicationNameMethod · 0.80
argumentsMethod · 0.80
rightMethod · 0.80
setLabelMethod · 0.80
setKeyMethod · 0.80
isEmptyMethod · 0.45
removeMethod · 0.45
setPidMethod · 0.45
listenMethod · 0.45
externalAddressMethod · 0.45
errorStringMethod · 0.45

Tested by

no test coverage detected