| 258 | } |
| 259 | |
| 260 | void ForgetProcess() |
| 261 | { |
| 262 | auto processName = GetModuleFilename(selectedProcessId); |
| 263 | if (!processName) processName = UserSelectedProcess(); |
| 264 | DetachProcess(); |
| 265 | if (!processName) return; |
| 266 | for (auto file : { GAME_SAVE_FILE, HOOK_SAVE_FILE }) |
| 267 | { |
| 268 | QStringList lines = QString::fromUtf8(QTextFile(file, QIODevice::ReadOnly).readAll()).split("\n", QString::SkipEmptyParts); |
| 269 | lines.erase(std::remove_if(lines.begin(), lines.end(), [&](const QString& line) { return line.contains(S(processName.value())); }), lines.end()); |
| 270 | QTextFile(file, QIODevice::WriteOnly | QIODevice::Truncate).write(lines.join("\n").append("\n").toUtf8()); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | void AddHook(QString hook) |
| 275 | { |
nothing calls this directly
no test coverage detected