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

Function canPointToFile

kdevplatform/shell/ktexteditorpluginintegration.cpp:78–83  ·  view source on GitHub ↗

* @return whether a given URL can possibly point to a file * * KTextEditor (plugins) might look up or open a document by a local-file URL with an empty file name. * DocumentController asserts that a URL passed to it has a nonempty file name or is not a local file. This * function helps slots that implement KTextEditor API to properly fail instead of triggering the assertion failures. * * @pr

Source from the content-addressed store, hash-verified

76 * @pre @p !url.isRelative() because a relative URL is never a local file, and so must be resolved before the check
77 */
78[[nodiscard]] bool canPointToFile(const QUrl& url)
79{
80 Q_ASSERT(!url.isEmpty());
81 Q_ASSERT(!url.isRelative());
82 return !url.fileName().isEmpty() || !url.isLocalFile();
83}
84
85/**
86 * If a given URL is a local file, return a version of the URL

Callers 2

openUrlMethod · 0.85
findUrlMethod · 0.85

Calls 3

isLocalFileMethod · 0.80
isEmptyMethod · 0.45
fileNameMethod · 0.45

Tested by

no test coverage detected