Merge pull request #3026

4208b66 WizardModeSelection: optional 'Portable mode' feature support (xiphon)
This commit is contained in:
luigi1111
2020-10-04 17:39:09 -05:00
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));
}