Utils: collect host root dir once

This improves the startup performance ~30% on certain machines

Change-Id: Ic7b74d42b0e13ec1dd695d4f322de021b996c051
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
David Schulz
2023-08-31 12:11:16 +02:00
parent 616a0c0f77
commit b418c81414
7 changed files with 25 additions and 11 deletions

View File

@@ -225,7 +225,7 @@ bool FilePath::isRootPath() const
return true;
}
return *this == FilePath::fromString(QDir::rootPath());
return *this == HostOsInfo::root();
}
QString FilePath::encodedHost() const
@@ -986,7 +986,7 @@ const QString &FilePath::specialRootName()
const QString &FilePath::specialRootPath()
{
static const QString rootPath = QDir::rootPath() + u"__qtc_devices__";
static const QString rootPath = HostOsInfo::root().path() + u"__qtc_devices__";
return rootPath;
}
@@ -998,7 +998,7 @@ const QString &FilePath::specialDeviceRootName()
const QString &FilePath::specialDeviceRootPath()
{
static const QString deviceRootPath = QDir::rootPath() + u"__qtc_devices__/device";
static const QString deviceRootPath = HostOsInfo::root().path() + u"__qtc_devices__/device";
return deviceRootPath;
}