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

Method applyAllForCurrentMessage

ChatView/FileEditController.cpp:204–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void FileEditController::applyAllForCurrentMessage()
205{
206 if (m_currentRequestId.isEmpty()) {
207 emit errorOccurred(QString("No active message with file edits"));
208 return;
209 }
210
211 LOG_MESSAGE(QString("Applying all file edits for message: %1").arg(m_currentRequestId));
212
213 QString errorMsg;
214 bool success = Context::ChangesManager::instance()
215 .reapplyAllEditsForRequest(m_currentRequestId, &errorMsg);
216
217 if (success) {
218 emit infoMessage(QString("All file edits applied successfully"));
219 } else {
220 emit errorOccurred(
221 errorMsg.isEmpty()
222 ? QString("Failed to apply some file edits")
223 : QString("Failed to apply some file edits:\n%1").arg(errorMsg));
224 }
225
226 auto edits = Context::ChangesManager::instance().getEditsForRequest(m_currentRequestId);
227 for (const auto &edit : edits) {
228 if (edit.status == Context::ChangesManager::Applied) {
229 updateFileEditStatus(edit.editId, "applied");
230 }
231 }
232
233 updateStats();
234}
235
236void FileEditController::undoAllForCurrentMessage()
237{

Callers 1

Calls 3

getEditsForRequestMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected