diff --git a/src/Editor/MacOSExtras.mm b/src/Editor/MacOSExtras.mm index 0df02987..424d76b2 100644 --- a/src/Editor/MacOSExtras.mm +++ b/src/Editor/MacOSExtras.mm @@ -1,4 +1,5 @@ #import +#include void MacOSSetDarkAppearance() { @@ -7,3 +8,11 @@ void MacOSSetDarkAppearance() [NSApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]]; #endif } + +QString MacOSPathToDolphinBinary() +{ + if (id path = [[NSWorkspace sharedWorkspace] + absolutePathForAppBundleWithIdentifier:@"org.dolphin-emu.dolphin"]) + return QString::fromNSString(path) + QStringLiteral("/Contents/MacOS/Dolphin"); + return QString(); +} diff --git a/src/Editor/NDolphinIntegration.cpp b/src/Editor/NDolphinIntegration.cpp index d809b1a4..99a265ce 100644 --- a/src/Editor/NDolphinIntegration.cpp +++ b/src/Editor/NDolphinIntegration.cpp @@ -10,6 +10,10 @@ #undef MoveFile #undef DeleteFile +#if defined(__APPLE__) +QString MacOSPathToDolphinBinary(); +#endif + namespace NDolphinIntegration { @@ -319,6 +323,12 @@ QString GetDolphinPath() { gDolphinPath = Path; } + else + { +#if defined(__APPLE__) + gDolphinPath = MacOSPathToDolphinBinary(); +#endif + } } return Path;