From a135d87a0f8ec24445e13fb54f4316e4ca7473be Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Tue, 28 Aug 2012 14:05:33 +0200 Subject: Blackberry: Fix QFileSystemEngine::tempPath() Apparently it depends on the user and/or firmware version on whether TMPDIR or TEMP is set, so try both. Additionally, fall back to /tmp if neither is set, as that seems to be present on all devices. Change-Id: Ia49499729df525276e145d2e35e94559eac45c98 Reviewed-by: Shane Kearns --- src/corelib/io/qfilesystemengine_unix.cpp | 7 +++++-- 1 file 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 -- cgit v1.2.3