Quickplay integration for MacOS

This commit is contained in:
Jack Andersen 2019-05-27 12:39:24 -10:00
parent acd925ffaa
commit 5304f8026e
2 changed files with 19 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#include <QString>
void MacOSSetDarkAppearance() void MacOSSetDarkAppearance()
{ {
@ -7,3 +8,11 @@ void MacOSSetDarkAppearance()
[NSApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]]; [NSApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]];
#endif #endif
} }
QString MacOSPathToDolphinBinary()
{
if (id path = [[NSWorkspace sharedWorkspace]
absolutePathForAppBundleWithIdentifier:@"org.dolphin-emu.dolphin"])
return QString::fromNSString(path) + QStringLiteral("/Contents/MacOS/Dolphin");
return QString();
}

View File

@ -10,6 +10,10 @@
#undef MoveFile #undef MoveFile
#undef DeleteFile #undef DeleteFile
#if defined(__APPLE__)
QString MacOSPathToDolphinBinary();
#endif
namespace NDolphinIntegration namespace NDolphinIntegration
{ {
@ -319,6 +323,12 @@ QString GetDolphinPath()
{ {
gDolphinPath = Path; gDolphinPath = Path;
} }
else
{
#if defined(__APPLE__)
gDolphinPath = MacOSPathToDolphinBinary();
#endif
}
} }
return Path; return Path;