MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / undoAllForCurrentMessage

Method undoAllForCurrentMessage

ChatView/FileEditController.cpp:236–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void FileEditController::undoAllForCurrentMessage()
237{
238 if (m_currentRequestId.isEmpty()) {
239 emit errorOccurred(QString("No active message with file edits"));
240 return;
241 }
242
243 LOG_MESSAGE(QString("Undoing all file edits for message: %1").arg(m_currentRequestId));
244
245 QString errorMsg;
246 bool success = Context::ChangesManager::instance()
247 .undoAllEditsForRequest(m_currentRequestId, &errorMsg);
248
249 if (success) {
250 emit infoMessage(QString("All file edits undone successfully"));
251 } else {
252 emit errorOccurred(
253 errorMsg.isEmpty()
254 ? QString("Failed to undo some file edits")
255 : QString("Failed to undo some file edits:\n%1").arg(errorMsg));
256 }
257
258 auto edits = Context::ChangesManager::instance().getEditsForRequest(m_currentRequestId);
259 for (const auto &edit : edits) {
260 if (edit.status == Context::ChangesManager::Rejected) {
261 updateFileEditStatus(edit.editId, "rejected");
262 }
263 }
264
265 updateStats();
266}
267
268void FileEditController::updateStats()
269{

Callers 1

Calls 3

getEditsForRequestMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected