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

Method terminal

plugins/execute/executeplugin.cpp:161–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161QStringList ExecutePlugin::terminal(KDevelop::ILaunchConfiguration* cfg, QString& error) const
162{
163 if( !cfg )
164 {
165 return {};
166 }
167 auto terminalCommand = cfg->config().readEntry(ExecutePlugin::terminalEntry, QString{});
168
169 // Keep old external terminal config working and (mostly) preserve backward compatibility:
170 {
171 // 1) remove an obsolete placeholder %exe from the end of the command
172 constexpr QLatin1String exePlaceholder("%exe");
173 if (terminalCommand.endsWith(exePlaceholder)) {
174 terminalCommand.chop(exePlaceholder.size());
175 qCWarning(PLUGIN_EXECUTE).nospace()
176 << "the external terminal command for the launch configuration " << cfg->name()
177 << " ends with an obsolete placeholder " << exePlaceholder << ", please remove it";
178 }
179
180 // 2) remove obsolete --workdir arguments to konsole
181 constexpr QLatin1String workdirArguments("--workdir %workdir");
182 const auto previousSize = terminalCommand.size();
183 terminalCommand.remove(workdirArguments);
184 if (terminalCommand.size() != previousSize) {
185 Q_ASSERT(terminalCommand.size() + workdirArguments.size() <= previousSize);
186 qCWarning(PLUGIN_EXECUTE).nospace()
187 << "the external terminal command for the launch configuration " << cfg->name()
188 << " contains obsolete arguments " << workdirArguments << ", please remove them";
189 }
190 }
191
192 return splitNonemptyLaunchConfigurationEntry(
193 *cfg, terminalCommand,
194 LaunchConfigurationEntryName{"external terminal command", i18n("external terminal command")}, error);
195}
196
197
198QUrl ExecutePlugin::workingDirectory( KDevelop::ILaunchConfiguration* cfg ) const

Callers 3

NativeAppJobMethod · 0.45
startDebuggingMethod · 0.45
initializeStartupInfoMethod · 0.45

Calls 7

readEntryMethod · 0.80
endsWithMethod · 0.80
configMethod · 0.45
sizeMethod · 0.45
nameMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected