| 61 | } |
| 62 | |
| 63 | bool YACReader::openComicInThirdPartyApp(const QString &command, const QString &path) |
| 64 | { |
| 65 | QStringList parsed = parseCommand(command); |
| 66 | if (parsed.isEmpty()) { |
| 67 | qDebug() << "Empty command"; |
| 68 | return false; |
| 69 | } |
| 70 | |
| 71 | QString program = parsed.takeFirst(); |
| 72 | QStringList rawArguments = parsed; |
| 73 | QStringList arguments; |
| 74 | |
| 75 | auto placeholderFound = false; |
| 76 | for (auto argument : rawArguments) { |
| 77 | if (argument.contains("{comic_file_path}")) { |
| 78 | placeholderFound = true; |
| 79 | arguments << argument.replace("{comic_file_path}", path); |
| 80 | } else { |
| 81 | arguments << argument; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | if (!placeholderFound) { |
| 86 | arguments << path; |
| 87 | } |
| 88 | |
| 89 | return QProcess::startDetached(program, arguments); |
| 90 | } |
nothing calls this directly
no test coverage detected