| 489 | } |
| 490 | |
| 491 | void KateDocManager::documentOpened() |
| 492 | { |
| 493 | auto *doc = qobject_cast<KTextEditor::Document *>(sender()); |
| 494 | if (!doc) { |
| 495 | return; // should never happen, but who knows |
| 496 | } |
| 497 | disconnect(doc, &KTextEditor::Document::completed, this, &KateDocManager::documentOpened); |
| 498 | disconnect(doc, &KParts::ReadOnlyPart::canceled, this, &KateDocManager::documentOpened); |
| 499 | |
| 500 | // Only set "no success" when doc is empty to avoid close of files |
| 501 | // with other trouble when do closeOrphaned() |
| 502 | if (doc->openingError() && doc->isEmpty()) { |
| 503 | KateDocumentInfo *info = documentInfo(doc); |
| 504 | if (info) { |
| 505 | info->openSuccess = false; |
| 506 | } |
| 507 | } |
| 508 | } |
| 509 | |
| 510 | KTextEditor::Document *KateDocManager::findDocumentForSessionConfigId(int sessionConfigId) const |
| 511 | { |