Dont use a block for dictionary enumeration
Maybe that will fix the mysterious issue @page-down is having
This commit is contained in:
parent
34d7643bed
commit
8fe71e3dc8
@ -520,10 +520,10 @@ build_global_shortcuts_lookup(void) {
|
|||||||
NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithCapacity:128]; // will be autoreleased
|
NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithCapacity:128]; // will be autoreleased
|
||||||
NSDictionary *apple_settings = [[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.apple.symbolichotkeys"];
|
NSDictionary *apple_settings = [[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.apple.symbolichotkeys"];
|
||||||
if (apple_settings) {
|
if (apple_settings) {
|
||||||
NSDictionary *symbolic_hotkeys = [apple_settings objectForKey:@"AppleSymbolicHotKeys"];
|
NSDictionary<NSString*, id> *symbolic_hotkeys = [apple_settings objectForKey:@"AppleSymbolicHotKeys"];
|
||||||
if (symbolic_hotkeys) {
|
if (symbolic_hotkeys) {
|
||||||
[symbolic_hotkeys enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
|
for (NSString *key in symbolic_hotkeys) {
|
||||||
(void)stop;
|
id obj = symbolic_hotkeys[key];
|
||||||
if ([key isKindOfClass:[NSString class]] && [obj isKindOfClass:[NSDictionary class]]) {
|
if ([key isKindOfClass:[NSString class]] && [obj isKindOfClass:[NSDictionary class]]) {
|
||||||
NSInteger sc = [(NSString*)key integerValue];
|
NSInteger sc = [(NSString*)key integerValue];
|
||||||
NSDictionary *sc_value = obj;
|
NSDictionary *sc_value = obj;
|
||||||
@ -545,7 +545,7 @@ build_global_shortcuts_lookup(void) {
|
|||||||
} else snprintf(buf, sizeof(buf) - 1, "c:%lx:%ld", (unsigned long)mods, (long)ch);
|
} else snprintf(buf, sizeof(buf) - 1, "c:%lx:%ld", (unsigned long)mods, (long)ch);
|
||||||
temp[@(buf)] = @(sc);
|
temp[@(buf)] = @(sc);
|
||||||
}
|
}
|
||||||
}];
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
global_shortcuts = [[NSDictionary dictionaryWithDictionary:temp] retain];
|
global_shortcuts = [[NSDictionary dictionaryWithDictionary:temp] retain];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user