MCPcopy Create free account
hub / github.com/Artikash/Textractor / ForgetProcess

Function ForgetProcess

GUI/mainwindow.cpp:260–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 5

GetModuleFilenameFunction · 0.85
UserSelectedProcessFunction · 0.85
QTextFileClass · 0.85
SFunction · 0.85
DetachProcessFunction · 0.70

Tested by

no test coverage detected