Skip to content

WIP: Fix mailto: links if Thunderbird is the default

Fabian Vogt requested to merge work/fixthunderbird into master

After d1f62c16 ("KCM/Component Revamp email config"), the EmailClient in .config/emaildefaults contains a path to a .desktop file instead of the executable. This is not compatible with what xdg-mime does:

local client=$($kreadconfig --file emaildefaults \
                            --group "PROFILE_$profile" \
                            --key EmailClient \
                      | cut -d ' ' -f 1)

if echo "$client" | grep -Eq 'thunderbird|icedove'; then
    run_thunderbird "$client" "$1"
fi

It's not easily possible to map a .desktop file to an executable which can be called that way, but fortunately it doesn't seem like "EmailClient" is used anywhere anymore and the fallback in xdg-email is actually working fine. So just delete the key if it's set.

WIP because I didn't actually test this code directly, I only played around with the config files directly.

CC @meven

Merge request reports