Add a simple delete option to kwriteconfig. A possible usecase of this option is to delete unused shortcut bindings.
Details
- Reviewers
davidre dfaure meven cfeck davidedmundson - Group Reviewers
Frameworks - Commits
- R237:9b8ef694412c: kwriteconfig: add delete option
Diff Detail
- Repository
- R237 KConfig
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
I don't think deleting a entry from a config file makes sense. If you delete an entry you will get the default value on the next read.
For shortcuts it's a bit more complicated. What shortcuts had you in mind to delete?
What shortcuts had you in mind to delete?
My specific interest is deleting shortcuts of removed KWin scripts. ( e.g. https://github.com/esjeon/krohnkite/issues/31 ) Such shortcuts keep appearing on Global Shortcuts dialog unless manually deleted. Also, while developing the script, I leave garbage values behind, and having this around will be handy.
If you delete an entry you will get the default value on the next read.
I believe some people will find such behaviour(?) useful. You can safely "reset" configs from CLI without worrying about putting wrong values.
As noted in that issue for removing shortcuts modifying kglobalshortcutsrc is not enough as kglobaccel will write back. A reliable way to do that is via DBus.
Yeah, that sounds like a better approach for the shortcut thing. But I want to make clear that I submitted this patch only after verifying that this works for my case, for whatever reason.
Also, I don't see anything wrong with adding this, since it merely exposes deleteEntry method already in the API. Some projects do rely on it, so why should it be kept away from actual human beings?
I am in no way against this. I just wanted to know what the motivation behind this is :).
Shortcuts aside, the patch makes sense.
In general, I want to encourage people to wipe config entries rather than write in the current default as it makes several other things work better.
Do you have commit access?
Can you provide your email address so we can land this patch with correct authorship information?