Avoid accessing configuration file all the time

Authored by thomasfischer on Feb 26 2019, 9:47 PM.

Description

Avoid accessing configuration file all the time

In commit 36040dc280ccb3ad, a first step towards a centralized configuration
system was undertaken. A single static function in a central class became
available to probe whether the current bibliography system was BibTeX or BibLaTeX.
To allow for synchronization between multiple instances of KBibTeX programs and
KParts, configuration values were read from configuration files every time this
setting got queried.
This approach introduced a noticeable performance penalty as reported in bug
report 403751, requiring a rewrite of this code section.

To avoid reading/writing from/to configuration files at every function call got
avoided by making use of KConfigWatcher, a DBUS-based solution to notify other
processes' instances of a KSharedConfig object about changes made to the
configuration. Only if such notifications get received a re-read from configuration
files is necessary, otherwise a cached setting value is used.

Those changes also required to refactor previously static functions of class
Preferences to become regular functions called on a singleton instance of
Preferences.

CCBUG: 403751

Details

Committed
thomasfischerFeb 27 2019, 7:47 PM
Parents
R462:aee4b2347ed0: Debug output shows speaking names for NotificationHub's event ids
Branches
Unknown
Tags
Unknown