KCM Baloo: Migrate to KConfigXT and add immutability
ClosedPublic

Authored by bport on Jan 3 2020, 5:47 PM.

Details

Summary

File indexing and Content file indexing benefits from immutability. But exclude/include list don't benefits from it because the UI represent both with the same list

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.
bport created this revision.Jan 3 2020, 5:47 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 3 2020, 5:47 PM
Restricted Application edited subscribers, added: plasma-devel; removed: Plasma. · View Herald Transcript
bport requested review of this revision.Jan 3 2020, 5:47 PM
ervin requested changes to this revision.Jan 6 2020, 2:24 PM
ervin added inline comments.
kcms/baloo/filteredfoldermodel.cpp
6

Missing the * and an empty line after that one.

61

Indentation of that line and the previous one looks wrong... but surprisingly the previous line is not showing up as changed, I wonder if that's the review tool acting up.

161–163

Could have been the first line of that method, would avoid retrieving that list twice and make the if condition more readable.

kcms/baloo/filteredfoldermodel.h
34–35

Declare it as a slot for good measure (although it's technically not really necessary).

kcms/baloo/kcm.cpp
66

Why not connect directly to updateDirectoryList in m_filteredFolderModel? Those lambdas look unnecessary (besides you'd want m_filteredFolderModel and not this as third parameter anyway).

Also you probably want to call updateDirectoryList() once just after those connects.

78

I don't think this call is necessary (it's probably because of the missing call in the ctor).

87

Why are you updating m_previouslyEnabled again? The old code wasn't doing this AFAICT.

115

Same thing, I don't think this is necessary. defaults() can likely completely go away.

128

The opening curly brace should be on its own line.

kcms/baloo/package/contents/ui/main.qml
50

nitpick: I'd put enabled before checked

This revision now requires changes to proceed.Jan 6 2020, 2:24 PM
bport updated this revision to Diff 72907.Jan 6 2020, 4:44 PM
bport marked 9 inline comments as done.

Update according to ervin feedback

bport added inline comments.Jan 6 2020, 4:44 PM
kcms/baloo/filteredfoldermodel.cpp
61

No I just aligned with the previous "wrong" one

kcms/baloo/kcm.cpp
87

Because we need to update it:

  • or we will not have same behavior if we enable / disable it with or without closing kcm between the two step
ervin accepted this revision.Jan 6 2020, 4:54 PM
This revision is now accepted and ready to land.Jan 6 2020, 4:54 PM
This revision was automatically updated to reflect the committed changes.