| 899 | } |
| 900 | |
| 901 | QString quoteArgs(const QStringList& args, const QString& wrap, const QString& escapeChar, bool wrapOnlyIfNeeded = false) |
| 902 | { |
| 903 | QString result; |
| 904 | |
| 905 | auto size = args.size(); |
| 906 | for (int i = 0; i < size; ++i) { |
| 907 | QString arg = args[i]; |
| 908 | arg.replace(wrap, escapeChar); |
| 909 | |
| 910 | bool needsWrapping = !wrapOnlyIfNeeded || arg.contains(' ') || arg.contains('\t') || arg.contains(wrap); |
| 911 | |
| 912 | if (needsWrapping) |
| 913 | result += wrap + arg + wrap; |
| 914 | else |
| 915 | result += arg; |
| 916 | |
| 917 | if (i < size - 1) |
| 918 | result += ' '; |
| 919 | } |
| 920 | |
| 921 | return result; |
| 922 | } |
| 923 | |
| 924 | // Cross-platform Shortcut creation |
| 925 | QString createShortcut(QString destination, QString target, QStringList args, QString name, QString icon) |
no test coverage detected