| 153 | } |
| 154 | |
| 155 | void 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 | |
| 175 | void BreakpointModel::detachDocumentBreakpoints(KTextEditor::Document& document) const |
| 176 | { |