Respect custom directory icons in iconNameForURL()
Needs ReviewPublic

Authored by ngraham on May 24 2018, 2:40 AM.

Details

Reviewers
apol
broulik
dfaure
Group Reviewers
Frameworks
Summary

With iconFromDirectoryFile() a public function thanks to D13082, we can use it to get custom icons for folders.

BUG: 356045
FIXED-IN: 5.47

Test Plan
  • No test regressions
  • Adding a folder with a custom icon to the Places panel results in the new Places item getting the custom icon:

Diff Detail

Branch
custom-icons (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
ngraham requested review of this revision.May 24 2018, 2:40 AM
ngraham created this revision.
ngraham edited the summary of this revision. (Show Details)
ngraham set the repository for this revision to R241 KIO.
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 24 2018, 2:41 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript

This still has the issue of blocking if the contents is an unavailable nfs share of some sort.

src/core/global.cpp
385

You do toLocalFile() here, so move that also into the isLocalFile() branch

ngraham edited the summary of this revision. (Show Details)May 24 2018, 1:12 PM
ngraham updated this revision to Diff 34816.May 24 2018, 1:17 PM

Re-add url.isLocalFile() check to the higher-level if statement

ngraham marked an inline comment as done.May 24 2018, 1:18 PM

Unlike KFileItem, this function does no caching. I hope you do caching at the layer above then...

To skip this for NFS/SMB shares you need code like the one in KFileItemPrivate::isSlow().

So maybe we should go back to using KFileItem like I had clumsily tried to do in D13048, and just ensure that we don't even try to go down this codepath for remote folders. Does that seem like a better approach?