[Touchpad KCM] Load previous setting on reboot
ClosedPublic

Authored by romangg on May 15 2019, 3:43 PM.

Details

Summary

Earlier Previous setting were not loaded on reboot instead default settings were loaded.
So, added config file for saving the settings.

Now on startup, settings from config file will be loaded.

Test Plan

Tested using kcminit and manually rebooting.

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.
atulbi created this revision.May 15 2019, 3:43 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 15 2019, 3:43 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
atulbi requested review of this revision.May 15 2019, 3:43 PM
nicolasfella added inline comments.
kcms/touchpad/src/backends/x11/libinputtouchpad.cpp
411

Coding style: Space around !=

davidedmundson requested changes to this revision.May 15 2019, 7:34 PM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
kcms/touchpad/src/backends/x11/libinputtouchpad.cpp
215

This can be left dangling

Store the KSharedConfigPtr as the member variable then you'll keep a reference

This revision now requires changes to proceed.May 15 2019, 7:34 PM
romangg added inline comments.May 15 2019, 9:26 PM
kcms/touchpad/src/backends/x11/libinputtouchpad.cpp
214

The name of the config file should be something similar to the other one and only lower case: touchpadxlibinputrc

417

Why this write back? What's configProps.

romangg added inline comments.May 15 2019, 9:27 PM
kcms/touchpad/src/backends/x11/libinputtouchpad.cpp
54

In best case these should be in some way shared with libinputProperties array to minimize code duplication. But as long as these names are the same as in libinputProperties, we can leave it like that for now.

fvogt added a subscriber: fvogt.May 16 2019, 8:51 AM
fvogt added inline comments.
kcms/touchpad/src/backends/x11/libinputtouchpad.cpp
32

static?

romangg commandeered this revision.May 16 2019, 11:47 AM
romangg edited reviewers, added: atulbi; removed: romangg.
romangg updated this revision to Diff 58164.May 16 2019, 11:47 AM
  • Fix loading, code style, shared cfg ptr
romangg marked 5 inline comments as done.May 16 2019, 11:48 AM
davidedmundson accepted this revision.May 16 2019, 12:04 PM
davidedmundson added inline comments.
kcms/touchpad/src/kcm/touchpadconfigcontainer.cpp
59

pedantically

} else if {

This revision is now accepted and ready to land.May 16 2019, 12:04 PM
This revision was automatically updated to reflect the committed changes.
romangg marked an inline comment as done.
atulbi added a comment.EditedMay 16 2019, 4:02 PM

Thank you so much for fixing it.
Wanted it to be on beta.

kcms/touchpad/src/backends/x11/libinputtouchpad.cpp
417

Yeah realized later that there is no need to write config here. So no need for configProps. Should I open a new patch for removing it?