summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstandardpaths_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qstandardpaths_mac.mm')
-rw-r--r--src/corelib/io/qstandardpaths_mac.mm33
1 files changed, 4 insertions, 29 deletions
diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm
index dc3d7737b6..5aa894578b 100644
--- a/src/corelib/io/qstandardpaths_mac.mm
+++ b/src/corelib/io/qstandardpaths_mac.mm
@@ -168,36 +168,11 @@ static QString baseWritableLocation(QStandardPaths::StandardLocation type,
QString QStandardPaths::writableLocation(StandardLocation type)
{
- if (isTestModeEnabled()) {
- const QString qttestDir = QDir::homePath() + QLatin1String("/.qttest");
- QString path;
- switch (type) {
- case GenericDataLocation:
- case AppDataLocation:
- case AppLocalDataLocation:
- path = qttestDir + QLatin1String("/Application Support");
- if (type != GenericDataLocation)
- appendOrganizationAndApp(path);
- return path;
- case GenericCacheLocation:
- case CacheLocation:
- path = qttestDir + QLatin1String("/Cache");
- if (type == CacheLocation)
- appendOrganizationAndApp(path);
- return path;
- case GenericConfigLocation:
- case ConfigLocation:
- case AppConfigLocation:
- path = qttestDir + QLatin1String("/Preferences");
- if (type == AppConfigLocation)
- appendOrganizationAndApp(path);
- return path;
- default:
- break;
- }
- }
+ QString location = baseWritableLocation(type, NSUserDomainMask, true);
+ if (isTestModeEnabled())
+ location = location.replace(QDir::homePath(), QDir::homePath() + QLatin1String("/.qttest"));
- return baseWritableLocation(type, NSUserDomainMask, true);
+ return location;
}
QStringList QStandardPaths::standardLocations(StandardLocation type)