Utils: Reduce need for resolving of symlinks

Be more strict when checking whether two files might be the
same executable.

As side-effect this reduces the calls to symLinkTarget() a lot
and speeds up auto detection of kits.

Change-Id: I23dc697a34bf93f8bd09cbe7e9d17f829cf0d010
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2021-07-23 09:46:58 +02:00
parent 8593920f4c
commit 98ae0d44e6

View File

@@ -183,6 +183,8 @@ bool Environment::isSameExecutable(const QString &exe1, const QString &exe2) con
const FilePath f2 = FilePath::fromString(i2);
if (f1 == f2)
return true;
if (f1.needsDevice() != f2.needsDevice() || f1.scheme() != f2.scheme())
return false;
if (f1.resolveSymlinks() == f2.resolveSymlinks())
return true;
if (FileUtils::fileId(f1) == FileUtils::fileId(f2))