diff options
author | Harald Fernengel <harald.fernengel@nokia.com> | 2011-01-19 09:04:42 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2011-01-19 09:08:44 (GMT) |
commit | 66669ef4e0abf48fcf8282fc4f746f3f45f0cca0 (patch) | |
tree | 1d6d69aac8559dbdbbebbce7874d9cb8b902d10b /src | |
parent | 4f1f806e2258ed003039d33eb0e64109a63f70fc (diff) | |
download | Qt-66669ef4e0abf48fcf8282fc4f746f3f45f0cca0.zip Qt-66669ef4e0abf48fcf8282fc4f746f3f45f0cca0.tar.gz Qt-66669ef4e0abf48fcf8282fc4f746f3f45f0cca0.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
Diffstat (limited to 'src')
-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) |