STEPS TO REPRODUCE
1. install Weather Widget or Redshift Control widgets from KDE Store
2. open system tray settings, click on "Entries" section: the just installed widget is not listed
3. restart Plasma by pressing alt+space and running "plasmashell --replace"
4. reopen system tray settings, "Entries" section: now the widget installed in the step 1 is listed
a widget from KDE Store should be listed in system tray settings immediately
after it to be installed
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.73.0
Qt Version: 5.14.2
Potentially we can do something like
QDBusConnection::sessionBus().connect(QString(), QStringLiteral("/KPackage/Plasma/Wallpaper"), QStringLiteral("org.kde.plasma.kpackage"), QStringLiteral("packageInstalled"),
(but with applets instead of wallpapers obviously) to watch changes
It's that or just rebuild the model anew everytime the config is opened,
Watching for changes makes sense to me, but what do you think, Konrad?
(In reply to Nate Graham from comment #2)
> Watching for changes makes sense to me, but what do you think, Konrad?
Good idea, I didn't know there is such signal! :) IT should also listen on package uninstall, so that we can immediately remove applet (I think there is a separate bug for this).
It requires some refactoring in systemtray.cpp, not only in model - applet can be "DBus-able" (m_dbusActivatableTasks) or enabled by default (m_defaultPlasmoids).
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/297
Git commit 371e91b93209206cee3a7146a35b090569e3fd24 by Konrad Materka.
Committed on 08/10/2020 at 17:00.
Pushed by kmaterka into branch 'master'.
[applets/systemtray] Refactor systemtray
Major refactoring of SystemTray logic, mainly around Applets/Plasmoids
lifecycle. It is now more event based.
M +3 -0 applets/systemtray/CMakeLists.txt
M +7 -2 applets/systemtray/autotests/CMakeLists.txt
M +76 -15 applets/systemtray/autotests/systemtraymodeltest.cpp
A +188 -0 applets/systemtray/dbusserviceobserver.cpp [License: GPL (v2+)]
A +70 -0 applets/systemtray/dbusserviceobserver.h [License: GPL (v2+)]
M +0 -8 applets/systemtray/package/contents/ui/main.qml
A +171 -0 applets/systemtray/plasmoidregistry.cpp [License: GPL (v2+)]
A +95 -0 applets/systemtray/plasmoidregistry.h [License: GPL (v2+)]
M +98 -339 applets/systemtray/systemtray.cpp
M +17 -33 applets/systemtray/systemtray.h
M +33 -23 applets/systemtray/systemtraymodel.cpp
M +32 -11 applets/systemtray/systemtraymodel.h
A +177 -0 applets/systemtray/systemtraysettings.cpp [License: GPL (v2+)]
A +70 -0 applets/systemtray/systemtraysettings.h [License: GPL (v2+)]