summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-02-17 13:52:48 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-02-17 17:20:32 +0100
commit2fd50c4903ea8a14bd1fc72874ec6a01dbce25f5 (patch)
treeba6a1e3cbff1cb951bfb65d3ce8eac404eb83453 /doc/src/snippets
parentaa314a19bd396b7936c1abdbdfc40e61804be097 (diff)
macOS: Update example of how to retrieve the application bundle path
Fixes: QTBUG-110742 Pick-to: 6.5 6.4 6.2 Change-Id: Ic81ea40caf9fe6b261f2536f11fa2b460b416aaa Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'doc/src/snippets')
-rw-r--r--doc/src/snippets/code/doc_src_mac-differences.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/doc/src/snippets/code/doc_src_mac-differences.cpp b/doc/src/snippets/code/doc_src_mac-differences.cpp
index 334f21f9b..97646f778 100644
--- a/doc/src/snippets/code/doc_src_mac-differences.cpp
+++ b/doc/src/snippets/code/doc_src_mac-differences.cpp
@@ -3,13 +3,7 @@
//! [1]
#ifdef Q_OS_MAC
- CFURLRef appUrlRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
- CFStringRef macPath = CFURLCopyFileSystemPath(appUrlRef,
- kCFURLPOSIXPathStyle);
- const char *pathPtr = CFStringGetCStringPtr(macPath,
- CFStringGetSystemEncoding());
- qDebug("Path = %s", pathPtr);
- CFRelease(appUrlRef);
- CFRelease(macPath);
+ QString bundlePath = QString::fromNSString(NSBundle.mainBundle.bundlePath);
+ qDebug() << "Bundle path =" << bundlePath;
#endif
//! [1]