Utils: Replace Environment::isSameExecutable()

... by FilePath::isSameExecutable().

The only non-mechanical case is the use inside QmakeBuildSystem::testToolChain
using a build environment instead of the FilePath's device environment.

This make a difference in theory due to the use of PATHEXT in the actual
check, but I believe the case that someone creates a 'qmake.foo' and
a 'qmake.bar', adds .foo and .bar to PATHEXT and then complains that
there's a warning missing about not-matching mkspecs has zero
likelihood in reality (and will break other places in Creator anyway).

Change-Id: Id6a8d1e4dc2eb74ca81610ccb1c4ee94c6f47e12
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-11-21 12:29:17 +01:00
parent bf325fd6af
commit c7c6ddb8b0
9 changed files with 11 additions and 40 deletions

View File

@@ -168,21 +168,6 @@ static QStringList appendExeExtensions(const Environment &env, const QString &ex
return execs;
}
bool Environment::isSameExecutable(const QString &exe1, const QString &exe2) const
{
const QStringList exe1List = appendExeExtensions(*this, exe1);
const QStringList exe2List = appendExeExtensions(*this, exe2);
for (const QString &i1 : exe1List) {
for (const QString &i2 : exe2List) {
const FilePath f1 = FilePath::fromString(i1);
const FilePath f2 = FilePath::fromString(i2);
if (f1.isSameFile(f2))
return true;
}
}
return false;
}
QString Environment::expandedValueForKey(const QString &key) const
{
return expandVariables(m_dict.value(key));