Utils: Add a FilePath::environment

A hook into the system environment of the FilePath's device.

Change-Id: I274032f9e716f3cd8b2e4af2eca010b9805a4568
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-07-06 15:58:33 +02:00
parent 4eec360563
commit eb70e20453
3 changed files with 22 additions and 1 deletions

View File

@@ -1387,6 +1387,16 @@ FilePath FilePath::onDeviceSearchInPath() const
return Environment::systemEnvironment().searchInPath(path());
}
Environment FilePath::deviceEnvironment() const
{
if (needsDevice()) {
QTC_ASSERT(s_deviceHooks.environment, return {});
return s_deviceHooks.environment(*this);
}
return Environment::systemEnvironment();
}
FilePath FilePath::pathAppended(const QString &path) const
{
FilePath fn = *this;