progress on searching auto type candidates

This commit is contained in:
michael starke
2013-11-25 02:39:22 +01:00
parent 4173141108
commit 839c87102c
11 changed files with 317 additions and 187 deletions

View File

@@ -15,10 +15,17 @@
@implementation MPDocument (Autotype)
- (NSArray *)findEntriesForWindowTitle:(NSString *)windowTitle {
NSArray *autotypeEntries = [self.root autotypeableChildEntries];
NSMutableArray *matchingEntries = [[NSMutableArray alloc] initWithCapacity:ceil([autotypeEntries count] / 4.0)];
for(KPKEntry *entry in autotypeEntries) {
//KPKAutotype *autotype = entry.autotype;
/* Test for title */
NSRange titleRange = [entry.title rangeOfString:windowTitle options:NSCaseInsensitiveSearch];
if(titleRange.location != NSNotFound) {
[matchingEntries addObject:entry];
}
/* search in Autotype entries for match */
else {
}
}
return nil;
}