Starting a new KCM from scratch is currently a time consuming task,
you have to copy files or mount the correct hierarchy in disk and pray that it's correct, create files in the correct places and reference them in .desktop files,
the metadata file also references files or classes that are supposed to be in the project.
if you look at some KCM's, the code does not help as sometimes they reference as kcm_ other as KCM within the CMake.
As I'm porting KCM's from C++ to Qml, I realized that I'd spend *more* time just creating the initial skeleton than actually creating the code to handle the settings,
this will sabe my time, and hopefully, others.
Details
- Reviewers
mart ervin - Group Reviewers
Plasma Frameworks
Created a new project via KAppTemplate, compiled, run the kcm stuvb
Diff Detail
- Repository
- R242 Plasma Framework (Library)
- Branch
- arcpatch-D25149
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 18571 Build 18589: arc lint + arc unit
What about having the template use kcfg and ManagedConfigModule as well? It'd give better behaving modules by default and is a better practice than starting without them. I'd rather have people make the conscious decision to remove them because it turns out it's a KCM with no KConfig at all than people overlooking proper KConfig use by default.
Another related todo would be to update/rewrite https://techbase.kde.org/Development/Tutorials/KCM_HowTo after this template is merged and include information about it ;)
A very sensible idea. ++
templates/kcm-qml/qml-plasmoid.png
What's this about?
templates/kcm-qml/package/contents/ui/main.qml | ||
---|---|---|
27 | lets not encourage this import |
templates/kcm-qml/package/contents/ui/main.qml | ||
---|---|---|
38 | Typo: Exemple -> Example |
templates/kcm-qml/%{APPNAMELC}settings.kcfgc | ||
---|---|---|
6 | You also want "ParentInConstructor=true" in here. | |
templates/kcm-qml/kcm.cpp | ||
33 | Pass this as parent here (currently you're leaking it) | |
44 | Shouldn't be needed anymore (and likely wrong in most cases). | |
templates/kcm-qml/kcm.h | ||
27 | This should inherit from ManagedConfigModule now. | |
37 | None of those slots are needed with a ManagedConfigModule (except if you need to do something outside the realm of the settings of course, which is not the case by default. | |
templates/kcm-qml/package/contents/ui/main.qml | ||
40 | What about disabling it if the setting is immutable? |
templates/kcm-qml/kcm.cpp | ||
---|---|---|
38 | Nitpick: indentation looks broken here, I think it wasn't earlier. |
templates/kcm-qml/%{APPNAMELC}settings.kcfg | ||
---|---|---|
9 | Now that I think about it, what about using both key and name here? To have a nice property name and a "stranger" storage key? | |
templates/kcm-qml/Messages.sh | ||
4 | I'm talking mostly out of ignorance here, but shouldn't that harvest also the qml files somehow? | |
templates/kcm-qml/kcm.cpp | ||
31 | Ditto | |
37 | Ditto Beside that could use auto | |
templates/kcm-qml/kcm.h | ||
33 | Nitpick: space should be before * and & not after. |