Bug 401579 - Folders in recent documents show unknown icon
Summary: Folders in recent documents show unknown icon
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.14.4
Platform: Arch Linux Linux
: HI normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
: 402663 408337 410300 412312 435366 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-11-30 15:26 UTC by Buck Shockley
Modified: 2022-03-14 13:38 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25


Attachments
Screenshot showing the icons (114.89 KB, image/png)
2018-11-30 15:26 UTC, Buck Shockley
Details
unknown icon in "History" tab of kickoff (22.89 KB, image/jpeg)
2019-07-25 18:02 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buck Shockley 2018-11-30 15:26:52 UTC
Created attachment 116587 [details]
Screenshot showing the icons

Right-clicking on Dolphin and other applications that show recent documents shows them with generic icons. Only happens for folders when right-clicking on Dolphin and text/.conf files when right-clicking on Kate.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro 4.19.5 
(available in About System)
KDE Plasma Version: 5.14.4
Qt Version: 5.11.2
KDE Frameworks Version: 5.52.0
Comment 1 Kai Uwe Broulik 2018-12-03 10:03:43 UTC
Something I tried to address with [1] but it needs further investigation, or a fix/workaround in Task Manager plasmoid.

[1] https://phabricator.kde.org/D16087
Comment 2 Nate Graham 2018-12-28 22:32:06 UTC
*** Bug 402663 has been marked as a duplicate of this bug. ***
Comment 3 Chris Holland 2018-12-29 00:00:11 UTC
I can reproduce in Manjaro with Plasma 5.14.4, Frameworks 5.52, Qt 5.11.2. Note I'm using the *Breath* icons, which I assume inherits the Breeze icons.

* https://github.com/KDE/plasma-desktop/blame/master/applets/taskmanager/package/contents/ui/ContextMenu.qml#L101
* https://github.com/KDE/plasma-desktop/blame/master/applets/taskmanager/plugin/backend.cpp#L286

Here's the KFileItem::iconName() code path:
* https://github.com/KDE/kio/blame/master/src/core/kfileitem.cpp#L893
* https://github.com/KDE/kio/blame/master/src/core/kfileitem.cpp#L1492


-----
If I add a few `qDebug()` statements, it seems all the "Recent Doc" icons are "application-octet-stream".

        qDebug() << "url:" << url;
        qDebug() << "   scheme:" << url.scheme();
        qDebug() << "   isLocal:" << url.isLocalFile();
        qDebug() << "   isDir:" << fileItem.isDir();
        qDebug() << "   icon:" << fileItem.iconName();

url: QUrl("/home/chris/Pictures/Screenshots")
   scheme: ""
   isLocal: false
   isDir: false
   icon: "application-octet-stream"

I tried setting the scheme to "file" when it's empty. Which fixed `url.isLocalFile()` but did not fix `KFileItem::isDir()`.

        if (url.scheme() == QStringLiteral("")) {
            url.setScheme("file");
        }

url: QUrl("file:///home/chris/Pictures/Screenshots")
   scheme: "file"
   isLocal: true
   isDir: false
   icon: "application-octet-stream"
Comment 4 Buck Shockley 2019-02-28 02:53:48 UTC
This still occurs in the following software versions with the Breeze theme.

KDE Plasma Version: 5.15.1
KDE Frameworks Version: 5.55.0
Qt Version: 5.12.1
Comment 5 Nate Graham 2019-06-05 14:27:05 UTC
*** Bug 408337 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2019-06-22 16:19:31 UTC
There are two possible patches that could fix this:
- https://phabricator.kde.org/D16087
- https://phabricator.kde.org/D22005
Comment 7 toon.pepermans 2019-07-01 08:32:25 UTC
In my case (Plasma 5.16.2 on Kubuntu 19.04) both folders and Kate text files show the unknown icon in recent documents. This all worked fine for me in Plasma 5.15.4 (also tested on Kubuntu live iso).
Comment 8 Patrick Silva 2019-07-25 18:02:15 UTC
Created attachment 121732 [details]
unknown icon in "History" tab of kickoff

Related: "History" tab of kickoff also shows unknown icon for recent documents.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.16.80
KDE Frameworks Version: 5.61.0
Qt Version: 5.12.3
Comment 9 Nate Graham 2019-07-25 20:12:35 UTC
Méven, could this be a problem in KActivities?
Comment 10 Méven Car 2019-07-26 07:11:53 UTC
Nate, not likely, KActivities only stores file paths, the view and icon are the responsibility of the client, here the kickoff plasmoid.

https://phabricator.kde.org/D22005 Seems to me the way to go
Comment 11 Méven Car 2019-07-26 08:14:29 UTC
About the second screenshot added in :

 Patrick Silva 2019-07-25 18:02:15 UTC

Created attachment 121732 [details]
unknown icon in "History" tab of kickoff

Related: "History" tab of kickoff also shows unknown icon for recent documents.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.16.80
KDE Frameworks Version: 5.61.0
Qt Version: 5.12.3

Could you Patrick Silva please file a separate bug next time.

This is a bug introduced in :
https://phabricator.kde.org/D19784#502503
The comment pointed diagnoses the issue and suggest a path to fixing.
Comment 12 Kai Uwe Broulik 2019-07-26 08:20:19 UTC
I bet this is pretty much the same thing as I tried to address in https://phabricator.kde.org/D22005
Comment 13 Méven Car 2019-07-26 08:54:32 UTC
@broulik Your patch addresses an older bug in task manager, and although the new one has a similar effect, it is caused a missing mimetype check rather an incorrect url passed. See https://phabricator.kde.org/D19784#502503
Comment 14 Patrick Silva 2019-07-27 23:05:14 UTC
(In reply to Méven Car from comment #11)> 
> Could you Patrick Silva please file a separate bug next time.
> 
> This is a bug introduced in :
> https://phabricator.kde.org/D19784#502503
> The comment pointed diagnoses the issue and suggest a path to fixing.
reported as bug 410300
Comment 15 Nate Graham 2019-08-05 00:23:44 UTC
*** Bug 410300 has been marked as a duplicate of this bug. ***
Comment 16 Méven Car 2019-08-16 11:09:03 UTC
Patch proposal: https://phabricator.kde.org/D23198
Comment 17 Patrick Silva 2019-09-25 13:40:10 UTC
*** Bug 412312 has been marked as a duplicate of this bug. ***
Comment 18 Txutxifel 2019-12-17 18:54:13 UTC
Hi,

It's still present in Opensuse Tumbleweed. 
-Kde applications 19.12
-Plasma 5.17.4
-Kde Frameworks 5.64
Comment 19 postix 2020-01-16 11:09:37 UTC
Alternative to D23198: https://phabricator.kde.org/D26407
Comment 20 Nate Graham 2020-01-22 15:17:59 UTC
Half fixed with https://phabricator.kde.org/D26580

Hopefully the rest will be fixed soon with https://phabricator.kde.org/D26407
Comment 21 Nate Graham 2020-02-20 20:24:15 UTC
There's a patch that fixes this: https://phabricator.kde.org/D26407
Comment 22 Bug Janitor Service 2020-10-17 10:07:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/174
Comment 23 Nate Graham 2021-04-06 00:44:28 UTC
*** Bug 435366 has been marked as a duplicate of this bug. ***
Comment 24 Bug Janitor Service 2022-03-05 17:26:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/780
Comment 25 Bug Janitor Service 2022-03-05 17:26:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1507
Comment 26 Nate Graham 2022-03-14 13:38:26 UTC
Git commit 02d6d0a4090094437bc5ff334d124e9cf3b8b70e by Nate Graham, on behalf of Méven Car.
Committed on 14/03/2022 at 13:38.
Pushed by ngraham into branch 'master'.

RecentUsageModel: propagate mimeType to KFileItem ctor
FIXED-IN: 5.25

Best used in conjunction with with
https://invent.kde.org/frameworks/kio/-/merge_requests/780 which will
allow kicker recentUsageModel not to make any stat call but solely
base its iconName based on passed mimetype, allowing to act as if
KFileItem::SkipMimeTypeFromContent was set.

M  +1    -1    applets/kicker/plugin/actionlist.cpp
M  +9    -4    applets/kicker/plugin/recentusagemodel.cpp
M  +1    -1    applets/kicker/plugin/recentusagemodel.h

https://invent.kde.org/plasma/plasma-workspace/commit/02d6d0a4090094437bc5ff334d124e9cf3b8b70e