KEmoticons: performance improvement

Review Request #129856 - Created Jan. 20, 2017 and submitted

Information
David Faure
kemoticons
master
Reviewers
kdeframeworks
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 :)

David Edmundson
David Faure
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 16675c710f343e8a0db69dd4248681144015b14f by David Faure to branch master.
Loading...