From c0da37a806dc0457636d787331e9f50778ee8b3e Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 9 Mar 2017 10:47:04 -0800 Subject: 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 Reviewed-by: Timur Pocheptsov Reviewed-by: Gabriel de Dietrich --- src/corelib/io/qstandardpaths_mac.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qstandardpaths_mac.mm') 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); -- cgit v1.2.3