aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-10-04 17:39:09 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-10-04 17:39:09 -0500
commit40e108eb2b7871f686586ba1a1306c8f1402ec5d (patch)
tree015940758659b967171b78adfbc5833b2588f1cb /src/qt
parentcdfe9f338fdf46b301fd6eb627b13109fca561ff (diff)
parent4208b66baf2b1c403f4388eb4720586ad3406dce (diff)
downloadmonzero-gui-40e108eb2b7871f686586ba1a1306c8f1402ec5d.tar.gz
monzero-gui-40e108eb2b7871f686586ba1a1306c8f1402ec5d.tar.xz
monzero-gui-40e108eb2b7871f686586ba1a1306c8f1402ec5d.zip
Merge pull request #3026
4208b66 WizardModeSelection: optional 'Portable mode' feature support (xiphon)
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/macoshelper.h1
-rw-r--r--src/qt/macoshelper.mm15
2 files changed, 16 insertions, 0 deletions
diff --git a/src/qt/macoshelper.h b/src/qt/macoshelper.h
index a6caa79b..e8dabfbe 100644
--- a/src/qt/macoshelper.h
+++ b/src/qt/macoshelper.h
@@ -36,6 +36,7 @@ class MacOSHelper
public:
static bool isCapsLock();
static bool openFolderAndSelectItem(const QUrl &path);
+ static QString bundlePath();
};
#endif //MACOSHELPER_H
diff --git a/src/qt/macoshelper.mm b/src/qt/macoshelper.mm
index a7fb061d..8f7b4b0f 100644
--- a/src/qt/macoshelper.mm
+++ b/src/qt/macoshelper.mm
@@ -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));
+}