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

Another go at ensuring search string is cleared when closing interface #2304

Merged
merged 2 commits into from Jan 9, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 16 additions & 9 deletions Quicksilver/Code-QuickStepInterface/QSInterfaceController.m
Expand Up @@ -618,9 +618,7 @@ - (void)executeCommand:(id)sender cont:(BOOL)cont encapsulate:(BOOL)encapsulate
NSBeep();
return;
}

// add the object being executed to the history
[dSelector updateHistory];

QSAction *action = [aSelector objectValue];
NSInteger argumentCount = [action argumentCount];
if (argumentCount == 2) {
Expand All @@ -634,10 +632,25 @@ - (void)executeCommand:(id)sender cont:(BOOL)cont encapsulate:(BOOL)encapsulate
}
[QSExec noteIndirect:[iSelector objectValue] forAction:action];
}

// add the object being executed to the history
[dSelector updateHistory];
// make sure to save mnemonics before interface is closed. Closing the interface clears the search string so they must be saved before this
[QSHist addCommand:[self currentCommand]];
[dSelector saveMnemonic];
[aSelector saveMnemonic];
if (argumentCount == 2) {
[iSelector saveMnemonic];
}

if (encapsulate) {
[self encapsulateCommand];
return;
}
if (!cont) {
// this ensures the interface is hidden before an action is run e.g. the 'capture screen region' and 'type text' actions needs this
[self hideMainWindowFromExecution:self]; // *** this should only hide if no result comes in like 2 seconds
}
Copy link
Member

Choose a reason for hiding this comment

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

If you restore that one, maybe the if (cont)-else branch below should go ?

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. The last else can go.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh wait yeah, you mean line 660

if ([[NSUserDefaults standardUserDefaults] boolForKey:kExecuteInThread] && [action canThread]) {
QSGCDAsync(^{
[self executeCommandThreaded];
Expand All @@ -647,12 +660,6 @@ - (void)executeCommand:(id)sender cont:(BOOL)cont encapsulate:(BOOL)encapsulate
QSGCDMainSync(^{
[self executeCommandThreaded];
});
}
[QSHist addCommand:[self currentCommand]];
[dSelector saveMnemonic];
[aSelector saveMnemonic];
if (argumentCount == 2) {
[iSelector saveMnemonic];
}
if (cont) {
[[self window] makeFirstResponder:aSelector];
Expand Down