KEmoticons: performance improvement
Review Request #129856 - Created Jan. 20, 2017 and submitted
|mklapetek, sitter, vkrause|
Don't parse kdeglobals every time KEmoticons::theme() is called.
KSharedConfig is only efficient if something keeps a refcount on it,
which is typically not the case for KSharedConfig::openConfig("kdeglobals").
So use the default-constructed KSharedConfig instead, for this.
Found by interrupting kmail in gdb, KTextToHTMLEmoticons::parseEmoticons
(used by MimeTreeParser) calls KEmoticons::theme().
Interestingly this problem was already mentioned in a commit message from Volker in 2015 ;)
It compiles and the existing unittests in kemoticons still pass. That's something, already :)