[KDE] How to ensure that program's config option is not deprecated?

Let's say that i would like to make sure that some property actually still exist in given program and can be used by it (aka is not deprecated aka not just empty entry in config file), since kreadconfig5 / kwriteconfig5 are just write / read configs as far as i know, it's not enough to just kreadconfig5 or something

There are 2 cases i would like to cover:

  1. When you already know program which should have this configuration (for example dolphin):
kreadconfig5 --file "dolphinrc" --group "General" --key "ShowFullPath"
  1. When you don't have a clue and pass some random program's config inside loop (but you know that they're all part of KDE / plasma), like those for example:
kreadconfig5 --file "klaunchrc" --group "BusyCursorSettings" --key "Bouncing"
kreadconfig5 --file "baloofilerc" --group "General" --key "only basic indexing"
kreadconfig5 --file "kactivitymanagerd-pluginsrc" --group "Plugin-org.kde.ActivityManager.Resources.Scoring" --key "blocked-by-default"

I see this process as something like:

  1. Define program by config file (ideally for case 2)

  2. Somehow dump/compare all available config options from this program (if it exists)

  3. Check if there's a match with given group + key there

But i have no clue if this is possible / how to go with it :thinking:
Or maybe there's something native for this, like with their Python api

So...I take it's not possible to do? :space_invader:

I'm having a hard time understanding your goal. Can you describe what you intend to do as if you'd did it manually?

1 Like

Yeah, sorry my description must be pretty sleepy :grin:

Let's try with simple abstraction:

  1. Prior to execute command like that:
kwriteconfig5 --file "dolphinrc" --group "General" --key "ShowFullPath" false
  1. I would like to be future-proof and check if dolphin program still actually have such group and key as available config option (aka not deprecated)

I would imagine that this would require something like dump of all available program's config options and comparing group / key to see if they're still available or something from KDE/qt arsenal of commands which i am not aware of yet :slight_smile:


When it comes to goal...Imagine script with 1000 config commands, if something changes (i don't know, group / key name for specific property or it got removed) it's pretty hard to keep track of stuff manually :woozy_face:

So the first question is: where do you get a full list of current options for the given program?

Yep, for starters, i wonder if that's possible with KDE programs at all...

I guess you need to follow release announcements of something. That's a lot of work- Maybe you could somehow find a way to retrieve the list from the source code, but it would probably take different approaches to different programs. Lastly, you can check for --help, man or some binary of a given program to try and get available options.

2 Likes

Well, source is overkill for the task i guess...Although possible
I've already tried man / --help / strings dolphin with no luck of course.

Maybe there's something in KDE's Python api @papajoke ?
Or some qt / qdbus which ain't so obvious.

Forum kindly sponsored by