Fix losing wallpaper selection when clicking "Apply".
ClosedPublic

Authored by hein on Apr 13 2017, 9:25 PM.

Details

Summary

Currently the selected wallpaper is deselected when the "Apply"
button is clicked, as if no wallpaper is selected. This patch
fixes that. I didn't understand what the original restoreIndex
thing was trying to do by passing the count, so I gutted it and
wrote code that makes more sense to me.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
hein created this revision.Apr 13 2017, 9:25 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 13 2017, 9:25 PM
davidedmundson added inline comments.
wallpapers/image/imagepackage/contents/ui/config.qml
38–39

Why even do anything?

You're selecting the currently selected item again. Which does nothing.

You can surely just delete this (and restoreIndex and the Connection)

hein added a comment.EditedApr 14 2017, 2:44 PM

I wasn't sure (and admittedly didn't check) whether the source model does a reset causing the index to revert to 0. I kinda assumed that's why whoever wrote this added restore. If that's not the case yeah I'll just nix it.

This code could use a lot of cleanup, much of it seems written hurriedly.

hein updated this revision to Diff 13440.Apr 14 2017, 4:51 PM

Simplify.

davidedmundson accepted this revision.Apr 18 2017, 12:07 AM
This revision is now accepted and ready to land.Apr 18 2017, 12:07 AM
This revision was automatically updated to reflect the committed changes.