Create ConfigView an unmanaged ConfigWidget
ClosedPublic

Authored by bport on Feb 19 2020, 2:02 PM.

Details

Summary
  • Allow to manage controller externally
  • Compatible (for checkbox) with KConfigDialogManager (usage of kcfg_ in widget name)
  • Expose loader and settings in order to allow them to be managed by a KCModule
Test Plan
  • automated test
  • Checked integration with Kate
  • ConfigView tested with a plasma-desktop patch

Diff Detail

Repository
R246 Sonnet
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bport created this revision.Feb 19 2020, 2:02 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 19 2020, 2:02 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bport requested review of this revision.Feb 19 2020, 2:02 PM
meven edited the summary of this revision. (Show Details)Feb 19 2020, 2:18 PM
ervin requested changes to this revision.Feb 24 2020, 3:19 PM
ervin added inline comments.
src/core/loader_p.h
7

What's the reason for loader becoming public? If that's mostly out of convenience (it looks like it is), I'd advise not turning it public, Settings and ConfigView can use it internally but let's not increase the API surface even more with Loader.

src/core/settings.cpp
13

Obviously will reappear here ;-)

63–64

This is an odd bit of logic, isn't it?

69

Ditto

src/core/settings.h
10

Please remove that include (it'll become more obvious why you'll be able to do it with one of the comments below) ;-)

34

Will need a ctor (see other comments) in the form of explicit Settings(QObject *parent = nullptr);

37

This is likely useless now, since we inherit from QObject and QObject is non-copyable

38

Ditto

80

Move all the implementations of those static methods to the cpp file.

137

Time to move those to the SettingsPrivate class.

142

Might end up disappearing completely, unsure but to be evaluated

src/core/speller.cpp
216

And that negation again? We're negating twice now...

232

And again...

I wonder what's happening there, it's highly confusing.

src/ui/configview.cpp
34

I'm kind of surprised at this extra widget, can't we get rid of it?

src/ui/configview.h
18

Please move this line just after the #include <QWidget>

24

You might want to declare a bunch of Q_PROPERTY there

26

clients should be a const reference (although I suspect it'll disappear)

parent should be the last parameter and default to nullptr

27

override

31

All the setters there would make for good public slots

35

Space before & not after

40

Are they directly called by a subclass outside the library? If not move them to the dpointer and use Q_PRIVATE_SLOT

43

Move to the d pointer and use Q_PRIVATE_SLOT for those

56

Should be in the d pointer

This revision now requires changes to proceed.Feb 24 2020, 3:19 PM
bport added inline comments.Feb 25 2020, 8:59 AM
src/core/settings.cpp
63–64

Yes indeed, but what we want is to save false if checked and true if not checked.
I moved the logic there in order to work with kconfigxt and with current implementation

src/ui/configview.cpp
34

I kept same widget logic as ConfigWidget. Ididn't want to change that to ensure we have the same baheviour

bport updated this revision to Diff 76384.Feb 25 2020, 3:49 PM

Rework, not expose anymore settings and loader but expose a new settings class

ervin requested changes to this revision.Feb 25 2020, 4:54 PM
ervin added inline comments.
src/core/settings.cpp
62

Please rename it to "skip uppercase"...

Otherwise it does the opposite of its name, it's just confusing

67

Likewise should be renamed to "skip"

src/ui/configview.cpp
44

Break the line before { please

This revision now requires changes to proceed.Feb 25 2020, 4:54 PM
bport updated this revision to Diff 76517.Feb 27 2020, 7:38 AM

rename check uppercase to skip uppercase

ervin requested changes to this revision.Feb 27 2020, 8:44 AM
ervin added inline comments.
src/core/settings.cpp
62

Rename the parameter to skip as well please

src/core/settingsimpl.cpp
260–261

I'd expect a negation here... if by default skip is false, check in settingsimpl should be true (which was the old default).

This revision now requires changes to proceed.Feb 27 2020, 8:44 AM
bport updated this revision to Diff 77269.Mar 9 2020, 12:07 PM

rename check to skip and add missing negation for default

ervin accepted this revision.Mar 16 2020, 3:28 PM
This revision is now accepted and ready to land.Mar 16 2020, 3:28 PM
This revision was automatically updated to reflect the committed changes.