How to debug while porting Plasma 5 plasmoids to Plasma 6

I have some Plasmoids that I developed for Plasma 5, and now I am trying to port them to Plasma 6 using this guide authored by Marco Martin and actively maintained by @ngraham.

The problem is it is impossible to debug because when I try to use the plasmoid using plasmawindowed or plasmoidviewer, if there is any problem, the only error message displayed is "This Widget was written for an unknown older version of Plasma and is not compatible with Plasma 6. Please contact the widget’s author for an updated version.Error loading Applet: package does not exist. "

I want to know which part of the QML code of the plasmoid is causing this.

That means you haven’t added the metadata key that identifies your plasmoid as being compatible with Plasma 6. This is mentioned here: Porting Plasmoids to KF6 | Developer

See the paragraph that begins with “In addition, some changes to applets’ metadata are needed”.

Thanks for the response. And sorry about my late response. Been busy lately.

Here is the metadata.json I was using. Seems to me that it already satisfies everything mentioned in the porting guide.

{
    "KPackageStructure": "Plasma/Applet",
    "KPlugin": {
        "Authors": [
            {
                "Name": "Himprakash Deka"
            }
        ],
        "Category": "Utilities",
        "Description": "Toggle Overview",
        "Icon": "dialog-layers",
        "Id": "com.himdek.kde.plasma.overview",
        "License": "GPL-3.0-or-later",
        "Name": "Overview",
        "Version": "1.1"
    },
    "X-Plasma-API-Minimum-Version": "6.0"
}

Here is the result when using the plasmoid.

Huh, you’re right, that does look correct to me.

Any ideas, @mart or @alex ?

I figured out that the name of the directory of the plasmoids should be the same as “KPlugin.Id” property from metadata.json. This might be intentional but the developer should be told that there is directory name mismatch.

1 Like