summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstandardpaths_blackberry.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz.qnx@kdab.com>2012-07-03 14:28:49 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-11 11:33:32 +0200
commit569ea8c365b927c621ef590874352d355b840fd7 (patch)
tree2998f416bed50a67e8982515b7fedfdc74548290 /src/corelib/io/qstandardpaths_blackberry.cpp
parentd281aa6936ad01e28dacabb41bd9eb59891f85a1 (diff)
QNX: fix linking by implementing QStandardPaths::enableTestMode()
Change-Id: Ia223ff598d816dd6420437a9a58be26da55d7c07 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: David Faure <faure@kde.org>
Diffstat (limited to 'src/corelib/io/qstandardpaths_blackberry.cpp')
-rw-r--r--src/corelib/io/qstandardpaths_blackberry.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/corelib/io/qstandardpaths_blackberry.cpp b/src/corelib/io/qstandardpaths_blackberry.cpp
index b4c036dcc7..9f63f29a9e 100644
--- a/src/corelib/io/qstandardpaths_blackberry.cpp
+++ b/src/corelib/io/qstandardpaths_blackberry.cpp
@@ -44,8 +44,24 @@
#ifndef QT_NO_STANDARDPATHS
+#include <qstring.h>
+
QT_BEGIN_NAMESPACE
+static bool qsp_testMode = false;
+
+void QStandardPaths::enableTestMode(bool testMode)
+{
+ qsp_testMode = testMode;
+}
+
+static QString testModeInsert() {
+ if (qsp_testMode)
+ return QStringLiteral("/.qttest");
+ else
+ return QStringLiteral("");
+}
+
QString QStandardPaths::writableLocation(StandardLocation type)
{
QDir sharedDir = QDir::home();
@@ -55,6 +71,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
switch (type) {
case DataLocation:
+ return QDir::homePath() + testModeInsert();
case DesktopLocation:
case HomeLocation:
return QDir::homePath();
@@ -63,11 +80,11 @@ QString QStandardPaths::writableLocation(StandardLocation type)
return QDir::tempPath();
case CacheLocation:
case GenericCacheLocation:
- return QDir::homePath() + QLatin1String("/Cache");
+ return QDir::homePath() + testModeInsert() + QLatin1String("/Cache");
case ConfigLocation:
- return QDir::homePath() + QLatin1String("/Settings");
+ return QDir::homePath() + testModeInsert() + QLatin1String("/Settings");
case GenericDataLocation:
- return sharedRoot + QLatin1String("/misc");
+ return sharedRoot + testModeInsert() + QLatin1String("/misc");
case DocumentsLocation:
return sharedRoot + QLatin1String("/documents");
case PicturesLocation: