Provide a method of assigning custom default icons for non-XDG dirs
Needs RevisionPublic

Authored by ngraham on Mon, Nov 26, 4:18 AM.

Details

Reviewers
cfeck
broulik
dfaure
Group Reviewers
Frameworks
Summary

This patch adds a new folder-to-icon map that makes it possible to assign default icons for non-XDG directories. It is pre-populated with ~/Games, as requested in 401218.

The new map includes entries for the localized and non-located string, because some people like to use English names even with a different locale.

BUG: 401218
FIXED-IN: 5.53

Test Plan
  • Created ~/Games; it got the new folder-games icon
  • Created a new user account and checked out its homedir; all XDG dirs continued to get the correct icon

Diff Detail

Repository
R241 KIO
Branch
custom-icons-for-non-xdg-dirs (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5380
Build 5398: arc lint + arc unit
ngraham created this revision.Mon, Nov 26, 4:18 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMon, Nov 26, 4:18 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ngraham requested review of this revision.Mon, Nov 26, 4:18 AM
ngraham updated this revision to Diff 46233.Mon, Nov 26, 4:19 AM

Correct typo in the comment

ngraham updated this revision to Diff 46234.Mon, Nov 26, 4:21 AM

Match existing brace style for inline initializer

dfaure requested changes to this revision.Fri, Nov 30, 12:37 PM

This feels *very* special cased. Where does this automagic ends? Any why only in $HOME? We'll keep adding entries here forever... Why don't people use a .directory file for this?
If ~/Games is a de-facto standard, whoever creates it could add a .directory in there. If it's not, then that makes my point.

This revision now requires changes to proceed.Fri, Nov 30, 12:37 PM

This feels *very* special cased. Where does this automagic ends? Any why only in $HOME? We'll keep adding entries here forever... Why don't people use a .directory file for this?
If ~/Games is a de-facto standard, whoever creates it could add a .directory in there. If it's not, then that makes my point.

Well, it is very special cased. :)

But I think the better question is whether it's useful or nice to have. The whole point of this patch is to gain the ability for KIO to automatically set appropriate default icons for common-but-not-XDG directories that people might create. Sure, people can already set custom icons for those folders themselves if they want. It's just a few clicks. This patch simply provides a mechanism for KIO to make it automatic.

Have you ever had one of those moments when you go to do something that you expect to be a manual, multi-step process but the software anticipates what you're going to do and does it for you? It's those little "aha, I love that they thought of this!" moments that make people fall in love with software. That's all this is trying to help facilitate. :)

cfeck added a comment.Thu, Dec 6, 5:25 AM

But why hardcode the list in the source, instead of reading it from a file/resource that the user could expand? Ideally, the "New Folder" dialog would have a button to pick an icon, and a checkbox "Remember icon for this folder name", automatically appending/replacing entries in this list.