WizardModeSelection: optional 'Portable mode' feature support

This commit is contained in:
xiphon
2020-07-28 17:46:52 +00:00
parent c137a6ea36
commit 4208b66baf
7 changed files with 76 additions and 13 deletions

View File

@@ -36,6 +36,7 @@ class MacOSHelper
public:
static bool isCapsLock();
static bool openFolderAndSelectItem(const QUrl &path);
static QString bundlePath();
};
#endif //MACOSHELPER_H

View File

@@ -55,3 +55,18 @@ bool MacOSHelper::openFolderAndSelectItem(const QUrl &path)
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:fileURLs];
return true;
}
QString MacOSHelper::bundlePath()
{
NSBundle *main = [NSBundle mainBundle];
if (!main)
{
return {};
}
NSString *bundlePathString = [main bundlePath];
if (!bundlePathString)
{
return {};
}
return QString::fromCFString(reinterpret_cast<const CFStringRef>(bundlePathString));
}