diff options
author | Rafael Roquetto <rafael.roquetto@kdab.com> | 2012-03-28 16:12:38 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-01 16:03:08 (GMT) |
commit | e8af5040418f927539f136b042f70b649121f416 (patch) | |
tree | c9b906600619a4049bde33adafc5bc42b85976d8 /src/corelib/io | |
parent | dc50f7f3437611a73000a0bc6d13c192910f6bc4 (diff) | |
download | Qt-e8af5040418f927539f136b042f70b649121f416.zip Qt-e8af5040418f927539f136b042f70b649121f416.tar.gz Qt-e8af5040418f927539f136b042f70b649121f416.tar.bz2 |
Fix QFileSystemEngine::tempPath on Blackberry OS
Unlike Unix, Blackberry OS stores the location of the temporary directory into
the TEMP environment variable.
Change-Id: I31f50fc4b160e5594339c4fcd62613963cc1484f
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 7bdb4d8..e31d3d4 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -625,6 +625,13 @@ QString QFileSystemEngine::tempPath() { #ifdef QT_UNIX_TEMP_PATH_OVERRIDE return QLatin1String(QT_UNIX_TEMP_PATH_OVERRIDE); +#elif defined(Q_OS_BLACKBERRY) + QString temp = QFile::decodeName(qgetenv("TEMP")); + if (temp.isEmpty()) { + qWarning("TEMP environment variable not set. Cannot determine temporary directory"); + return QString(); + } + return QDir::cleanPath(temp); #else QString temp = QFile::decodeName(qgetenv("TMPDIR")); if (temp.isEmpty()) |