D9165: Lazy-instanciate and lazy-load KNotification plugins.
Eike Hein
noreply at phabricator.kde.org
Mon Dec 4 11:53:51 UTC 2017
hein created this revision.
hein added reviewers: Plasma, Frameworks, davidedmundson.
Restricted Application added projects: Plasma, Frameworks.
REVISION SUMMARY
KNotificationManager always instanciates all of its built-in plugins
as well as any externally supplied icons as soon as the first
notification is sent, even if a particular plugin is not actually
needed by the notification.
This means e.g. always instanciating a text-to-speech engine even if
a notification event doesn't have TTS on (as basically none do by
default), or for that matter loading Phonon even when sounds are off.
This patch implements a lazy-loading approach instead. With the
patch applied, e.g. Konversation with default config will only ever
instanciate the Taskbar plugin, as its notification events only
enable this action by default.
The patch also speeds up time from login screen to desktop, by way
of the NetworkManager kded plugin not causing those costly
instanciations with its very early notification events anymore.
As a bonus, the patch also fixes a bug: The old code never properly
supported runtime installation of new plugins. If a plugin were to
be installed at runtime and enabled by the user in the config UI,
it likely never would have been instanciated if a preceding
notification had already caused the one and only instanciation pass
by that time.
TEST PLAN
Tests pass.
REPOSITORY
R289 KNotifications
BRANCH
master
REVISION DETAIL
https://phabricator.kde.org/D9165
AFFECTED FILES
src/knotificationmanager.cpp
src/knotificationmanager_p.h
To: hein, #plasma, #frameworks, davidedmundson
Cc: plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20171204/0846f3d1/attachment-0001.html>
More information about the Plasma-devel
mailing list