diff options
Diffstat (limited to 'src/corelib/io/qfilesystemengine_unix.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index d1a0621cbe..0e0c0453d0 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -619,9 +619,12 @@ QString QFileSystemEngine::tempPath() return QLatin1String(QT_UNIX_TEMP_PATH_OVERRIDE); #elif defined(Q_OS_BLACKBERRY) QString temp = QFile::decodeName(qgetenv("TEMP")); + if (temp.isEmpty()) + temp = QFile::decodeName(qgetenv("TMPDIR")); + if (temp.isEmpty()) { - qWarning("TEMP environment variable not set. Cannot determine temporary directory"); - return QString(); + qWarning("Neither the TEMP nor the TMPDIR environment variable is set, falling back to /tmp."); + temp = QLatin1String("/tmp/"); } return QDir::cleanPath(temp); #else |