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>
bb10
Rafael Roquetto 2012-03-28 18:12:38 +02:00 committed by Qt by Nokia
parent 83e7f61b61
commit d8c98de399
1 changed files with 7 additions and 0 deletions

View File

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