Utils: Consolidate Link::from{FilePath,String}

The input is more unparsed-string-ish in nature, so FilePath is not
appropriate.

Change-Id: I85efb5813b8f5fbbc4127be1c936d5487637b75c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-01-13 11:36:24 +01:00
parent c527fc4fe4
commit f939f968ea
4 changed files with 19 additions and 29 deletions

View File

@@ -791,7 +791,7 @@ void QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor,
}
if (text.startsWith("https:/") || text.startsWith("http:/")) {
Link link = Link::fromFilePath(FilePath::fromPathPart(text));
Link link = Link::fromString(text);
link.linkTextStart = literal->literalToken.begin();
link.linkTextEnd = literal->literalToken.end();
processLinkCallback(link);