| 703 | } |
| 704 | |
| 705 | void 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 | |
| 737 | void BreakpointModel::load() |
| 738 | { |
nothing calls this directly
no test coverage detected