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>
#include <QString>
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();
}

View File

@ -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;