Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indirect file types & various #1120

Merged
merged 3 commits into from
Sep 26, 2012
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Quicksilver/Code-QuickStepInterface/QSDockingWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ - (IBAction)hide:(id)sender {
hidden = YES;
if ([self isVisible]) {
// hide on mouse out
[[self helper] _resizeWindow:self toFrame:hideRect alpha:0.1 display:YES];
[[self helper] _resizeWindow:self toFrame:hideRect alpha:0 display:YES];
[self saveFrame];
} else {
// hide on application launch
[self setFrame:hideRect display:YES];
[self setAlphaValue:0.1];
[self setAlphaValue:0];
}
[self setHasShadow:NO];
}
Expand Down
20 changes: 19 additions & 1 deletion Quicksilver/Code-QuickStepInterface/QSInterfaceController.m
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,25 @@ - (void)updateActionsNow {
}

- (void)updateIndirectObjects {
NSArray *indirects = [[[aSelector objectValue] provider] validIndirectObjectsForAction:[[aSelector objectValue] identifier] directObject:[dSelector objectValue]];
QSAction *aObj = [aSelector objectValue];
id actionProvider = [aObj provider];
NSArray *indirects = nil;
if (actionProvider && [actionProvider respondsToSelector:@selector(validIndirectObjectsForAction:directObject:)]) {
indirects = [actionProvider validIndirectObjectsForAction:[aObj identifier] directObject:[dSelector objectValue]];
}
// If the validIndirectObjectsForAction... method hasn't been implemented, attempt to get valid indirects from the action's 'indirectTypes'
if(!indirects) {
if ([aObj indirectTypes]) {
NSMutableArray *indirectsForAllTypes = [[NSMutableArray alloc] initWithCapacity:0];
for (NSString *eachType in [aObj indirectTypes]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worth using enumerateKeysAndObjectsWithOptions:NSEnumerationConcurrent usingBlock: on this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you propose that work?
I didn't know the method (until you just mentioned it) but it takes an NSDict, which we don't have here?
Do you mean - (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block

Using NSEnumerationConcurrent may well be faster there. We should probably use it everywhere tbh!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's what I meant. Sorry, I was looking at a dictionary example.

I don't know how much of a difference it would make, but in theory, it might help when there are several types to process.

[indirectsForAllTypes addObjectsFromArray:[QSLib arrayForType:eachType]];
}
if ([indirectsForAllTypes count]) {
indirects = [[indirectsForAllTypes copy] autorelease];
}
[indirectsForAllTypes release];
}
}
[self updateControl:iSelector withArray:indirects];
[iSelector setSearchMode:(indirects?SearchFilter:SearchFilterAll)];
}
Expand Down