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

Method setupDocumentBreakpoints

kdevplatform/debugger/breakpoint/breakpointmodel.cpp:155–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void BreakpointModel::setupDocumentBreakpoints(KTextEditor::Document& document) const
156{
157 Q_D(const BreakpointModel);
158
159 // Initial setup of moving cursors and marks.
160 const QUrl docUrl = document.url();
161 // We forbid breakpoints in documents with empty URLs. A breakpoint's empty URL value means "none".
162 Q_ASSERT(!docUrl.isEmpty());
163
164 const auto docLineCount = document.lines();
165 for (Breakpoint* breakpoint : std::as_const(d->breakpoints)) {
166 if (breakpoint->kind() == Breakpoint::CodeBreakpoint && docUrl == breakpoint->url()) {
167 const auto savedLine = breakpoint->savedLine();
168 if (savedLine >= 0 && savedLine < docLineCount) {
169 breakpoint->restartDocumentLineTrackingAt(document, savedLine);
170 }
171 }
172 }
173}
174
175void BreakpointModel::detachDocumentBreakpoints(KTextEditor::Document& document) const
176{

Callers

nothing calls this directly

Calls 6

savedLineMethod · 0.80
urlMethod · 0.45
isEmptyMethod · 0.45
linesMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected