MCPcopy Create free account
hub / github.com/KDE/kdevelop / removeBreakpointMarks

Method removeBreakpointMarks

kdevplatform/debugger/breakpoint/breakpointmodel.cpp:219–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void BreakpointModel::removeBreakpointMarks(KTextEditor::Document& document)
220{
221 const auto& marks = document.marks();
222 if (marks.empty()) {
223 return;
224 }
225
226 const auto guard = markChangeGuard();
227
228 // A call to KTextEditor::Document::removeMark() usually erases an element from the document's marks() container.
229 // Erasing an element can invalidate iterators and thus requires iterating over a copy.
230 // Iterating over a copy of the marks() container would almost certainly detach it and thus end implicit sharing.
231 // Iterate over a local container of keys both for code simplicity (no need for QHash::key_value_iterator)
232 // and performance (the QList is smaller than the QHash and is ideal for the loop below).
233 const auto markLines = marks.keys();
234 for (const int line : markLines) {
235 document.removeMark(line, AllBreakpointMarks);
236 }
237}
238
239void BreakpointModel::aboutToReload()
240{

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected