[Icon Applet] Get favicon for website shortcuts
ClosedPublic

Authored by broulik on Jun 9 2017, 3:16 PM.

Details

Summary

When creating an icon for a website use its favicon if possible.

Test Plan

It fails to get the favicon for kde.org but succeeds with other websites but succeeds with others but also fails with some others.


Verified that it downloads the icon only first time and then uses the one from cache. Unfortunately this stuff is from a time before we had apple touch icon and co. so we only get the 16x16 icon :)

Future improvements would be to extract <title> and other information (there's a jumplist thing for websites) from the linked site but I couldn't figure out how to tell the mimetype of that http site with kio (statjob, even with details 2 just gave me octet stream in its kfileitem).

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Jun 9 2017, 3:16 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 9 2017, 3:16 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik edited the test plan for this revision. (Show Details)Jun 9 2017, 3:21 PM
dfaure edited edge metadata.Jun 9 2017, 4:10 PM

Yeah the favicon for kde.org is bigger than the size limit from the kio code -- ironic, isn't it. I never took the time to find out if it could be reduced, or if the size limit should be increased, and whatever other websites and other webbrowsers do.

As for KIO::stat with http, yeah, badly implemented by most webservers. Better use a KIO::get instead, even if you don't need the actual data (if you kill the job or put it on hold you won't be downloading the full data). (I'm not sure what you call "a jumplist thing for websites" so I might be a bit off here in my advice)

dfaure accepted this revision.Oct 7 2017, 5:44 PM
This revision is now accepted and ready to land.Oct 7 2017, 5:44 PM
This revision was automatically updated to reflect the committed changes.