syncthingtray icon indicating copy to clipboard operation
syncthingtray copied to clipboard

Plasmoid configuration not written

Open sharkberrypizza opened this issue 8 months ago • 10 comments

Relevant components

  • [ ] Standalone tray application (based on Qt Widgets)
  • [X] Plasmoid/applet for Plasma desktop
  • [ ] Dolphin integration
  • [ ] Command line tool (syncthingctl)
  • [ ] Integrated Syncthing instance (libsyncthing)
  • [ ] Android app or mobile UI in general
  • [ ] Backend libraries

Environment and versions

  • Versions of syncthingtray, qtutilities and c++utilities: syncthingtray-qt6 (Syncthing Plasmoid 1.7.7), Plasma 6.3.5
  • Qt version: 6.9.0
  • C++ compiler (name and version): gcc v. 15.1.1
  • C++ standard library (name and version): glibc v. 2.41
  • Operating system (name and version): EndeavourOS [6.14.6-arch1-1]

Bug description

Adding the plasmoid works as intended, and all usage thereafter is normal, including moving its position elsewhere, but its entry isn't added to plasma-org.kde.plasma.desktop-appletsrc meaning it's lost on plasmashell restart/reboot/etc. All other plasmoids work correctly, and once the default entry is added to file, it also seems to write other data (such as position) correctly too.

Noting use of Wayland, though I don't think it matters since this is a config issue? Also not sure if this bug report belongs here or KDE, but felt likely here. Please advise if that isn't the case!

Steps to reproduce

  1. Add the plasmoid to a bar
  2. Restart plasmashell, reboot, etc

Expected behavior The plasmoid is persistent.

Screenshots N/A

Additional context N/A

sharkberrypizza avatar May 11 '25 21:05 sharkberrypizza

I haven't noticed this problem so far. If it is a recent regression then it is probably caused by a change in Plasma as I haven't changed anything concerning the Plasmoid directly. Writing this config file is also done by the Plasma shell and not the Plasmoid themselves so the problem is most likely there anyway. For another issue I've already tried to figure out what is possibly wrong with my Plasmoid and unfortunately I'm not sure what needs to be improved. (I'm not a Plasma dev and only created this Plasmoid by checking the source code of official Plasmoids for how things are done.)

Martchus avatar May 12 '25 08:05 Martchus

It did happen before the latest update, but I wasn't on that version long and can't say for certain if it's the exact same issue (since version changes may introduce different variables).

I'll see if I can find where the problems are happening but it may not be for a while since I'm extremely busy with a project. (Note I'm not a plasma developer either, but I don't mind getting my hands in different things when I'm able.)

If I find anything I'll let you know, but for now if anyone runs into this exact problem and needs a fix, the file I mentioned plasma-org.kde.plasma.desktop-appletsrc is definitely the issue. The plasmoid works as expected and saves its location configurations with these lines added:

[Containments][BAR_NUMBER][Applets][HIGHEST_NUMBER]
immutability=1
plugin=martchus.syncthingplasmoid-qt6

where BAR_NUMBER is the number of the bar you want the plasmoid on, and HIGHEST_NUMBER is "your current highest configuration number"+1

sharkberrypizza avatar May 13 '25 19:05 sharkberrypizza

I have the same issue and I found this error in my journalctl, not sure if its related:

Mai 17 20:48:15 chaos plasmashell[1350]: "SystemServices" from "martchus.syncthingplasmoid-qt6" is not a known category that can be translated
Mai 17 20:48:20 chaos plasmashell[1350]: -------->  load applet:  "martchus.syncthingplasmoid-qt6"  relpath:  "plasma/plasmoids/martchus.syncthingplasmoid-qt6"
Mai 17 20:48:20 chaos plasmashell[1350]:  .. pathes:  QList("/usr/share/plasma/plasmoids/martchus.syncthingplasmoid-qt6")
Mai 17 20:48:46 chaos plasmashell[1350]: "SystemServices" from "martchus.syncthingplasmoid-qt6" is not a known category that can be translated

syncthingtray-qt6 v1.7.7-1 from AUR KDE Plasma Version: 6.3.5 KDE Frameworks Version: 6.14.0 Qt Version: 6.9.0

Delivator avatar May 17 '25 19:05 Delivator

Even if it is unrelated there might be something I could do to avoid this warning/message. Or it is literally about a missing translation/localization? In this case I can't help much as I could only add English and German.

Martchus avatar May 18 '25 07:05 Martchus

I've just tested this on my system and can reproduce it. This definitely worked before so I assume there's a breaking change or regression in Plasma (considering I haven't changed anything).

I guess the relevant log line below the translation one could be relevant as well:

"SystemServices" from "martchus.syncthingplasmoid-git" is not a known category that can be translated 
Invalid plugin metadata. :(

The icon of the Plasmoid is also no longer displayed correctly in the selection which would also indicate "invalid" meta-data. I'm quoting "invalid" here because I don't think I have changed anything about the meta-data on the Syncthing Tray side.

Martchus avatar May 18 '25 08:05 Martchus

I pushed a change that will avoid the is not a known category that can be translated.

With this I'm still getting Invalid plugin metadata. :( but I'm not sure anymore whether it is related because I double checked whether the meta-data is valid (and it seems to be valid) and the icon problem was something else (which is fixed with my latest change, too).

~/.config/plasma-org.kde.plasma.desktop-appletsrc is still not updated. The only diff I'm getting is:

   1   │ --- -   2025-05-18 12:59:42.769803232 +0200
   2   │ +++ /home/martchus/.config/plasma-org.kde.plasma.desktop-appletsrc  2025-05-18 12:59:36.974061356 +0200
   3   │ @@ -159,6 +159,9 @@
   4   │  immutability=1
   5   │  plugin=org.kde.plasma.lock_logout
   6   │  
   7   │ +[Containments][275][Applets][379][Configuration]
   8   │ +selectedConfig=0
   9   │ +
  10   │  [Containments][275][ConfigDialog]
  11   │  DialogHeight=82
  12   │  DialogWidth=1365
  13   │ @@ -167,7 +170,7 @@
  14   │  PreloadWeight=34
  15   │  
  16   │  [Containments][275][General]
  17   │ -AppletOrder=310;338;329;333;311;375;327
  18   │ +AppletOrder=310;338;379;329;333;311;375;327
  19   │  
  20   │  [Containments][309]
  21   │  ItemGeometries-1280x720=

Enabling/disabling the Plasmoid as entry within the system tray Plasmoid works (is is configured persistently).

I also see tons of errors like:

file:///usr/share/plasma/plasmoids/martchus.syncthingplasmoid-git/contents/ui/TinyButton.qml:18:18: QML Image: Fehlschlag beim Öffnen: file:///usr/share/plasma/plasmoids/martchus.syncthingplasmoid-git/contents/ui/refresh

Those errors are probably unrelated as well. I haven't seen them before so they are probably caused by a change in either Qt or Plasma. (Strangely all those icons are still shown correctly. I also used the debugger adding a breakpoint when the relevant icon provider for these icons is registered. The registration happens before those errors are logged so it is not like the registration happens to late. When removing the registration there are also other errors logged in addition and then the icons aren't shown for real. Maybe this is an additional check on the image sources by Plasma which is wrongly performed on the image:// URLs I'm using in my Plasmoid.)

Martchus avatar May 18 '25 10:05 Martchus

I asked on the Plasma Matrix channel for help yesterday but haven't gotten any reply so far. I could try filing a Plasma bug but probably I'll have to figure this out on my own anyway. So I probably have to make a development build of Plasma and all KDE Frameworks dependencies to improve logging and debug the Plasma parts together why my own code. This will be a bigger task again so I'm not sure when I can dedicate time to do it.

Martchus avatar May 19 '25 11:05 Martchus

Thank you for the effort. Luckily the the syncthing started is still working but I guess the main use of the tray app is currently not really usable for us.

Delivator avatar May 19 '25 13:05 Delivator

Not sure what you mean by "the the syncthing started is still working" and "I guess the main use of the tray app is currently not really usable for us".

Note that you can still use the Plasmoid. Either use the workaround mentioned on https://github.com/Martchus/syncthingtray/issues/339#issuecomment-2877768605 or enable it as entry in the system tray plasmoid. The latter still seems to work despite https://github.com/Martchus/syncthingtray/issues/239. I've also updated the relevant README section accordingly.

Martchus avatar May 19 '25 15:05 Martchus

Sorry for the confusion, I was just saying that the build in systemd unit configuration is of course still working, so the syncing is also still working. The workaround works for me!

Delivator avatar May 19 '25 20:05 Delivator

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 18 '25 20:07 stale[bot]

I guess I should check whether this still happens under the latest Plasma release.

Martchus avatar Jul 28 '25 10:07 Martchus

It is still broken under Plasma 6.4.3.

Martchus avatar Jul 28 '25 20:07 Martchus

can confirm still an issue

MNarath1 avatar Sep 18 '25 07:09 MNarath1

Still an issue under Plasma 6.4.5

ostrich avatar Oct 13 '25 01:10 ostrich

I gave it another test with plasma-workspace 6.4.5. The config is indeed still not written so the Plasmoid is gone again after restarting plasmashell. If I add e.g.

[Containments][2][Applets][26]
immutability=1
plugin=martchus.syncthingplasmoid-devel

to plasma-org.kde.plasma.desktop-appletsrc manually the icon shows up on startup and the config is also retained when moving the Plasmoid around and restarting the shell.

If I remove the Plasmoid via the UI the inserted config snipped is also retained. So one also cannot remove the Plasmoid (after inserting it manually). It is like plasmashell really doesn't like to touch the config for my Plasmoid at all.

Now I'm not getting the Invalid plugin metadata. :( debug messages anymore (even though this log line is still present in the source code of plasma-workspace). I'm also not getting any useful (or at least suspicious) log messages anymore, though.


Note that enabling the Plasmoid within the system tray Plasmoid still works just fine so this is still the way to go at the moment (and probably the best way to add the Plasmoid anyway).

Martchus avatar Oct 13 '25 19:10 Martchus

I added some debug logging to know for sure whether the correct so file is loaded and to know for sure whether the meta-data is considered valid:

Initializing Syncthing Plasmoid (devel), version 2.0.3
Valid meta-data: 0

It seems the latter is not the case. That's probably why certain code and perhaps also applying the config is not executed for the Plasmoid. (The plasma-workspace has several places where it checks the validity of the meta-data.)


With some additional env variables to enable debug logging I also got again Invalid plugin metadata. :(.

Martchus avatar Oct 13 '25 19:10 Martchus

I was finally able to fix this, see the commit auto-referenced by GitHub.

Martchus avatar Oct 13 '25 20:10 Martchus