Bug 489452 - Reloading a file and discarding the changes sets the file type icon in the file tab to text file icon
Summary: Reloading a file and discarding the changes sets the file type icon in the fi...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.05.0
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-29 17:48 UTC by alerikaisattera
Modified: 2024-09-15 16:35 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alerikaisattera 2024-06-29 17:48:49 UTC
SUMMARY

When a non-text file (such as source code) is opened in Kate, the file tab displays an icon showing the file type. If the file is edited, and then reloaded to discard the changes, this icon is replaced with text file icon

STEPS TO REPRODUCE
1. Open a source code file in Kate (this bug certainly occurs with Go source code)
2. Edit the file, don't save
3. Reload the file, discard the changes

OBSERVED RESULT
The icon in the file tab is replaced with text file icon

EXPECTED RESULT
The icon goes back from "save" icon to the specific file type icon

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Comment 1 Christoph Cullmann 2024-09-15 16:07:09 UTC
Hmm, true, that is funny.
Comment 2 Christoph Cullmann 2024-09-15 16:32:44 UTC
Git commit fe4b2acd694e456005383d3f20f4637067d65989 by Christoph Cullmann.
Committed on 15/09/2024 at 16:32.
Pushed by cullmann into branch 'master'.

fix mime-type icon after reload

just relying on the modified signal is not good enough
that fires in a state that the document has no content or url

M  +3    -0    addons/filetree/katefiletreemodel.cpp
M  +12   -6    apps/lib/kateviewspace.cpp
M  +1    -0    apps/lib/kateviewspace.h

https://invent.kde.org/utilities/kate/-/commit/fe4b2acd694e456005383d3f20f4637067d65989
Comment 3 Christoph Cullmann 2024-09-15 16:35:01 UTC
Good catch, we just missed to connect to the right signals for that case, was broken in the tab and the document list in the same way.