Commit 359bf62f authored by Marvin Scholz's avatar Marvin Scholz

osx_notifications: Do not check if NSUserNotification is available

Targeting 10.10, it will always be available, so this check is not
useful anymore.
parent 04edeb6b
...@@ -87,7 +87,6 @@ ...@@ -87,7 +87,6 @@
NSMutableDictionary *registrationDictionary; NSMutableDictionary *registrationDictionary;
id lastNotification; id lastNotification;
bool isInForeground; bool isInForeground;
bool hasNativeNotifications;
intf_thread_t *interfaceThread; intf_thread_t *interfaceThread;
} }
...@@ -256,11 +255,6 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -256,11 +255,6 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
// Start in background // Start in background
isInForeground = NO; isInForeground = NO;
// Check for native notification support
Class userNotificationClass = NSClassFromString(@"NSUserNotification");
Class userNotificationCenterClass = NSClassFromString(@"NSUserNotificationCenter");
hasNativeNotifications = (userNotificationClass && userNotificationCenterClass) ? YES : NO;
lastNotification = nil; lastNotification = nil;
applicationName = nil; applicationName = nil;
notificationType = nil; notificationType = nil;
...@@ -274,7 +268,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -274,7 +268,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
{ {
// Clear the remaining lastNotification in Notification Center, if any // Clear the remaining lastNotification in Notification Center, if any
@autoreleasepool { @autoreleasepool {
if (lastNotification && hasNativeNotifications) { if (lastNotification) {
[NSUserNotificationCenter.defaultUserNotificationCenter [NSUserNotificationCenter.defaultUserNotificationCenter
removeDeliveredNotification:(NSUserNotification *)lastNotification]; removeDeliveredNotification:(NSUserNotification *)lastNotification];
[lastNotification release]; [lastNotification release];
...@@ -304,10 +298,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -304,10 +298,8 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[GrowlApplicationBridge setGrowlDelegate:self]; [GrowlApplicationBridge setGrowlDelegate:self];
if (hasNativeNotifications) { [[NSUserNotificationCenter defaultUserNotificationCenter]
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:(id<NSUserNotificationCenterDelegate>)self];
setDelegate:(id<NSUserNotificationCenterDelegate>)self];
}
} }
} }
...@@ -370,7 +362,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var, ...@@ -370,7 +362,7 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
isSticky:NO isSticky:NO
clickContext:nil clickContext:nil
identifier:@"VLCNowPlayingNotification"]; identifier:@"VLCNowPlayingNotification"];
} else if (hasNativeNotifications) { } else {
// Make the OS X notification and string // Make the OS X notification and string
NSUserNotification *notification = [NSUserNotification new]; NSUserNotification *notification = [NSUserNotification new];
NSString *desc = nil; NSString *desc = nil;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment