Solid-device-automounter/kcm: Use KConfigXT in ui
ClosedPublic

Authored by meven on Feb 3 2020, 2:11 PM.

Details

Summary
  • Make default button work
  • Move connection from cpp to .ui
  • Slight label change
Test Plan

Use default button

Diff Detail

Repository
R119 Plasma Desktop
Branch
arcpatch-D27127
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22585
Build 22603: arc lint + arc unit
meven created this revision.Feb 3 2020, 2:11 PM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 3 2020, 2:11 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
meven requested review of this revision.Feb 3 2020, 2:11 PM
ervin requested changes to this revision.Feb 12 2020, 1:29 PM
ervin added inline comments.
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
57 ↗(On Diff #74925)

Missing this as parent, this is leaked. Also I'd likely move that in the ctor initialization list (same thing for m_devices actually, maybe in another patch, your call).

114 ↗(On Diff #74925)

I'd store the result of the automountEnabled call in an intermediate variable, just to make things more readable.

This revision now requires changes to proceed.Feb 12 2020, 1:29 PM
meven updated this revision to Diff 75845.Feb 17 2020, 4:44 PM
meven marked 2 inline comments as done.

Add a delete for m_settings, move m_devices to ctor intialization

bport added inline comments.Feb 17 2020, 5:34 PM
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
84

We can also change kcfgc to add parent in constructor

meven updated this revision to Diff 75891.Feb 18 2020, 8:58 AM
meven marked an inline comment as done.

Remove m_settings AutomounterSettings member from DeviceAutomounterKCM

meven added inline comments.Feb 18 2020, 8:59 AM
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
84

It would imply make AutomounterSettings not-static.
I would need to change the DeviceModel that uses AutomounterSettings static functions as well.

57 ↗(On Diff #74925)

I removed the m_settings instead, relying solely on the singleton.

ervin added inline comments.Feb 18 2020, 9:50 AM
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
57 ↗(On Diff #74925)

I tend to consider this as a step back to be honest. Singletons tend to be more trouble down the line when something goes wrong.

meven added inline comments.Feb 18 2020, 9:58 AM
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
57 ↗(On Diff #74925)

Please beware this will make my patch quite a lot more intrusive, DeviceModel for instance, will need a field to keep some reference to the AutomounterSettings

ervin added inline comments.Feb 18 2020, 10:02 AM
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
57 ↗(On Diff #74925)

Sure, moving away from a singleton is always intrusive (just like moving away from a global variable which it is really). Let's aim for it in a different specific patch.

meven marked 4 inline comments as done.Feb 18 2020, 2:54 PM
meven added inline comments.
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
57 ↗(On Diff #74925)

Just waiting for this review then, I am preparing the next patch

meven marked 2 inline comments as done.Feb 18 2020, 3:12 PM
meven added inline comments.
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
57 ↗(On Diff #74925)
ervin requested changes to this revision.Feb 24 2020, 10:59 AM
ervin added inline comments.
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
44 ↗(On Diff #74925)

This is wrongly indented

114 ↗(On Diff #74925)

Comment has been marked done but I don't see it changed here. Wrong status of the review?

This revision now requires changes to proceed.Feb 24 2020, 10:59 AM
meven updated this revision to Diff 76286.Feb 24 2020, 1:42 PM
meven marked 3 inline comments as done.

Fix indentation and add intermediate variable

ervin accepted this revision.Feb 24 2020, 1:48 PM
This revision is now accepted and ready to land.Feb 24 2020, 1:48 PM
This revision was automatically updated to reflect the committed changes.