| 403 | } |
| 404 | |
| 405 | KTextEditor::Document *Application::openUrl(const QUrl &url, const QString &encoding) |
| 406 | { |
| 407 | Q_UNUSED(encoding); |
| 408 | |
| 409 | const IDocument* doc; |
| 410 | if (url.isEmpty()) { |
| 411 | doc = Core::self()->documentControllerInternal()->openDocumentFromText(QString()); |
| 412 | } else { |
| 413 | const auto resolvedUrl = resolvedToLocalFile(url); |
| 414 | if (!canPointToFile(resolvedUrl)) { |
| 415 | return nullptr; // cannot create a document for a non-file URL |
| 416 | } |
| 417 | doc = Core::self()->documentControllerInternal()->openDocument(resolvedUrl); |
| 418 | } |
| 419 | return doc ? doc->textDocument() : nullptr; |
| 420 | } |
| 421 | |
| 422 | KTextEditor::Document *Application::findUrl(const QUrl &url) const |
| 423 | { |
no test coverage detected