Port system tray away from SNI dataengine

Marco Martin notmart at gmail.com
Mon May 3 10:28:29 BST 2021


On domenica 2 maggio 2021 13:48:06 CEST Konrad Materka wrote:
> Hi,
> 
> I think I'm finally ready to take https://phabricator.kde.org/T13319 :)
> What is the best approach to DataEngine migration? It was/is a singleton,
> but System Tray can be instanced several times. In addition the SNI model
> can be quite heavy, it will use DBus a lot and will cache values (including
> images).Is it OK to put it in SystemTrayModel or should I create a
> singleton/plugin?
> 
> Is there any example (similar migration) that I can check?

So, we already have StatusNotifierModel, which at the moment is a 
DataEngineConsumer, but what you can do, is to keep that class, and instead of 
consuming a dataengine, it can consume a singleton qobject that will keep all 
the dbus operation and caching there. that thing would have signals of item 
added/removed/datachanged so it becomes easy to directly map this to a model.

-- 
Marco Martin




More information about the Plasma-devel mailing list