quicksilver/Quicksilver — pull request #1190 by skurfer (2012-10-30 19:42:44+00:00)
Title: Result icons

The problem (discussed briefly over on #1142) was that in many cases, only the icon for the first item in the results list would appear. The most reliable way to reproduce this for me was to browse through albums in `~/Music` (via the filesystem, not the iTunes plug-in) and look at one that hadn't been seen in a few days (to make sure icons weren't cached).

If you look at the original code, it updates the object in the first pane then checks for that same object in the results list and updates it (if found). The rest of the icons *are* loaded in the background, but the view is never updated. You can tell because they all appear instantly if you scroll.

I'll skip the things I went through to arrive at this fix (but feel free to ask). The interface controller was listening for `QSObjectIconModified` notifications, but then it had to check the 1st pane and 3rd pane to see where the update should happen. To get all the icons loading, we'd have to also check the results list for both panes as well, and potentially check the child results list too (if that pref is enabled).

Since all the updating was being done by `QSSearchObjectView` anyway, I just made it listen for the notifications instead. Now each `QSSearchObjectView` can worry about its own "pane", results list, and child results list.

Note that I'm not checking for visibility before updating because I found that QS is pretty good about not loading icons unless an object is visible (so the notification only gets sent for visible objects in the first place).

There's also a small commit in here to add styles for definition lists. I used one in the updated Contacts plug-in and didn't like the plain look.