Update knsrc to use kpackagetool5 commands
ClosedPublic

Authored by Zren on Apr 16 2018, 4:00 PM.

Details

Summary
  • kwinswitcher.knsrc
  • kwinscripts.knsrc
  • aurorae.knsrc (doesn't use an install command)
  • kwineffect.knsrc
    • For some reason kpackagetool5 --list-types doesn't list KWin/Effect.
    • /usr/share/kservicetypes5/kwineffect.desktop and /etc/xdg/kwineffect.knsrc are installed.

It seems the kwineffect.desktop is invalid, so I'll need to update kwineffect.desktop too.

kf5.kcoreaddons.desktopparser: Property type "Url" is not a known QVariant type. Found while parsing property definition for "X-KWin-Video-Url" in "/usr/share/kservicetypes5/kwineffect.desktop"
Test Plan

Testing the new commands work (TODO)

Overwrite the /etc/xdg/*.knsrc. Open the GHNS dialogs and install stuff.

  1. Confirm an invalid command doesn't install correctly
  2. Confirm the old commands work (besides kwineffect)
  3. Confirm the new commands work

Testing the old kwineffect.knsrc command

$ plasmapkg2 -t kwineffect -i 159942-cool_effect-keluoinhac\ \(2\).zip 
Package type "KWin/Effect" not found
kf5.kcoreaddons.desktopparser: Property type "Url" is not a known QVariant type. Found while parsing property definition for "X-KWin-Video-Url" in "/usr/share/kservicetypes5/kwineffect.desktop"
kf5.kcoreaddons.desktopparser: Unable to find service type for service "Plasma/Theme" listed in "/home/chris/.local/share/plasmate/test/metadata.desktop"
kf5.kpackage: Generated  "/home/chris/.local/share//kpluginindex.json"  ( 232  plugins)
Successfully installed /home/chris/Desktop/159942-cool_effect-keluoinhac (2).zip

It was installed to ~/.local/share/kwin4_effect_cooleffect

Diff Detail

Repository
R108 KWin
Lint
Lint Skipped
Unit
Unit Tests Skipped
Zren created this revision.Apr 16 2018, 4:00 PM
Restricted Application added a project: KWin. · View Herald TranscriptApr 16 2018, 4:00 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
Zren requested review of this revision.Apr 16 2018, 4:00 PM
Zren planned changes to this revision.
Zren added a comment.Apr 16 2018, 4:31 PM
[PropertyDef::X-KWin-Video-Url]
Type=QUrl

Doesn't work...

$ grep -i url /usr/share/kservicetypes5/*
/usr/share/kservicetypes5/browserview.desktop:# when the active view goes to another url, this view will follow).
/usr/share/kservicetypes5/kwineffect.desktop:[PropertyDef::X-KWin-Video-Url]
/usr/share/kservicetypes5/kwineffect.desktop:Type=QUrl
/usr/share/kservicetypes5/plasma-applet.desktop:[PropertyDef::X-Plasma-DropUrlPatterns]

There isn't another ServiceType we can use as an example it seems.

So I looked at where it's parsed. The code appears to load it as a QString, then casts it to a QUrl.

https://github.com/KDE/kwin/blob/master/kcmkwin/kwincompositing/model.cpp#L281

[PropertyDef::X-KWin-Video-Url]
Type=QString

and the warning disappears but it still can't find KWin/Effect.

$ plasmapkg2 -t kwineffect -i 159942-cool_effect-keluoinhac\ \(2\).zip 
Package type "KWin/Effect" not found
kf5.kcoreaddons.desktopparser: Unable to find service type for service "Plasma/Theme" listed in "/home/chris/.local/share/plasmate/test/metadata.desktop"
kf5.kpackage: Generated  "/home/chris/.local/share//kpluginindex.json"  ( 236  plugins)
Successfully installed /home/chris/Desktop/159942-cool_effect-keluoinhac (2).zip

I deleted /home/chris/.local/share/plasmate/ to try fixing that warning and it started showing "~/.trash/plasmate/" in the warning, so I'm going to try relogging and see if that has any effect.

Zren requested review of this revision.Apr 16 2018, 7:05 PM

Yeah, I can't figure out how to get it to recognize kwineffect.desktop, I'll submit another diff if I figure it out.

Zren added a comment.May 11 2018, 6:37 PM

I guess apol's +1 = patch accepted? I'll merge it then.

This revision was not accepted when it landed; it landed in state Needs Review.May 13 2018, 11:11 PM
This revision was automatically updated to reflect the committed changes.