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

Function isValidURL

kdevplatform/language/backgroundparser/backgroundparser.cpp:78–90  ·  view source on GitHub ↗

* @return true if @p url is non-empty, valid and has a clean path, false otherwise. */

Source from the content-addressed store, hash-verified

76 * @return true if @p url is non-empty, valid and has a clean path, false otherwise.
77 */
78inline bool isValidURL(const IndexedString& url)
79{
80 if (url.isEmpty()) {
81 return false;
82 }
83 QUrl original = url.toUrl();
84 if (!original.isValid() || original.isRelative() || (original.fileName().isEmpty() && original.isLocalFile())) {
85 qCWarning(LANGUAGE) << "INVALID URL ENCOUNTERED:" << url << original;
86 return false;
87 }
88 QUrl cleaned = original.adjusted(QUrl::NormalizePathSegments);
89 return original == cleaned;
90}
91}
92
93struct DocumentParseTarget

Callers 6

addDocumentListenerMethod · 0.85
removeDocumentMethod · 0.85
priorityForDocumentMethod · 0.85
isQueuedMethod · 0.85
parseJobForDocumentMethod · 0.85
trackerForUrlMethod · 0.85

Calls 5

isLocalFileMethod · 0.80
isEmptyMethod · 0.45
toUrlMethod · 0.45
isValidMethod · 0.45
fileNameMethod · 0.45

Tested by

no test coverage detected