mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 23:26:40 +02:00
fix mac browser handling, oops.
J, should build for you now too!
This commit is contained in:
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
- (Tomahawk::PlatformInterface*) application_handler;
|
- (Tomahawk::PlatformInterface*) application_handler;
|
||||||
- (void) setApplicationHandler: (Tomahawk::PlatformInterface*)handler;
|
- (void) setApplicationHandler: (Tomahawk::PlatformInterface*)handler;
|
||||||
- (void) getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent;
|
|
||||||
- (void) mediaKeyEvent: (int)key state: (BOOL)state repeat: (BOOL)repeat;
|
- (void) mediaKeyEvent: (int)key state: (BOOL)state repeat: (BOOL)repeat;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -81,6 +80,22 @@
|
|||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
[self setShortcutHandler:nil];
|
[self setShortcutHandler:nil];
|
||||||
[self setApplicationHandler:nil];
|
[self setApplicationHandler:nil];
|
||||||
|
|
||||||
|
NSAppleEventManager *em = [NSAppleEventManager sharedAppleEventManager];
|
||||||
|
[em
|
||||||
|
setEventHandler:self
|
||||||
|
andSelector:@selector(getUrl:withReplyEvent:)
|
||||||
|
forEventClass:kInternetEventClass
|
||||||
|
andEventID:kAEGetURL];
|
||||||
|
[em
|
||||||
|
setEventHandler:self
|
||||||
|
andSelector:@selector(getUrl:withReplyEvent:)
|
||||||
|
forEventClass:'WWW!'
|
||||||
|
andEventID:'OURL'];
|
||||||
|
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
|
||||||
|
OSStatus httpResult = LSSetDefaultHandlerForURLScheme((CFStringRef)@"tomahawk", (CFStringRef)bundleID);
|
||||||
|
|
||||||
|
//TODO: Check httpResult and httpsResult for errors
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user