MCPcopy Create free account
hub / github.com/KDE/kdevelop / openUrl

Method openUrl

kdevplatform/shell/ktexteditorpluginintegration.cpp:405–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405KTextEditor::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
422KTextEditor::Document *Application::findUrl(const QUrl &url) const
423{

Callers 4

createPartMethod · 0.80
createViewWidgetMethod · 0.80
setDirectoryMethod · 0.80
previewTemplateMethod · 0.80

Calls 9

resolvedToLocalFileFunction · 0.85
canPointToFileFunction · 0.85
openDocumentFromTextMethod · 0.80
QStringClass · 0.70
isEmptyMethod · 0.45
openDocumentMethod · 0.45
textDocumentMethod · 0.45
documentMethod · 0.45

Tested by

no test coverage detected