Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

resolve direct object before using it to determine indirects

So individual action providers don't need to test for and resolve proxy objects.

fixes #1243
  • Loading branch information...
commit c2ae2b2e76a5681889117e2b2b27997ebce94f76 1 parent 4bd19fa
@skurfer authored
View
3  Quicksilver/Code-QuickStepCore/QSCommand.m
@@ -475,7 +475,8 @@ - (void)executeWithIndirect:(id)indirectObject {
}
- (NSArray *)validIndirects {
- NSArray *indirects = [[[self aObject] provider] validIndirectObjectsForAction:[[self aObject] identifier] directObject:[self dObject]];
+ QSObject *directObject = [[[self dObject] primaryType] isEqualToString:QSProxyType] ? (QSObject *)[[self dObject] resolvedObject] : [self dObject];
+ NSArray *indirects = [[[self aObject] provider] validIndirectObjectsForAction:[[self aObject] identifier] directObject:directObject];
if ([indirects count] >1 && [[indirects objectAtIndex:1] isKindOfClass:[NSArray class]]) indirects = [indirects objectAtIndex:1];
if ([indirects count] == 1 && [[indirects objectAtIndex:0] containsType:QSTextProxyType]) {
indirects = nil;
View
3  Quicksilver/Code-QuickStepCore/QSExecutor.m
@@ -393,7 +393,8 @@ - (NSArray *)validActionsForDirectObject:(QSObject *)dObject indirectObject:(QSO
- (NSArray *)validIndirectObjectsForAction:(NSString *)action directObject:(QSObject *)dObject {
QSActionProvider *actionObject = [[actionIdentifiers objectForKey:action] objectForKey:kActionClass];
// NSLog(@"actionobject %@", actionObject);
- return [actionObject validIndirectObjectsForAction:action directObject:dObject];
+ QSObject *directObject = [[dObject primaryType] isEqualToString:QSProxyType] ? (QSObject *)[dObject resolvedObject] : dObject;
+ return [actionObject validIndirectObjectsForAction:action directObject:directObject];
}
- (BOOL)actionIsEnabled:(QSAction*)action {
View
3  Quicksilver/Code-QuickStepInterface/QSInterfaceController.m
@@ -349,7 +349,8 @@ - (void)updateIndirectObjects {
id actionProvider = [aObj provider];
NSArray *indirects = nil;
if (actionProvider && [actionProvider respondsToSelector:@selector(validIndirectObjectsForAction:directObject:)]) {
- indirects = [actionProvider validIndirectObjectsForAction:[aObj identifier] directObject:[dSelector objectValue]];
+ QSObject *directObject = [[[dSelector objectValue] primaryType] isEqualToString:QSProxyType] ? (QSObject *)[[dSelector objectValue] resolvedObject] : [dSelector objectValue];
+ indirects = [actionProvider validIndirectObjectsForAction:[aObj identifier] directObject:directObject];
}
// If the validIndirectObjectsForAction... method hasn't been implemented, attempt to get valid indirects from the action's 'indirectTypes'
if(!indirects) {
Please sign in to comment.
Something went wrong with that request. Please try again.