1
mirror of https://code.videolan.org/videolan/vlc synced 2024-07-21 07:24:15 +02:00

osx_notifications: Remove availability and SDK checks

Targeting 10.10, NSUserNotificationCenter will always be available so
there is no need to guard these calls.
This commit is contained in:
Marvin Scholz 2018-02-14 22:11:59 +01:00
parent 1fe5c1e3b1
commit 04edeb6ba8

View File

@ -60,8 +60,6 @@
* Preamble * Preamble
*****************************************************************************/ *****************************************************************************/
#pragma clang diagnostic ignored "-Wunguarded-availability"
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
@ -274,9 +272,6 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
- (void)dealloc - (void)dealloc
{ {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
// 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 && hasNativeNotifications) {
@ -286,8 +281,6 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
} }
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
} }
#endif
#pragma clang diagnostic pop
// Release everything // Release everything
[applicationName release]; [applicationName release];
@ -311,15 +304,10 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[GrowlApplicationBridge setGrowlDelegate:self]; [GrowlApplicationBridge setGrowlDelegate:self];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
if (hasNativeNotifications) { if (hasNativeNotifications) {
[[NSUserNotificationCenter defaultUserNotificationCenter] [[NSUserNotificationCenter defaultUserNotificationCenter]
setDelegate:(id<NSUserNotificationCenterDelegate>)self]; setDelegate:(id<NSUserNotificationCenterDelegate>)self];
} }
#endif
#pragma clang diagnostic pop
} }
} }
@ -383,9 +371,6 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
clickContext:nil clickContext:nil
identifier:@"VLCNowPlayingNotification"]; identifier:@"VLCNowPlayingNotification"];
} else if (hasNativeNotifications) { } else if (hasNativeNotifications) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
// 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;
@ -407,8 +392,6 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[notification setValue:@(YES) forKey:@"_showsButtons"]; [notification setValue:@(YES) forKey:@"_showsButtons"];
[NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification]; [NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];
[notification release]; [notification release];
#endif
#pragma clang diagnostic pop
} }
// Release stuff // Release stuff
@ -436,9 +419,6 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
isInForeground = NO; isInForeground = NO;
} }
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
- (void)userNotificationCenter:(NSUserNotificationCenter *)center - (void)userNotificationCenter:(NSUserNotificationCenter *)center
didActivateNotification:(NSUserNotification *)notification didActivateNotification:(NSUserNotification *)notification
{ {
@ -459,6 +439,4 @@ static int InputCurrent( vlc_object_t *p_this, const char *psz_var,
[notification retain]; [notification retain];
lastNotification = notification; lastNotification = notification;
} }
#endif
#pragma clang diagnostic pop
@end @end