aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPQueryController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPQueryController.m')
-rw-r--r--Source/SPQueryController.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m
index 9f28c226..ae83a25d 100644
--- a/Source/SPQueryController.m
+++ b/Source/SPQueryController.m
@@ -644,6 +644,32 @@ static SPQueryController *sharedQueryController = nil;
return [NSMutableArray array];
}
+- (NSArray *)historyMenuItemsForFileURL:(NSURL *)fileURL
+{
+ if([historyContainer objectForKey:[fileURL absoluteString]]) {
+ NSMutableArray *returnArray = [[NSMutableArray arrayWithCapacity:[[historyContainer objectForKey:[fileURL absoluteString]] count]] autorelease];
+ NSMenuItem *historyMenuItem;
+ for(id history in [historyContainer objectForKey:[fileURL absoluteString]]) {
+ historyMenuItem = [[[NSMenuItem alloc] initWithTitle:([history length] > 64) ? [NSString stringWithFormat:@"%@…", [history substringToIndex:63]] : history
+ action:NULL
+ keyEquivalent:@""] autorelease];
+ [historyMenuItem setToolTip:([history length] > 256) ? [NSString stringWithFormat:@"%@…", [history substringToIndex:255]] : history];
+ [returnArray addObject:historyMenuItem];
+ }
+
+ return returnArray;
+ }
+
+ return [NSArray array];
+}
+
+- (NSUInteger)numberOfHistoryItemsForFileURL:(NSURL *)fileURL
+{
+ if([historyContainer objectForKey:[fileURL absoluteString]])
+ return [[historyContainer objectForKey:[fileURL absoluteString]] count];
+ else
+ return 0;
+}
- (NSMutableDictionary *)contentFilterForFileURL:(NSURL *)fileURL
{
if([contentFilterContainer objectForKey:[fileURL absoluteString]])