How to change file association for files opened in Dolphin from command line in GNOME?

I would like to change several default applications for files opened in Dolphin. I know I could do it manually with kcmshell4 filetypes, keditfiletype or however else but is there a way how to change file associations for Dolphin in terminal? Would be nice if I didn't have to do it manually for every single file type every time I change distribution.

kde-open successfully ignores everything set with xdg-mime and all following files:

~/.local/share/applications/mimeapps.list
~/.local/share/applications/defaults.list
/usr/share/applications/defaults.list

I guess one way how to solve this would be to detach Dolphin from using kde-open and use gnome-open or gvfs-open instead but I have no idea how to do that, if possible.


Solution 1:

Seems like I found the solution to my own question:

Dolphin obviously ignores the [Default Applications] in ~/.local/share/applications/mimeapps.list but uses [Added Associations] in the same file. So the quick way how to change multiple file associations in Dolphin would be to copy all the lines under [Default Applications] (set with xdg-mime) and paste them to the same file with [Added Associations] before them instead. Most likely works the same with Konqueror and everything else using kde-open.