Bug 384448 - No KTextEditor::Document::mimeTypeChanged signal available
Summary: No KTextEditor::Document::mimeTypeChanged signal available
Status: RESOLVED INTENTIONAL
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks: 384971 384972 384973
  Show dependency treegraph
 
Reported: 2017-09-06 21:38 UTC by Friedrich W. H. Kossebau
Modified: 2022-01-08 16:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Friedrich W. H. Kossebau 2017-09-06 21:38:51 UTC
The mimetype property of a KTextEditor::Document object is not fixed for its lifetime, at least in the implementation of KTextEditor::DocumentPrivate.

In that code it is depending on the outcome of the queries to QMimeDatabase, which itself depends on the current initial 4k bytes and/or the path of the url which is set to the document. So the mimetype can be different over the lifetime of the document instance (e.g. when saving under another filename or when editing a new file and switching between Markdown and Asciidoc during initial work).

Watchers of a document instance, like the preview plugin, could be happy to be informed about changes of the mimetype, so they can adapt to it.
Comment 1 Christoph Cullmann 2022-01-08 16:35:31 UTC
Given the preview plugin is more or less unmaintained and no other use case was brought up so far, I will close this.
If somebody really needs this in the future, patches are welcome.