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

Add a 'resolvesProxy' bool for actions that shouldn't resolve proxies. Fixes #1342 #1343

Merged
merged 1 commit into from
Jan 23, 2013
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions Quicksilver/Code-External/DisableSubviews
Submodule DisableSubviews added at f569e6
6 changes: 6 additions & 0 deletions Quicksilver/Code-QuickStepCore/QSAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
- (BOOL)canThread;
- (BOOL)indirectOptional;
- (void)setIndirectOptional:(BOOL)flag;

// resolveProxy is a BOOL set in an action's dict to specify whether an object should be resolved
// before being sent to an action. Action's like 'assign abbreviation...' should not resolve the proxy
- (BOOL)resolvesProxy;
- (void)setResolvesProxy:(BOOL)flag;

- (BOOL)displaysResult;
- (void)setDisplaysResult:(BOOL)flag;

Expand Down
15 changes: 14 additions & 1 deletion Quicksilver/Code-QuickStepCore/QSAction.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,17 @@ - (void)setIndirectOptional:(BOOL)flag {
[[self actionDict] setObject:[NSNumber numberWithInteger:flag] forKey:kActionIndirectOptional];
}

- (BOOL)resolvesProxy {
if ([[self actionDict] objectForKey:kActionResolvesProxy] == nil) {
return YES;
}
return [[[self actionDict] objectForKey:kActionResolvesProxy] boolValue];
}

- (void)setResolvesProxy:(BOOL)flag {
[[self actionDict] setObject:[NSNumber numberWithInteger:flag] forKey:kActionResolvesProxy];
}

- (BOOL)displaysResult {
return [[[self actionDict] objectForKey:kActionDisplaysResult] boolValue];
}
Expand Down Expand Up @@ -310,7 +321,9 @@ - (QSObject *)performOnDirectObject:(QSObject *)dObject indirectObject:(QSObject
if (!provider) {
provider = [QSReg getClassInstance:class];
}
dObject = [dObject resolvedObject];
if ([self resolvesProxy]) {
dObject = [dObject resolvedObject];
}
if ([[dict objectForKey:kActionSplitPluralArguments] boolValue] && [dObject count] > 1) {
NSArray *objects = [dObject splitObjects];
id object;
Expand Down
1 change: 1 addition & 0 deletions Quicksilver/Code-QuickStepCore/QSDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#define kActionValidatesObjects @"validatesObjects"
#define kActionInitialize @"initialize"
#define kActionEnabled @"enabled"
#define kActionResolvesProxy @"resolvesProxy"

// NSNumber (float) :
#define kActionPrecedence @"precedence"
4 changes: 4 additions & 0 deletions Quicksilver/PlugIns-Main/QSCorePlugIn/QSCorePlugIn-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,8 @@
<string>QSObjectActions</string>
<key>precedence</key>
<integer>0</integer>
<key>resolvesProxy</key>
<false/>
<key>actionSelector</key>
<string>findObjectInCatalog:</string>
<key>validatesObjects</key>
Expand All @@ -1459,6 +1461,8 @@
</array>
<key>precedence</key>
<real>-0.2</real>
<key>resolvesProxy</key>
<false/>
<key>indirectTypes</key>
<array>
<string>NSStringPboardType</string>
Expand Down