QDir::tempPath: make fallback code more readable.
This is a no-op because QDir::cleanPath() already takes care of removing the trailing slash. Change-Id: Ic19d9a9dd7e377e04447c3ebc776b025f5f0c43a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
parent
6f5db32abe
commit
36af7fe678
@ -721,13 +721,13 @@ QString QFileSystemEngine::tempPath()
|
|||||||
|
|
||||||
if (temp.isEmpty()) {
|
if (temp.isEmpty()) {
|
||||||
qWarning("Neither the TEMP nor the TMPDIR environment variable is set, falling back to /tmp.");
|
qWarning("Neither the TEMP nor the TMPDIR environment variable is set, falling back to /tmp.");
|
||||||
temp = QLatin1String("/tmp/");
|
temp = QLatin1String("/tmp");
|
||||||
}
|
}
|
||||||
return QDir::cleanPath(temp);
|
return QDir::cleanPath(temp);
|
||||||
#else
|
#else
|
||||||
QString temp = QFile::decodeName(qgetenv("TMPDIR"));
|
QString temp = QFile::decodeName(qgetenv("TMPDIR"));
|
||||||
if (temp.isEmpty())
|
if (temp.isEmpty())
|
||||||
temp = QLatin1String("/tmp/");
|
temp = QLatin1String("/tmp");
|
||||||
return QDir::cleanPath(temp);
|
return QDir::cleanPath(temp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user