summaryrefslogtreecommitdiffstats
path: root/src
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-03-30 21:51:14 +0200
commitd8c98de3999f034bc8ea17c866d4d8c4997f9441 (patch)
tree27db624b4b6eeb9bc9f6da2ae5fcca6feb4c266e /src
parent83e7f61b61c9778428f9c667967c3409c2f95f8a (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: I5905763258ea01541c756361870258b421a00967 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src')
-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 e8ff6107ce..00e116b58f 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -612,6 +612,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())