quicksilver/Quicksilver — pull request #1263 by skurfer (2012-12-04 14:21:50+00:00)
Title: File label

As promised: This should address some of the problems we've found with the way files were being labeled. Mostly by removing the heavy reliance on Spotlight. The problems with that were:

1. A user could have Spotlight disabled.
2. There have been complaints about performance when right-arrowing into some folders for the first time. (To test the difference, try right arrowing into `/usr/bin` with this branch vs. master.)
3. Files with multiple hard links might have different names, but since they're the same file, they have the same `kMDItemDisplayName`. (e.g. `/usr/bin/2to3` would appear as `smtpd.py`)

The `getNameFromFiles` method largely resembles a previous attempt. It was only changed to use Spotlight to address [a problem with localized paths](/quicksilver/Quicksilver/issues/952#issuecomment-7867944). But the more I think about it, the less sense the fix makes. If the path was actually being passed in as `/Applications/計算機.app`, it would be treated as a non-existant path and the whole method would fall apart. To test the new changes, I've cleared caches and set my system to Japanese and I can locate applications using their filesystem names.

I've also held my nose and added some special cases for Preference Panes and Quicksilver Plug-ins. I hate things like that, but I don't see a way around it in this case.

Finally, I've changed `setName:` and `setLabel:` in `QSObject` to be aware of their relationship to each other. That allows developers to freely call these methods in any order, without doing any comparisons, and without even having to really understand the relationship themselves. I'm willing to locate and remove any such tests that are now redundant if you want.

Side note: There's a comment in `setName:` that says "this should take first line only?". I'd like to either make the suggested change, or remove the comment. I don't have strong feelings either way. Multi-line names don't seem to be hurting anything.