mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 11:35:24 +01:00
Leopard compile fixes
This commit is contained in:
parent
339b581040
commit
256b507cae
@ -12,6 +12,7 @@
|
||||
|
||||
#import <Kernel/AvailabilityMacros.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "globalshortcuts.h"
|
||||
#include "mac_startup.h"
|
||||
#include "macglobalshortcutbackend.h"
|
||||
@ -38,7 +39,7 @@
|
||||
- (void) mediaKeyEvent: (int)key state: (BOOL)state repeat: (BOOL)repeat;
|
||||
@end
|
||||
|
||||
#ifdef MAC_OS_X_VERSION_10_6
|
||||
#ifdef SNOW_LEOPARD
|
||||
@interface AppDelegate :NSObject <NSApplicationDelegate> {
|
||||
#else
|
||||
@interface AppDelegate :NSObject {
|
||||
|
@ -41,7 +41,7 @@ class MacGlobalShortcutBackendPrivate : boost::noncopyable {
|
||||
}
|
||||
|
||||
bool Register() {
|
||||
#ifdef NS_BLOCKS_AVAILABLE
|
||||
#ifdef SNOW_LEOPARD
|
||||
global_monitor_ = [NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask
|
||||
handler:^(NSEvent* event) {
|
||||
HandleKeyEvent(event);
|
||||
@ -58,8 +58,10 @@ class MacGlobalShortcutBackendPrivate : boost::noncopyable {
|
||||
}
|
||||
|
||||
void Unregister() {
|
||||
#ifdef SNOW_LEOPARD
|
||||
[NSEvent removeMonitor:global_monitor_];
|
||||
[NSEvent removeMonitor:local_monitor_];
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
@ -222,10 +224,15 @@ void MacGlobalShortcutBackend::KeyPressed(const QKeySequence& sequence) {
|
||||
}
|
||||
|
||||
bool MacGlobalShortcutBackend::IsAccessibilityEnabled() const {
|
||||
#ifdef SNOW_LEOPARD
|
||||
return AXAPIEnabled();
|
||||
#else
|
||||
return true; // It's not really enabled but it doesn't matter.
|
||||
#endif
|
||||
}
|
||||
|
||||
void MacGlobalShortcutBackend::ShowAccessibilityDialog() {
|
||||
#ifdef SNOW_LEOPARD
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(
|
||||
NSPreferencePanesDirectory, NSSystemDomainMask, YES);
|
||||
if ([paths count] == 1) {
|
||||
@ -233,4 +240,5 @@ void MacGlobalShortcutBackend::ShowAccessibilityDialog() {
|
||||
[[paths objectAtIndex:0] stringByAppendingPathComponent:@"UniversalAccessPref.prefPane"]];
|
||||
[[NSWorkspace sharedWorkspace] openURL:prefpane_url];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user