mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Platform: Remove compatibility checks for macOS 10.8
This commit is contained in:
parent
4576a75388
commit
da8c5fdcb4
3 changed files with 13 additions and 46 deletions
|
|
@ -297,33 +297,10 @@ bool File::moveToTrash() const
|
|||
|
||||
JUCE_AUTORELEASEPOOL
|
||||
{
|
||||
if (@available (macOS 10.8, iOS 11.0, *))
|
||||
{
|
||||
NSError* error = nil;
|
||||
return [[NSFileManager defaultManager] trashItemAtURL: createNSURLFromFile (*this)
|
||||
resultingItemURL: nil
|
||||
error: &error];
|
||||
}
|
||||
|
||||
#if JUCE_IOS
|
||||
return deleteFile();
|
||||
#else
|
||||
[[NSWorkspace sharedWorkspace] recycleURLs: [NSArray arrayWithObject: createNSURLFromFile (*this)]
|
||||
completionHandler: nil];
|
||||
|
||||
// recycleURLs is async, so we need to block until it has finished. We can't use a
|
||||
// run-loop here because it'd dispatch unexpected messages, so have to do this very
|
||||
// nasty bodge. But this is only needed for support of pre-10.8 versions.
|
||||
for (int retries = 100; --retries >= 0;)
|
||||
{
|
||||
if (! exists())
|
||||
return true;
|
||||
|
||||
Thread::sleep (5);
|
||||
}
|
||||
|
||||
return false;
|
||||
#endif
|
||||
NSError* error = nil;
|
||||
return [[NSFileManager defaultManager] trashItemAtURL: createNSURLFromFile (*this)
|
||||
resultingItemURL: nil
|
||||
error: &error];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -534,9 +511,8 @@ void File::addToDock() const
|
|||
|
||||
File File::getContainerForSecurityApplicationGroupIdentifier (const String& appGroup)
|
||||
{
|
||||
if (@available (macOS 10.8, *))
|
||||
if (auto* url = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier: juceStringToNS (appGroup)])
|
||||
return File (nsStringToJuce ([url path]));
|
||||
if (auto* url = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier: juceStringToNS (appGroup)])
|
||||
return File (nsStringToJuce ([url path]));
|
||||
|
||||
return File();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,12 +220,9 @@ public:
|
|||
|
||||
if ((windowStyleFlags & ComponentPeer::windowRequiresSynchronousCoreGraphicsRendering) == 0)
|
||||
{
|
||||
if (@available (macOS 10.8, *))
|
||||
{
|
||||
[view setWantsLayer: YES];
|
||||
[view setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize];
|
||||
[view layer].drawsAsynchronously = YES;
|
||||
}
|
||||
[view setWantsLayer: YES];
|
||||
[view setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize];
|
||||
[view layer].drawsAsynchronously = YES;
|
||||
}
|
||||
|
||||
#if JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS
|
||||
|
|
|
|||
|
|
@ -371,11 +371,8 @@ struct PushNotifications::Pimpl : private PushNotificationsDelegate
|
|||
|
||||
NSRemoteNotificationType types = NSUInteger ((bool) settings.allowBadge);
|
||||
|
||||
if (@available (macOS 10.8, *))
|
||||
{
|
||||
types |= (NSUInteger) ((settings.allowSound ? NSRemoteNotificationTypeSound : 0)
|
||||
| (settings.allowAlert ? NSRemoteNotificationTypeAlert : 0));
|
||||
}
|
||||
types |= (NSUInteger) ((settings.allowSound ? NSRemoteNotificationTypeSound : 0)
|
||||
| (settings.allowAlert ? NSRemoteNotificationTypeAlert : 0));
|
||||
|
||||
[[NSApplication sharedApplication] registerForRemoteNotificationTypes: types];
|
||||
}
|
||||
|
|
@ -384,11 +381,8 @@ struct PushNotifications::Pimpl : private PushNotificationsDelegate
|
|||
{
|
||||
settings.allowBadge = [NSApplication sharedApplication].enabledRemoteNotificationTypes & NSRemoteNotificationTypeBadge;
|
||||
|
||||
if (@available (macOS 10.8, *))
|
||||
{
|
||||
settings.allowSound = [NSApplication sharedApplication].enabledRemoteNotificationTypes & NSRemoteNotificationTypeSound;
|
||||
settings.allowAlert = [NSApplication sharedApplication].enabledRemoteNotificationTypes & NSRemoteNotificationTypeAlert;
|
||||
}
|
||||
settings.allowSound = [NSApplication sharedApplication].enabledRemoteNotificationTypes & NSRemoteNotificationTypeSound;
|
||||
settings.allowAlert = [NSApplication sharedApplication].enabledRemoteNotificationTypes & NSRemoteNotificationTypeAlert;
|
||||
|
||||
owner.listeners.call ([&] (Listener& l) { l.notificationSettingsReceived (settings); });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue