summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@kdab.com>2012-03-28 18:12:38 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-01 18:03:08 +0200
commite8af5040418f927539f136b042f70b649121f416 (patch)
treec9b906600619a4049bde33adafc5bc42b85976d8 /src/corelib/io
parentdc50f7f3437611a73000a0bc6d13c192910f6bc4 (diff)
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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 7bdb4d8300..e31d3d454e 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())