diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm index e25339a7d10..ab73edb008b 100644 --- a/src/corelib/io/qstandardpaths_mac.mm +++ b/src/corelib/io/qstandardpaths_mac.mm @@ -248,9 +248,9 @@ QString QStandardPaths::displayName(StandardLocation type) if (QStandardPaths::ApplicationsLocation == type) return QCoreApplication::translate("QStandardPaths", "Applications"); + const QCFString fsPath(standardLocations(type).constFirst()); if (QCFType url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, - standardLocations(type).constFirst().toCFString(), - kCFURLPOSIXPathStyle, true)) { + fsPath, kCFURLPOSIXPathStyle, true)) { QCFString name; CFURLCopyResourcePropertyForKey(url, kCFURLLocalizedNameKey, &name, NULL); if (name && CFStringGetLength(name))