forked from qt-creator/qt-creator
Utils: Consolidate the isRelative/isAbsolute implementations
Even if we do it wrong in corner cases, we should do it consistently. Change-Id: I68d5a6e55ede889cb44bedb46d0ea545dae7ba2c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -81,9 +81,7 @@ QStringList toAbsolutePath(const Utils::FilePath &refPath, QStringList &pathList
|
||||
std::cend(pathList),
|
||||
std::back_inserter(allAbs),
|
||||
[refPath](const QString &path) {
|
||||
if (Utils::FileUtils::isAbsolutePath(path))
|
||||
return path;
|
||||
return refPath.pathAppended(path).toString();
|
||||
return refPath.resolvePath(path).toString();
|
||||
});
|
||||
return allAbs;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ struct Target
|
||||
static inline QString fullName(const Utils::FilePath &srcDir, const Target &target)
|
||||
{
|
||||
using namespace Utils;
|
||||
if (FileUtils::isAbsolutePath(target.fileName.first())) {
|
||||
if (FilePath::fromString((target.fileName.first())).isAbsolutePath()) {
|
||||
const auto fname = target.fileName.first().split('/').last();
|
||||
QString definedIn = FilePath::fromString(target.definedIn).absolutePath().toString();
|
||||
return definedIn.remove(srcDir.toString()) + '/' + fname;
|
||||
|
||||
Reference in New Issue
Block a user