mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
cache environment queries in QFileSystemEngine::homePath() and QFileSystemEngine::tempPath()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
0c1c5ef96f
commit
7e08917f21
1 changed files with 2 additions and 2 deletions
|
@ -460,7 +460,7 @@ bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Per
|
||||||
|
|
||||||
QString QFileSystemEngine::homePath()
|
QString QFileSystemEngine::homePath()
|
||||||
{
|
{
|
||||||
const QString home = QFile::decodeName(qgetenv("HOME"));
|
static const QString home = QFile::decodeName(qgetenv("HOME"));
|
||||||
if (Q_LIKELY(!home.isEmpty()))
|
if (Q_LIKELY(!home.isEmpty()))
|
||||||
return QDir::cleanPath(home);
|
return QDir::cleanPath(home);
|
||||||
return rootPath();
|
return rootPath();
|
||||||
|
@ -473,7 +473,7 @@ QString QFileSystemEngine::rootPath()
|
||||||
|
|
||||||
QString QFileSystemEngine::tempPath()
|
QString QFileSystemEngine::tempPath()
|
||||||
{
|
{
|
||||||
const QString temp = QFile::decodeName(qgetenv("TMPDIR"));
|
static const QString temp = QFile::decodeName(qgetenv("TMPDIR"));
|
||||||
if (!temp.isEmpty())
|
if (!temp.isEmpty())
|
||||||
return QDir::cleanPath(temp);
|
return QDir::cleanPath(temp);
|
||||||
return QLatin1String("/tmp");
|
return QLatin1String("/tmp");
|
||||||
|
|
Loading…
Add table
Reference in a new issue