summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-03-09 10:47:04 -0800
committerJake Petroules <jake.petroules@qt.io>2017-03-11 02:10:10 +0000
commitc0da37a806dc0457636d787331e9f50778ee8b3e (patch)
tree0f5115fa82327605f215b2bfa1f4740d5c960401
parentb52b509ae48125ce9ba3cb50560e2e9ff81b485e (diff)
Fix QStandardPaths values on Apple Platforms containing URL encoding
This corrects an issue where the file system paths returned for some QStandardPaths values on Apple Platforms would be URL encoded, for example having %20 instead of an actual space character. Task-number: QTBUG-59389 Change-Id: I771a44eb20b756842c324ac6fc9bdc475ce84826 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
-rw-r--r--src/corelib/io/qstandardpaths_mac.mm5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm
index a293d4862f..e25339a7d1 100644
--- a/src/corelib/io/qstandardpaths_mac.mm
+++ b/src/corelib/io/qstandardpaths_mac.mm
@@ -204,13 +204,14 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
CFBundleRef mainBundle = CFBundleGetMainBundle();
if (mainBundle) {
CFURLRef bundleUrl = CFBundleCopyBundleURL(mainBundle);
- CFStringRef cfBundlePath = CFURLCopyPath(bundleUrl);
+ CFStringRef cfBundlePath = CFURLCopyFileSystemPath(bundleUrl, kCFURLPOSIXPathStyle);
QString bundlePath = QString::fromCFString(cfBundlePath);
CFRelease(cfBundlePath);
CFRelease(bundleUrl);
CFURLRef resourcesUrl = CFBundleCopyResourcesDirectoryURL(mainBundle);
- CFStringRef cfResourcesPath = CFURLCopyPath(resourcesUrl);
+ CFStringRef cfResourcesPath = CFURLCopyFileSystemPath(resourcesUrl,
+ kCFURLPOSIXPathStyle);
QString resourcesPath = QString::fromCFString(cfResourcesPath);
CFRelease(cfResourcesPath);
CFRelease(resourcesUrl);