Fix parsing line and column information from file paths

Amends 84ea908b2d

Change-Id: I9f203d4d4903549e220caa8e3c4b9887da68d049
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2021-06-01 11:51:23 +02:00
parent 8910601b78
commit 5dedd1fba7
2 changed files with 2 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ LineColumn LineColumn::extractFromFileName(const QString &fileName, int &postfix
}
} else {
const QRegularExpressionMatch vsMatch = vsRegexp.match(fileName);
postfixPos = match.capturedStart(0);
postfixPos = vsMatch.capturedStart(0);
filePath = fileName.left(vsMatch.capturedStart(0));
if (vsMatch.lastCapturedIndex() > 1) // index 1 includes closing )
lineColumn.line = vsMatch.captured(2).toInt();

View File

@@ -46,7 +46,7 @@ Link Link::fromString(const QString &fileName, bool canContainLineNumber, QStrin
const LineColumn lineColumn = LineColumn::extractFromFileName(fileName, postfixPos);
if (postfix && postfixPos >= 0)
*postfix = fileName.mid(postfixPos);
return {Utils::FilePath::fromString(fileName.left(postfixPos - 1)),
return {Utils::FilePath::fromString(fileName.left(postfixPos)),
lineColumn.line,
lineColumn.column};
}