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 <shane.kearns@accenture.com>
bb10
Thomas McGuire 2012-08-28 14:05:33 +02:00 committed by Qt by Nokia
parent 7e21ba6845
commit a135d87a0f
1 changed files with 5 additions and 2 deletions

View File

@ -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