From fbcf5ecedd86a0bbe98a8174288db278db0a25cb Mon Sep 17 00:00:00 2001 From: Topi Reinio <topi.reinio@qt.io> Date: Tue, 27 Mar 2018 09:30:49 +0200 Subject: [PATCH] qdoc: Print absolute path for errors and warnings QDir::isAbsolutePath() returns true for paths that begin with root dir or drive letter (on Windows). Since Clang integration, we now see warnings with paths such as /path/to/qt5/qtbase/include/QtQuick/../../../qtdeclarative/src/ [...] Remove the check for isAbsolutePath() and always construct an absolute path. Change-Id: Iea1e6f83f452abf0644968e0a5ee725829a8716e Reviewed-by: Martin Smith <martin.smith@qt.io> --- src/qdoc/location.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/qdoc/location.cpp b/src/qdoc/location.cpp index 51fb45b54..cb12e6ea4 100644 --- a/src/qdoc/location.cpp +++ b/src/qdoc/location.cpp @@ -463,11 +463,8 @@ QString Location::toString() const QString Location::top() const { - QString str = filePath(); - if (!QDir::isAbsolutePath(str)) { - QDir path(str); - str = path.absolutePath(); - } + QDir path(filePath()); + QString str = path.absolutePath(); if (lineNo() >= 1) { str += QLatin1Char(':'); str += QString::number(lineNo()); -- GitLab