quicksilver/Quicksilver — pull request #1177 by skurfer (2012-10-16 15:41:36+00:00)
Title: Preview Icons and other file-related changes

As discussed in #1149, this changes things so the most useful/appealing icon is chosen, instead of blindly using whatever Quick Look throws out. The list of types that get Quick Look previews was put into the user's preferences so they can be tweaked without modification to the application.

### QSFSFileTypePreviewers ###

Some history: The only known example of a QSFSFileTypePreviewer was the Music Support plug-in. It would show album covers in QS back before the OS could do it for us. It's no longer used. These previewers [worked based on file extensions][ms].

If someone goes to the trouble to implement one of these, there's probably a good reason, so I've moved it to be the first thing checked. I was concerned about this because the `typeOfFile:` method seems pretty expensive and there are currently no QSFSFileTypePreviewers so we'd be getting the type for nothing. So I took advantage of the fact that there are no implementations of this and changed it to use UTI instead of extension. Since the UTI is stored in the object's metadata now, it's much faster to get.

### Other changes ###

* Since UTI was being determined for every new file object anyway, I stuck it in the object's metadata. This should allow all other operations on file objects to get the UTI without going to disk again. (There are probably a few places we could take advantage of this.)
* There's a small, mostly unrelated, optimization in the `getNameFromFiles` method (d016bd6f7f)

[ms]: https://github.com/quicksilver/Plugins/blob/master/elements.support.music/Info.plist#L30