Wallpaper plugins were storing their configurations in the same config
group, overwriting each other's values.
Details
- Reviewers
mart davidedmundson - Group Reviewers
Plasma - Commits
- R120:bb5645d8c6e7: Use separate config group for each wallpaper plugin
0. Apply revision D11194 (plasma-desktop). 1. Right-click the desktop and click Configure Desktop. 2. Select Wallpaper Type -> Plain Color. Click the chooser button and select green. Hit Apply. 3. Select Wallpaper Type -> Picture of the Day. Click Background Color button and select red. Hit Apply. 4. Select Plain Color type again. The color should still be green.
Diff Detail
- Repository
- R120 Plasma Workspace
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
It's not limited to colors, that's just a testcase. And unless there is a well-defined key naming convention I haven't found, that keys have the same name doesn't imply they have the same meaning. For example, 'Provider' key may have totally different acceptable values across different wallpaper plugins, 'Color' may mean 'background color', 'skin color' (imagine dynamic emoji wallpaper :) ) and so on.
But that's not the main point. I've played with different wallpaper types, and that's what ended up in ~/.config/plasma-org.kde.plasma.desktop-appletsrc:
[Containments][1][Wallpaper][General] Blur=true Color=170,0,0 FillMode=2 Image=file:///usr/share/wallpapers/Next/contents/images/1366x768.png Provider=bing SlidePaths=/home/aleksej/Изображения [Containments][1][Wallpaper][org.kde.color][General] Color=255,0,0 [Containments][1][Wallpaper][org.kde.image][General] Blur=true Color=170,0,0 FillMode=2 Image=file:///usr/share/wallpapers/Next/contents/images/1366x768.png SlidePaths=/home/aleksej/Изображения [Containments][1][Wallpaper][org.kde.potd][General] Color=170,0,0 FillMode=1 Provider=bing [Containments][1][Wallpaper][org.kde.slideshow][General] Color=170,0,0 FillMode=6 SlidePaths=/home/aleksej/Изображения
As you see, separate config groups are used by the plugins anyway. More importantly, they are the ones plasmashell actually reads at startup. It's just ContainmentConfigView is using the wrong group for these settings. And it starts doing that only after one changes Wallpaper Type for the first time in the dialog. Try this:
- Right-click the desktop and click Configure Desktop.
- Select Wallpaper Type -> Plain Color. If it's already selected, select a different one first.
- Click the chooser button and select green, then hit OK.
- Open the dialog again. Don't switch wallpaper types. Change the color to red and click Apply.
- Select Picture of the Day as Wallpaper Type. The selected color is still green.
So, wallpaper plugins "share" configuration only accidentally due to ContainmentConfigView::setCurrentWallpaper() bug.
It's not setting twice, it's creating a nested config group.
Or did you mean to use a separate variable each time instead of reusing cfg?
Urgh, I can't read. Sorry.
typically we'd do cfg = cfg.group("") which IMHO is easier to read, but this is fine too
Thanks
Yeah, I like it more, too, but I saw the same styling almost everywhere in shell/ and therefore decided to follow rather than stand out.
Thanks!