MCPcopy Create free account
hub / github.com/YACReader/yacreader / openComicInThirdPartyApp

Method openComicInThirdPartyApp

YACReaderLibrary/library_comic_opener.cpp:63–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63bool 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}

Callers

nothing calls this directly

Calls 4

parseCommandFunction · 0.85
isEmptyMethod · 0.80
replaceMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected