SUMMARY When using the Folder Widget to display the contents of a folder below ~/Desktop, the Folder View shows the .desktop file names instead of the specified Name properties. This can be worked around by using desktop:///Productivity as user-defined path instead of file:///home/alexander/Desktop/Productivity, which is used by default when using the file browser to select a path. STEPS TO REPRODUCE 1. Right click on desktop > add widget 2. Add Folder View 3. Right click on widget > Folder View preferences 4. Set a user defined path OBSERVED RESULT Folder View shows the .desktop file names EXPECTED RESULT Folder View shows the Name properties specified in the .desktop files SOFTWARE/OS VERSIONS Operating System: openSUSE Tumbleweed 20220825 KDE Plasma Version: 5.25.4 KDE Frameworks Version: 5.97.0 Qt Version: 5.15.5 ADDITIONAL INFORMATION https://forum.kde.org/viewtopic.php?f=67&t=87492
Found the line of code which would need to be changed: https://invent.kde.org/plasma/plasma-desktop/-/blob/master/containments/desktop/package/contents/ui/ConfigLocation.qml#L167
Nice, wanna fix it?
I'm trying, but I don't know how to get a relative path from two absolute paths: Apparently, the QDir type is not available in QML and in Javascript it's usually done with a NodeJS module. function getDesktopURI(fileURI) { var absoluteDesktopURI = StandardPaths.writableLocation(StandardPaths.DesktopLocation) // var relativeURI = absoluteDesktopURI.relativeFilePath(fileURI) <- QDir method // var desktopURI = relativeURI.replace("file://","desktop://") console.log(fileURI) console.log(absoluteDesktopURI) // console.log(relativeURI) // var path = require('path') <- NodeJS module // console.log(path.relative('/foo/bar/baz', '/foo')) return fileURI }
I submitted a merge request: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1125 I didn't test it in a Plasma session, but the unit test passes.
*** Bug 459077 has been marked as a duplicate of this bug. ***