Replace the convoluted make an object with the order of applets by iterating them and then add them in order by a sort() and forEach().
This makes the code much easier to follow.
Details
Details
- Reviewers
mart - Group Reviewers
Plasma - Commits
- R119:efd188db5838: [Panel Containment] Replace restore order logic by "algorithms"
Verified that my applets are still added in the correct order. Also verified that applets not in the appletOrder are added at the end of the panel
Diff Detail
Diff Detail
- Repository
- R119 Plasma Desktop
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
This has broken the initial panel population from a clean config.
I get all my applets added the wrong way round.
Reverting this patch fixes it.
I think it's this part:
appletsOrder["unordered"+i] = plasmoid.applets[i]
Comment Actions
I think it's this part:
appletsOrder["unordered"+i] = plasmoid.applets[i]
My loop sorts elements that have no index last, maybe that's wrong somehow? It worked for me for when an applet isn't ordered yet but I can reproduce that adding a new "default" panel has its items wrong way round.