BathyScapheのリンクをクリックした時に開くアプリケーションを設定するためのツール
Revision | 8af241ae16419a9cc087edf1685151c77dc6f159 (tree) |
---|---|
Zeit | 2010-09-14 00:14:37 |
Autor | masakih <masakih@user...> |
Commiter | masakih |
[Mod] 不要なコードを削除。
git-svn-id: svn+ssh://macmini/usr/local/svnrepos/BSLinkConductor/BSLinkConductor@23 061f2d1e-a732-4c5b-b008-8f2f835f3f04
@@ -16,12 +16,12 @@ | ||
16 | 16 | |
17 | 17 | static NSString *const BSLCPreferencesSeparetorItem = @"-- BSLCPreferences Separetor Item --"; |
18 | 18 | |
19 | -@implementation BSLCPreferences (MethodExchange) | |
20 | -- (BOOL)isSeparatorItemCustom | |
19 | +@implementation NSMenuItem (BSLCMethodExchange) | |
20 | +- (BOOL)isSeparatorItemBSLCCustom | |
21 | 21 | { |
22 | 22 | if([BSLCPreferencesSeparetorItem isEqualToString:[self title]]) return YES; |
23 | 23 | |
24 | - return [self isSeparatorItemCustom]; | |
24 | + return [self isSeparatorItemBSLCCustom]; | |
25 | 25 | } |
26 | 26 | @end |
27 | 27 |
@@ -34,26 +34,13 @@ static BSLCPreferences *instance = nil; | ||
34 | 34 | |
35 | 35 | static NSString *const BSLCPRowIndexType = @"BSLCPRowIndexType"; |
36 | 36 | |
37 | -static BOOL (*orignalIMP)(id , SEL) ; | |
38 | - | |
39 | -BOOL bslcIsSeparatorItem(id self, SEL _cmd) | |
40 | -{ | |
41 | - if([BSLCPreferencesSeparetorItem isEqualToString:[self title]]) return YES; | |
42 | - | |
43 | - return orignalIMP(self, _cmd); | |
44 | -} | |
45 | 37 | static void bslcSwapMethod() |
46 | 38 | { |
47 | 39 | Method method; |
48 | 40 | |
49 | 41 | method = class_getInstanceMethod([NSMenuItem class], @selector(isSeparatorItem)); |
50 | - orignalIMP = (BOOL (*)(id,SEL))class_getMethodImplementation([NSMenuItem class], @selector(isSeparatorItem)); | |
51 | 42 | if(method) { |
52 | -// orignalIMP = (BOOL (*)(id,SEL))method->method_imp; | |
53 | -// method->method_imp = (IMP)bslcIsSeparatorItem; | |
54 | -// NSLog(@"Swaped"); | |
55 | - | |
56 | - Method newMethod = class_getInstanceMethod([BSLCPreferences class], @selector(isSeparatorItemCustom)); | |
43 | + Method newMethod = class_getInstanceMethod([NSMenuItem class], @selector(isSeparatorItemBSLCCustom)); | |
57 | 44 | method_exchangeImplementations(method, newMethod); |
58 | 45 | } |
59 | 46 | } |