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

Handle the $ variables in Spotlight queries #2141

Merged
merged 2 commits into from Oct 30, 2015
Merged

Handle the $ variables in Spotlight queries #2141

merged 2 commits into from Oct 30, 2015

Conversation

tiennou
Copy link
Member

@tiennou tiennou commented Oct 27, 2015

Fixes #2140

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented Oct 27, 2015

Latest QS is 10.9+ right?
In that case we need to change this line

Don't see anything wrong with this though, as long as it doesn't break existing Spotlight Query stuff

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented Oct 27, 2015

...is it worth adding unit tests for doing a query with the two examples given in #2140 ? :-)

@skurfer
Copy link
Member

@skurfer skurfer commented Oct 27, 2015

Latest QS is 10.9+ right?
In that case we need to change this line

That’s already changed in #2096 and #2104. No need to do it a third time. 😃

@skurfer
Copy link
Member

@skurfer skurfer commented Oct 29, 2015

I wonder why this doesn’t like * now…

2015/10/29 12:11:33.956 AM Quicksilver[605]: An error ocurred while scanning "Comment Tags": Syntax error in Metadata query string: kMDItemFinderComment LIKE[cd] '*#*'
2015/10/29 12:11:33.959 AM Quicksilver[605]: An error ocurred while scanning "Yojimbo Items and Tags": Syntax error in Metadata query string: kMDItemKind LIKE 'Yojimbo*'

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented Oct 29, 2015

Looks like NSPredicate and Spotlight use different syntax :(

https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Predicates/Articles/pSpotlightComparison.html

Edit: but still, that doesn't explain why it did work before, and not now.

@tiennou
Copy link
Member Author

@tiennou tiennou commented Oct 29, 2015

@pjrobertson Thanks, I knew there was some differences between the 2 syntaxes but wasn't able to find the actual documentation.

@skurfer Was this running the fix or the master version ?

@skurfer
Copy link
Member

@skurfer skurfer commented Oct 29, 2015

that doesn't explain why it did work before, and not now.

I don’t see them using single quotes in any of the examples. Maybe that’s the problem, and not the asterisk.

Was this running the fix or the master version ?

The queries work with master, but fail with this change.

@tiennou
Copy link
Member Author

@tiennou tiennou commented Oct 29, 2015

Differences are that NSPredicate mandates quoting constants and its LIKE clauses are not the same. We can fix that by making it try both syntaxes, but meh.

skurfer added a commit that referenced this issue Oct 30, 2015
Handle the $ variables in Spotlight queries
@skurfer skurfer merged commit 23d4c04 into master Oct 30, 2015
2 checks passed
@skurfer skurfer deleted the t/spotlight-queries branch Oct 30, 2015
skurfer added a commit that referenced this issue Oct 30, 2015
@skurfer
Copy link
Member

@skurfer skurfer commented Oct 30, 2015

is it worth adding unit tests for doing a query with the two examples given

Along with a few others? Yes. I put it on my Remember the Milk Quicksilver list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants