Skip to content

draft: port to .Plasmoid attached property

Andrey Butirsky requested to merge work/bam/Plasmoid_port into master

Add missing import for files using .plasmoid context property:
import org.kde.plasma.plasmoid 2.0
I'm not sure if this change is needed in all the cases so please review it carefully.

Next step will be swap .plasmoid to .Plasmoid.

This source cross reference request tries to catch all the other occurrences:
^(?:(?!plasma-workspace|plasma-desktop|latte-dock).)*qml$
The regex for file names excludes plasma-workspace, plasma-desktop, latte-dock as these contain a lot.

I'll link MRs to other repos here when it ready.
Also we seem need to fix earlier broken porting with missing import statement (I didn't check if they are really broken though), see below:
!446 (comment 746837)

Current variant of scripts for the automation:

$ cd ~/kde6/src/
$ find -type d -name .git -execdir git checkout master \;

# The ${x;/./{x;q0};x;q1} stuff is needed to make sed return 1 in case it didn't change anything. Then other steps do not apply.
$ find -name *.qml -execdir sed '/[^.]plasmoid\./{s/plasmoid\./Plasmoid\./g;h};${x;/./{x;q0};x;q1}' -i {} \; \
-execdir sed '/org\.kde\.plasma\.plasmoid/!{0,/import/{//i \
import org.kde.plasma.plasmoid 2.0
}}' -i {} \; \
-execdir git add {} \; \
-execdir git checkout -qB work/bam/Plasmoid \;

$ find -type d -name .git -execdir git commit -m 'DRAFT: refactor plasmoid. -> Plasmoid.

Automated by:
find ~/kde6/src/ -name *.qml -execdir sed "/plasmoid\./{s//Plasmoid./g;h};${x;/./{x;q0};x;q1}" -i {} \; -execdir git add -u \; -execdir git checkout -qB work/bam/Plasmoid \; 
find -type d -name .git -execdir git commit -m "DRAFT: refactor plasmoid. -> Plasmoid." \;  -execdir git push \;

https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/446' \; -execdir git push \;
Edited by Andrey Butirsky

Merge request reports