summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index f2a7004e80..9476a7451e 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -627,9 +627,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