Support choosing .ico files in custom icon file chooser
ClosedPublic

Authored by ngraham on Jun 25 2018, 1:21 PM.

Details

Summary

.ico files work fine, so we should allow them to be chosen in the custom icon file chooser dialog.

BUG: 233201
FIXED-IN: 5.48

Test Plan
  • Find a .ico file lying around, or turn a .png file into a .ico file using https://convertico.com/
  • Typ to apply it to a folder in Dolphin
  • You can select the .ico file in the dialog, and when applied, it appears correctly as a custom icon for the folder

Diff Detail

Repository
R302 KIconThemes
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Jun 25 2018, 1:21 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJun 25 2018, 1:21 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ngraham requested review of this revision.Jun 25 2018, 1:21 PM
ngraham edited the summary of this revision. (Show Details)Jun 25 2018, 1:21 PM
cfeck added a comment.Jun 25 2018, 4:49 PM

But does it actually work? Our icon loader removes the extension, and tries to find the icon with a set of known extensions (grep -i xpm in kiconloader.cpp).

It does actually work; I tried it. The bug reporter also reported that it worked for him too if he manually entered the path to a .ico file.

I think if you pass a completely custom icon to it an absolute path will be looked up and as a result this (unintentionally) works

So is this patch okay, or is more needed here?

cfeck accepted this revision.Jun 27 2018, 8:55 PM

I was thinking if we need general support for .ico files on Windows, but fear a slowdown while lookup of theme icons. But if this works for the special case of full-path icons, we can revisit the issue once/if we get a separate ticket.

This revision is now accepted and ready to land.Jun 27 2018, 8:55 PM

But if this works for the special case of full-path icons

Right, and that's exactly what this patch enables.

Thanks!

This revision was automatically updated to reflect the committed changes.