Mark all wallpaper plugins as addons
AbandonedPublic

Authored by ngraham on Oct 31 2019, 9:34 PM.

Details

Reviewers
apol
mak
Group Reviewers
Plasma
Summary

Heanau, Hunyango, and POTD wallpaper plugins still show up in Discover as apps because
they aren't getting marked as addons properly.

I *think* this is because their IDs aren't prefixed with org.kde.plasma such that this
patch will fix the issue.

BUG: 413688
FIXED-IN: 5.17.3

Test Plan

Can't test these kinds of AppStream changes. :/ Please let me know if this is dumb. :)

Diff Detail

Repository
R114 Plasma Addons
Branch
mark-all-wallpaper-plugins-as-addons (branched from Plasma/5.17)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18410
Build 18428: arc lint + arc unit
ngraham created this revision.Oct 31 2019, 9:34 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 31 2019, 9:34 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Oct 31 2019, 9:34 PM

What happens if a user has their setup to use potd or hunyango and we change this ID?

Hmm so if this is the correct solution to the indicated problem, I guess we would need a kconf update script to change the IDs in plasma-org.kde.plasma.desktop-appletsrc?

I don't know how Discover works but to me looks the wrong fix. Does every third party wallpaper then also need to have a name with plasma in it?
In my opinion ServiceType Plasma/Wallpaper should be enough for a Service as add-on and not having plasma in it's name.

apol requested changes to this revision.Nov 1 2019, 1:06 AM

Yes, it's the wrong fix.

For reference, it's not about discover, it's about generating the appstream file properly.
Will try to provide a patch next week.

This revision now requires changes to proceed.Nov 1 2019, 1:06 AM
apol added a comment.Nov 1 2019, 1:36 AM

I just looked into it, the problem is that plasma_packagestructure_wallpaper.so is installed by plasma-workspace, which isn't a dependency of kdeplasma-addons.

One thing we could do is update this patch to have X-KDE-ParentApp=org.kde.plasmashell instead of the .plasma (which I'm pretty sure it doesn't make a difference, you can check by reading the top of the appdata.xml file and see if it starts with <component type="addon">.
Alternatively we could move the qmlWallpaper bit to plasma-framework and then plasma wallpapers should always be detected properly.

In D25100#557494, @apol wrote:

One thing we could do is update this patch to have X-KDE-ParentApp=org.kde.plasmashell instead of the .plasma (which I'm pretty sure it doesn't make a difference, you can check by reading the top of the appdata.xml file and see if it starts with <component type="addon">.

The local version that I've built seems to be an addon, even without this patch:

grep -i extends -B 2 /home/nate/kde/usr/share/metainfo/org.kde.haenau.appdata.xml
<component type="addon">
    <id>org.kde.haenau</id>
    <extends>org.kde.plasmashell</extends>

But the distro-provided version (openSUSE Tumbleweed) does not:

grep -i extends -B 2 /usr/share/metainfo/org.kde.haenau.appdata.xml
[nothing]
apol added a comment.Nov 1 2019, 1:57 AM

But the distro-provided version (openSUSE Tumbleweed) does not:

Yes, this happens because distros don't take plasma-workspace as a dependency, but in your computer you do have plasma-workspace installed.

ngraham abandoned this revision.Jan 12 2020, 5:06 AM

Seems like this isn't the right way to solve the problem.

mak added a comment.EditedJan 12 2020, 5:42 AM

@ngraham Did this have AppStream metadata before? Probably the distribution data still lists this as component, while the new file lists it as addon. The distro data is preferred, so that's why this shows up as app. You need your distro to ship this as update, or set PreferLocalMetainfoData=true in /etc/appstream.conf (that should override the distro-provided data with local one, which is nice for development but not usually desired).

The output of appstreamcli dump org.kde.haenau (or appstreamcli get org.kde.haenau --details is also always helpful to investigate issues like this. On my machine (Debian testing) the component is incorrectly marked as "generic component" instead of "addon" due to its metadata (although I would argue that Discover should hide generic components as well, as those may be things like shared libraries and developer tools as well).
Changing it to addon is reflected in the metadata. but to be a valid addon component, it needs to <extends/> something.

In D25100#592375, @mak wrote:

@ngraham Did this have AppStream metadata before? Probably the distribution data still lists this as component, while the new file lists it as addon. The distro data is preferred, so that's why this shows up as app. You need your distro to ship this as update, or set PreferLocalMetainfoData=true in /etc/appstream.conf (that should override the distro-provided data with local one, which is nice for development but not usually desired).

The output of appstreamcli dump org.kde.haenau (or appstreamcli get org.kde.haenau --details is also always helpful to investigate issues like this. On my machine (Debian testing) the component is incorrectly marked as "generic component" instead of "addon" due to its metadata (although I would argue that Discover should hide generic components as well, as those may be things like shared libraries and developer tools as well).
Changing it to addon is reflected in the metadata. but to be a valid addon component, it needs to <extends/> something.

I'm afraid I didn't understand much of that, but here's the command output you requested:

appstreamcli dump org.kde.haenau
<?xml version="1.0" encoding="utf-8"?>
<component>
  <id>org.kde.haenau</id>
  <name>Haenau</name>
  <summary>Haenau wallpaper</summary>
  <project_license>LGPL-2.1</project_license>
  <developer_name>Marco Martin &lt;mart@kde.org&gt;</developer_name>
  <pkgname>plasma5-addons</pkgname>
  <url type="homepage">http://kde.org/</url>
  <url type="donation">https://www.kde.org/donate.php?app=org.kde.haenau</url>
  <icon type="stock">preferences-desktop-wallpaper</icon>
</component>
appstreamcli get org.kde.haenau --details
Identifier: org.kde.haenau [generic]
Name: Haenau
Summary: Haenau wallpaper
Package: plasma5-addons
Homepage: http://kde.org/
Icon: preferences-desktop-wallpaper
Developer: Marco Martin <mart@kde.org>
License: LGPL-2.1

Was this patch correct? Is there something we should change here?