katedocument: Optimize mimeType

On an empty document, we end up running QMimeDatabase over "\n", which is basically guaranteed to be text/plain since it doesn't really match anything but is considered "text" (cf. shared-mime-info spec 2.12 "Recommended checking order")

Avoid the trailing line break and bail out early, to save loading the MIME database.


@ahmadsamir @dfaure

parsing the mime database constitutes 15% of startup time for my kwrite (which I use as scrap pad a lot, so every millisecond counts loading an empty document)

Edited by Kai Uwe Broulik

Merge request reports

Loading