MCPcopy Create free account
hub / github.com/KDE/kdevelop / Job

Method Job

plugins/heaptrack/job.cpp:37–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35{
36
37Job::Job(KDevelop::ILaunchConfiguration* launchConfig, IExecutePlugin* executePlugin)
38{
39 setCapabilities(Killable);
40
41 Q_ASSERT(launchConfig);
42 Q_ASSERT(executePlugin);
43
44 QString errorString;
45 const auto detectError = [&errorString, this](int errorCode) {
46 if (errorString.isEmpty()) {
47 return false;
48 }
49 setError(errorCode);
50 setErrorText(errorString);
51 return true;
52 };
53
54 const auto analyzedExecutable = executePlugin->executable(launchConfig, errorString).toLocalFile();
55 if (detectError(-1)) {
56 return;
57 }
58 QStringList analyzedExecutableArguments = executePlugin->arguments(launchConfig, errorString);
59 if (detectError(-2)) {
60 return;
61 }
62
63 setEnvironmentProfile(validEnvironmentProfileName(executePlugin->environmentProfileName(launchConfig)));
64
65 const QFileInfo analyzedExecutableInfo(analyzedExecutable);
66
67 QUrl workDir = executePlugin->workingDirectory(launchConfig);
68 if (workDir.isEmpty() || !workDir.isValid()) {
69 workDir = QUrl::fromLocalFile(analyzedExecutableInfo.absolutePath());
70 }
71 setWorkingDirectory(workDir);
72
73 *this << KDevelop::Path(GlobalSettings::heaptrackExecutable()).toLocalFile();
74 *this << analyzedExecutable;
75 *this << analyzedExecutableArguments;
76
77 setup(analyzedExecutableInfo.fileName());
78}
79
80Job::Job(long int pid)
81{

Callers

nothing calls this directly

Calls 10

toLocalFileMethod · 0.80
PathClass · 0.50
isEmptyMethod · 0.45
executableMethod · 0.45
argumentsMethod · 0.45
workingDirectoryMethod · 0.45
isValidMethod · 0.45
fileNameMethod · 0.45

Tested by

no test coverage detected