| 356 | } |
| 357 | |
| 358 | void ProblemModel::documentUrlChanged(IDocument* document, const QUrl& previousUrl) |
| 359 | { |
| 360 | Q_D(ProblemModel); |
| 361 | |
| 362 | Q_ASSERT(thread() == QThread::currentThread()); |
| 363 | |
| 364 | const auto currentDocument = d->m_problems->currentDocument(); |
| 365 | // If currentDocument.isEmpty(), the renamed document must have been closed already in |
| 366 | // DocumentControllerPrivate::changeDocumentUrl() because of a conflict with another open modified document at its |
| 367 | // new URL; another document at document->url() should be active now. So set the active document's URL as current. |
| 368 | if (currentDocument.isEmpty() || currentDocument == IndexedString{previousUrl}) { |
| 369 | setCurrentDocument(document); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | void ProblemModel::setShowImports(bool showImports) |
| 374 | { |