Bug 413734

Summary: The preview plugin takes mimetype from kate document type
Product: [Applications] kate Reporter: Juraj <jurajoravec>
Component: plugin-previewAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: christoph, justin.zobel
Priority: NOR    
Version First Reported In: 19.08.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Juraj 2019-11-02 10:56:54 UTC
SUMMARY
The preview plugin takes mimetype from kate document type which results in
selecting wrong preview kpart application.

STEPS TO REPRODUCE
1. Open some Qt UI file in kate. Kate rightly sets its mode to XML.
2. Open preview toolview. The plugin shows preview with some kpart.

OBSERVED RESULT
The plugin see internal kate mode as XML, so it tries to search for
applications capable of opening text/xml mimetype.
In my case it finds khtml and opens it in it.
If there is not preview kpart for text/xml mimetype it goes down
the list and selects something which is base on xml, in my case
it thought the UI file was text/rdf and started akregator.

When kate mode is changed to something strange, what probably
does not have default preview kpart, the plugin probably read file
mimetype and selects kpart application based on that, which results
in good preview.

EXPECTED RESULT
The preview application is decided on real file mimetype, not on kate
mode.

SOFTWARE/OS VERSIONS
Operating System: Artix Linux 
KDE Plasma Version: 5.17.1
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1
Kernel Version: 4.19.80-1-lts
OS Type: 64-bit
Processors: 2 × Intel® Pentium® CPU B980 @ 2.40GHz
Memory: 7,6 GiB of RAM


ADDITIONAL INFORMATION
Bad workaround is to set default application for text/xml (or any othe)
mimetype to one which you preffer. The drawback is if you work with more
filetypes which are using same mode in kate.
Comment 1 Justin Zobel 2020-11-13 05:02:50 UTC
Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I'm setting status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thanks.
Comment 2 Juraj 2020-11-13 07:26:52 UTC
I tested it again and no change, how do you expect there to be a change to this bug when there was no change in the code?
Comment 3 Christoph Cullmann 2023-12-28 20:44:54 UTC
The preview plugin is not maintained, if you want to have this improved, please submit a merge request, otherwise that will stay the way it is at the moment.

https://kate-editor.org/join-us/