diff options
author | hjk <hjk@qt.io> | 2022-11-21 12:29:17 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-11-23 08:07:08 +0000 |
commit | c7c6ddb8b07251270b42f648ccd5e08c6e8b2127 (patch) | |
tree | 387f8ed3e28169574c0fb9eec0872609bac683d1 /src/libs | |
parent | bf325fd6af47a72764fc5df154621ec3e6c713c4 (diff) |
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>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/utils/environment.cpp | 15 | ||||
-rw-r--r-- | src/libs/utils/environment.h | 2 |
2 files changed, 0 insertions, 17 deletions
diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index 0a2d39c8f0..486fb85053 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -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)); diff --git a/src/libs/utils/environment.h b/src/libs/utils/environment.h index 180bd86b49..65ecc8dbbe 100644 --- a/src/libs/utils/environment.h +++ b/src/libs/utils/environment.h @@ -65,8 +65,6 @@ public: FilePaths path() const; FilePaths pathListValue(const QString &varName) const; - bool isSameExecutable(const QString &exe1, const QString &exe2) const; - QString expandedValueForKey(const QString &key) const; QString expandVariables(const QString &input) const; FilePath expandVariables(const FilePath &input) const; |