[Webkit-unassigned] [Bug 54024] [Qt] QWebSettings::iconForURL() returns NULL at first call

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 28 13:55:09 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=54024





--- Comment #7 from Rafael Brandao <rafael.lobo at openbossa.org>  2011-11-28 13:55:09 PST ---
(In reply to comment #6)
> I am not sure it's always asynchronous. The 2nd or 3rd calls always get a valid icon if it's in the database. Maybe, there is some internal icon cache in the memory. The first call only loads it from the disk into the memory while later calls directly retrieve the icon from the memory cache. 
> 
> A synchronous return option would be great in this case. Otherwise, we should provide some callback signal to let developers know when the icon is ready. And this signal shouldn't come from QWebFrame since there are cases we want to use the icon outside a webkit view. 
> 
> Just sharing some thoughts. Thanks.

It happens because when you ask for the icon, it may not have finished to load the mapping between page urls and icon urls, or it has finished it but it didn't load the icon data yet. When you request the pixmap, then you'll be marked as interested in the data for that icon, and then when you get the signal iconChanged, it means it is ready... so you request it again and you'll get the QPixmap you were looking for.

You could ask for the pixmap in the call iconForURL with size (0,0) so it won't actually give you any data, but it will trigger the load for it. You should do this on startup.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list