BathyScaphe用次スレ候補検索プラグイン
Revision | 49461f3719f87af0341e6f5f09df639ee9f57f10 (tree) |
---|---|
Time | 2011-12-03 17:16:33 |
Author | masakih <masakih@user...> |
Commiter | masakih |
Treat source code.
不要なコメントアウトを削除。
@@ -52,10 +52,10 @@ const NSInteger kScriptMenuTag = 8; | ||
52 | 52 | nil, |
53 | 53 | [NSBundle bundleForClass:[self class]], |
54 | 54 | @"Menu title"); |
55 | - | |
55 | + | |
56 | 56 | serachMenuItem = [[[NSMenuItem alloc] initWithTitle:itemTitle |
57 | - action:@selector(findNextThread:) | |
58 | - keyEquivalent:@""] autorelease]; | |
57 | + action:@selector(findNextThread:) | |
58 | + keyEquivalent:@""] autorelease]; | |
59 | 59 | |
60 | 60 | mainMenu = [NSApp mainMenu]; |
61 | 61 | scriptMenuIndex = [mainMenu indexOfItemWithTag:kScriptMenuTag]; |
@@ -108,7 +108,6 @@ const NSInteger kScriptMenuTag = 8; | ||
108 | 108 | CFRange range = CFStringTokenizerGetCurrentTokenRange(tokenizer); |
109 | 109 | if(range.location != kCFNotFound) { |
110 | 110 | NSString *token = [title substringWithRange:NSMakeRange(range.location, range.length)]; |
111 | -// fprintf(stderr, "\t%s\n", [token UTF8String]); | |
112 | 111 | [tokens addObject:token]; |
113 | 112 | } |
114 | 113 | } |
@@ -117,7 +116,6 @@ const NSInteger kScriptMenuTag = 8; | ||
117 | 116 | CFRelease(locale); |
118 | 117 | |
119 | 118 | return tokens; |
120 | - | |
121 | 119 | } |
122 | 120 | |
123 | 121 | - (NSString *)searchStringWithTitle:(NSString *)title |
@@ -136,29 +134,13 @@ const NSInteger kScriptMenuTag = 8; | ||
136 | 134 | } |
137 | 135 | - (IBAction)findNextThread:(id)sender |
138 | 136 | { |
139 | -// NSWindow *mainWindow = [NSApp mainWindow]; | |
140 | -// Class browserClass = NSClassFromString(@"CMRBrowser"); | |
141 | -// Class threadViewerClass = NSClassFromString(@"CMRThreadViewer"); | |
142 | -// Class threadDocumentClass = NSClassFromString(@"CMRThreadDocument"); | |
143 | -// Class browserDocClass = NSClassFromString(@"Browser"); | |
144 | - | |
145 | -// NSLog(@"main Window is %@", [mainWindow windowController]); | |
146 | - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; | |
147 | -// NSLog(@"current Document is %@ <%@>", [dc currentDocument], [[dc currentDocument] displayName]); | |
148 | - | |
149 | -// NSLog(@"obj responds threadAttributes --- %@", [[dc currentDocument] respondsToSelector:@selector(threadAttributes)] ? @"YES" : @"NO"); | |
150 | -// NSLog(@"Thread title --- %@", [[[dc currentDocument] threadAttributes] threadTitle]); | |
151 | - | |
152 | - | |
153 | 137 | id cmrBrowser = [self findCMRBrowser]; |
154 | 138 | id browser = [cmrBrowser document]; |
155 | -// NSLog(@"Browser is %@", browser); | |
156 | - id threadAttributes = [[dc currentDocument] threadAttributes]; | |
139 | + id threadAttributes = [[[NSDocumentController sharedDocumentController] currentDocument] threadAttributes]; | |
157 | 140 | [cmrBrowser showThreadsListWithBoardName:[threadAttributes boardName]]; |
158 | 141 | [cmrBrowser selectRowOfName:[threadAttributes boardName] forceReload:NO]; |
159 | 142 | [browser setSearchString:[self searchStringWithTitle:[threadAttributes threadTitle]]]; |
160 | 143 | [cmrBrowser synchronizeWithSearchField]; |
161 | 144 | [cmrBrowser showWindow:nil]; |
162 | - | |
163 | 145 | } |
164 | 146 | @end |