| 429 | } |
| 430 | |
| 431 | QString ExecuteTerminalCommandTool::sanitizeOutput(const QString &output, qint64 totalSize) const |
| 432 | { |
| 433 | if (totalSize > MAX_OUTPUT_SIZE) { |
| 434 | const QString truncated = output.left(MAX_OUTPUT_SIZE / 2); |
| 435 | return QString("%1\n\n... [Output truncated: exceeded maximum size of %2 MB. " |
| 436 | "Total output size was %3 bytes] ...") |
| 437 | .arg(truncated) |
| 438 | .arg(MAX_OUTPUT_SIZE / (1024 * 1024)) |
| 439 | .arg(totalSize); |
| 440 | } |
| 441 | |
| 442 | return output; |
| 443 | } |
| 444 | |
| 445 | QStringList ExecuteTerminalCommandTool::getAllowedCommands() const |
| 446 | { |
nothing calls this directly
no outgoing calls
no test coverage detected