From 74778205f6c5b905dd2194ec0ccb75a8c544f55c Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 19 Jan 2011 10:04:42 +0100 Subject: 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 --- src/corelib/io/qfilesystemengine_unix.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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) -- cgit v0.12