Remove conditional code for Leopard.
This commit is contained in:
parent
b6276d53cf
commit
6dbd0baafc
|
@ -90,17 +90,7 @@ if (APPLE)
|
||||||
|
|
||||||
add_subdirectory(3rdparty/SPMediaKeyTap)
|
add_subdirectory(3rdparty/SPMediaKeyTap)
|
||||||
set(SPMEDIAKEYTAP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/SPMediaKeyTap)
|
set(SPMEDIAKEYTAP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/SPMediaKeyTap)
|
||||||
set(SPMEDIAKEYTAP_LIBRARIES SPMediaKeyTap)
|
set(SPMEDIAKEYTAP_LIBRARIES SPMediaKeyTap)
|
||||||
|
|
||||||
# Uses Darwin kernel version.
|
|
||||||
# 9.8.0 -> 10.5/Leopard
|
|
||||||
# 10.4.0 -> 10.6/Snow Leopard
|
|
||||||
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${CMAKE_HOST_SYSTEM_VERSION})
|
|
||||||
if (DARWIN_VERSION GREATER 9)
|
|
||||||
SET(SNOW_LEOPARD 1)
|
|
||||||
elseif (DARWIN_VERSION GREATER 8)
|
|
||||||
SET(LEOPARD 1)
|
|
||||||
endif (DARWIN_VERSION GREATER 9)
|
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
|
|
@ -43,8 +43,6 @@
|
||||||
#cmakedefine HAVE_STATIC_SQLITE
|
#cmakedefine HAVE_STATIC_SQLITE
|
||||||
#cmakedefine HAVE_WIIMOTEDEV
|
#cmakedefine HAVE_WIIMOTEDEV
|
||||||
#cmakedefine IMOBILEDEVICE_USES_UDIDS
|
#cmakedefine IMOBILEDEVICE_USES_UDIDS
|
||||||
#cmakedefine LEOPARD
|
|
||||||
#cmakedefine SNOW_LEOPARD
|
|
||||||
#cmakedefine USE_INSTALL_PREFIX
|
#cmakedefine USE_INSTALL_PREFIX
|
||||||
#cmakedefine USE_SYSTEM_PROJECTM
|
#cmakedefine USE_SYSTEM_PROJECTM
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ class MacGlobalShortcutBackendPrivate : boost::noncopyable {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Register() {
|
bool Register() {
|
||||||
#ifdef SNOW_LEOPARD
|
|
||||||
global_monitor_ = [NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask
|
global_monitor_ = [NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask
|
||||||
handler:^(NSEvent* event) {
|
handler:^(NSEvent* event) {
|
||||||
HandleKeyEvent(event);
|
HandleKeyEvent(event);
|
||||||
|
@ -55,16 +54,11 @@ class MacGlobalShortcutBackendPrivate : boost::noncopyable {
|
||||||
return HandleKeyEvent(event) ? nil : event;
|
return HandleKeyEvent(event) ? nil : event;
|
||||||
}];
|
}];
|
||||||
return true;
|
return true;
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unregister() {
|
void Unregister() {
|
||||||
#ifdef SNOW_LEOPARD
|
|
||||||
[NSEvent removeMonitor:global_monitor_];
|
[NSEvent removeMonitor:global_monitor_];
|
||||||
[NSEvent removeMonitor:local_monitor_];
|
[NSEvent removeMonitor:local_monitor_];
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -133,15 +127,10 @@ bool MacGlobalShortcutBackend::KeyPressed(const QKeySequence& sequence) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacGlobalShortcutBackend::IsAccessibilityEnabled() const {
|
bool MacGlobalShortcutBackend::IsAccessibilityEnabled() const {
|
||||||
#ifdef SNOW_LEOPARD
|
|
||||||
return AXAPIEnabled();
|
return AXAPIEnabled();
|
||||||
#else
|
|
||||||
return true; // It's not really enabled but it doesn't matter.
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacGlobalShortcutBackend::ShowAccessibilityDialog() {
|
void MacGlobalShortcutBackend::ShowAccessibilityDialog() {
|
||||||
#ifdef SNOW_LEOPARD
|
|
||||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(
|
NSArray* paths = NSSearchPathForDirectoriesInDomains(
|
||||||
NSPreferencePanesDirectory, NSSystemDomainMask, YES);
|
NSPreferencePanesDirectory, NSSystemDomainMask, YES);
|
||||||
if ([paths count] == 1) {
|
if ([paths count] == 1) {
|
||||||
|
@ -149,5 +138,4 @@ void MacGlobalShortcutBackend::ShowAccessibilityDialog() {
|
||||||
[[paths objectAtIndex:0] stringByAppendingPathComponent:@"UniversalAccessPref.prefPane"]];
|
[[paths objectAtIndex:0] stringByAppendingPathComponent:@"UniversalAccessPref.prefPane"]];
|
||||||
[[NSWorkspace sharedWorkspace] openURL:prefpane_url];
|
[[NSWorkspace sharedWorkspace] openURL:prefpane_url];
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue