Bug 432969 - Not all Python files have the appropriate icon in the projects pane
Summary: Not all Python files have the appropriate icon in the projects pane
Status: RESOLVED MOVED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 20.12.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-15 12:26 UTC by Bart Ribbers
Modified: 2022-03-06 19:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Example of the bug (4.51 KB, image/png)
2021-02-15 12:26 UTC, Bart Ribbers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Ribbers 2021-02-15 12:26:53 UTC
Created attachment 135697 [details]
Example of the bug

SUMMARY
I'm editing a Python project and have the projects plugin enabled. The projects pane shows the files, but only has a single Python file marked with a Python icon. The others are all using the generic file icon. I'm guessing this single file has the proper icon because it has the "#!/usr/bin/python3" shebang, but it should really use the proper icon for _all_ the Python files.

STEPS TO REPRODUCE
1. Open a Python project with multiple Python files
2. Add a Python shebang to one of the files

OBSERVED RESULT
Only the Python file with the shebang gets the Python icon.

EXPECTED RESULT
All Python files to get the Python icon.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Alpine Linux edge
(available in About System)
KDE Plasma Version: 5.20.90
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Comment 1 Bart Ribbers 2021-02-15 15:07:36 UTC
Ok it actually only seems to use the wrong icon for Python files without any imports. I have some files which are just barebone classes holding some data and they don't need imports, but it seems they are not recognized as Python files.
Comment 2 Christoph Cullmann 2022-03-06 19:44:27 UTC
We use QMimeDatabase for this.
It relies on the global mime magic detection of the system.
Therefore his will not be fixable by us as I don't see us overwriting this with our highlighting or such.
If you want to have this improved you could raise this at https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues