diff options
author | Harald Fernengel <harald.fernengel@nokia.com> | 2011-01-19 09:04:42 (GMT) |
---|---|---|
committer | Eckhart Koppen <eckhart.koppen@nokia.com> | 2011-01-20 13:59:15 (GMT) |
commit | 74778205f6c5b905dd2194ec0ccb75a8c544f55c (patch) | |
tree | 9545a4738c6df6a7cc77c85f13752616ac6d2de6 | |
parent | 7701926097e0777a27e1598ab9b92e53ae066d20 (diff) | |
download | Qt-74778205f6c5b905dd2194ec0ccb75a8c544f55c.zip Qt-74778205f6c5b905dd2194ec0ccb75a8c544f55c.tar.gz Qt-74778205f6c5b905dd2194ec0ccb75a8c544f55c.tar.bz2 |
Allow hard-coding the Unix temp path
This came as a requirement from a device manufacturer that couldn't
agree whether tmp is /var/tmp or /tmp, which lead to all kinds of side
effects. QSharedMemory token generation was broken depending on
where TMPDIR pointed to. This patch allows hard-coding a Qt-wide temp-dir
in qplatformdefs.
Reviewed-by: Robert Griebl
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 40fb0c0..6acd811 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -612,10 +612,14 @@ QString QFileSystemEngine::rootPath() QString QFileSystemEngine::tempPath() { +#ifdef QT_UNIX_TEMP_PATH_OVERRIDE + return QLatin1String(QT_UNIX_TEMP_PATH_OVERRIDE); +#else QString temp = QFile::decodeName(qgetenv("TMPDIR")); if (temp.isEmpty()) temp = QLatin1String("/tmp/"); return QDir::cleanPath(temp); +#endif } bool QFileSystemEngine::setCurrentPath(const QFileSystemEntry &path) |