Remove conditional code for Leopard.

This commit is contained in:
John Maguire 2012-09-25 18:53:53 +02:00
parent b6276d53cf
commit 6dbd0baafc
3 changed files with 1 additions and 25 deletions

View File

@ -90,17 +90,7 @@ if (APPLE)
add_subdirectory(3rdparty/SPMediaKeyTap)
set(SPMEDIAKEYTAP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/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)
set(SPMEDIAKEYTAP_LIBRARIES SPMediaKeyTap)
endif (APPLE)
find_package(Threads)

View File

@ -43,8 +43,6 @@
#cmakedefine HAVE_STATIC_SQLITE
#cmakedefine HAVE_WIIMOTEDEV
#cmakedefine IMOBILEDEVICE_USES_UDIDS
#cmakedefine LEOPARD
#cmakedefine SNOW_LEOPARD
#cmakedefine USE_INSTALL_PREFIX
#cmakedefine USE_SYSTEM_PROJECTM

View File

@ -44,7 +44,6 @@ class MacGlobalShortcutBackendPrivate : boost::noncopyable {
}
bool Register() {
#ifdef SNOW_LEOPARD
global_monitor_ = [NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask
handler:^(NSEvent* event) {
HandleKeyEvent(event);
@ -55,16 +54,11 @@ class MacGlobalShortcutBackendPrivate : boost::noncopyable {
return HandleKeyEvent(event) ? nil : event;
}];
return true;
#else
return false;
#endif
}
void Unregister() {
#ifdef SNOW_LEOPARD
[NSEvent removeMonitor:global_monitor_];
[NSEvent removeMonitor:local_monitor_];
#endif
}
private:
@ -133,15 +127,10 @@ bool 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) {
@ -149,5 +138,4 @@ void MacGlobalShortcutBackend::ShowAccessibilityDialog() {
[[paths objectAtIndex:0] stringByAppendingPathComponent:@"UniversalAccessPref.prefPane"]];
[[NSWorkspace sharedWorkspace] openURL:prefpane_url];
}
#endif
}