MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / getAllowedCommands

Method getAllowedCommands

tools/ExecuteTerminalCommandTool.cpp:445–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445QStringList ExecuteTerminalCommandTool::getAllowedCommands() const
446{
447 QString commandsStr;
448
449#ifdef Q_OS_LINUX
450 commandsStr = Settings::toolsSettings().allowedTerminalCommandsLinux().trimmed();
451#elif defined(Q_OS_MACOS)
452 commandsStr = Settings::toolsSettings().allowedTerminalCommandsMacOS().trimmed();
453#elif defined(Q_OS_WIN)
454 commandsStr = Settings::toolsSettings().allowedTerminalCommandsWindows().trimmed();
455#else
456 commandsStr = Settings::toolsSettings().allowedTerminalCommandsLinux().trimmed(); // fallback
457#endif
458
459 if (commandsStr.isEmpty()) {
460 return QStringList();
461 }
462
463 QStringList result;
464 const QStringList rawCommands = commandsStr.split(',', Qt::SkipEmptyParts);
465 result.reserve(rawCommands.size());
466
467 for (const QString &cmd : rawCommands) {
468 const QString trimmed = cmd.trimmed();
469 if (!trimmed.isEmpty()) {
470 result.append(trimmed);
471 }
472 }
473
474 return result;
475}
476
477int ExecuteTerminalCommandTool::commandTimeoutMs() const
478{

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
appendMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected