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

Method documentSaved

kdevplatform/debugger/breakpoint/breakpointmodel.cpp:705–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703}
704
705void BreakpointModel::documentSaved(KDevelop::IDocument* doc)
706{
707 Q_D(BreakpointModel);
708
709 IF_DEBUG( qCDebug(DEBUGGER); )
710
711 auto* const textDocument = doc->textDocument();
712 if (!textDocument) {
713 return;
714 }
715
716 // We forbid adding breakpoints to an untitled/unsaved document by not enabling its breakpoint actions.
717 // This document might have been untitled before the saving, so enable its breakpoint actions now.
718 Q_ASSERT(!textDocument->url().isEmpty());
719 textDocument->setEditableMarks(MarkType::Bookmark | BreakpointMark);
720
721 // save breakpoints in the given document.
722 for (Breakpoint* breakpoint : std::as_const(d->breakpoints)) {
723 if (breakpoint->movingCursor()) {
724 if (breakpoint->movingCursor()->document() != textDocument)
725 continue;
726 breakpoint->saveMovingCursorLine();
727
728 // FIXME: temporary code to update the breakpoint widget UI.
729 // marksChanged() slot should update the UI so following is not needed:
730 reportChange(breakpoint, Breakpoint::LocationColumn);
731 }
732 }
733
734 scheduleSave();
735}
736
737void BreakpointModel::load()
738{

Callers

nothing calls this directly

Calls 6

movingCursorMethod · 0.80
saveMovingCursorLineMethod · 0.80
textDocumentMethod · 0.45
isEmptyMethod · 0.45
urlMethod · 0.45
documentMethod · 0.45

Tested by

no test coverage detected