Commit d11b33ec authored by Méven Car's avatar Méven Car
Browse files

Fix xdg-settings support for default-web-browser for Plasma 5.19+

parent 9816ebb3
......@@ -130,7 +130,7 @@ set_browser_mime()
fix_local_desktop_file "$1" "$MIME" || return
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/applications"
xdg-mime default "$1" "$MIME" || return
if [ x"`get_browser_mime`" != x"$1" ]; then
if [ x"`get_browser_mime $MIME`" != x"$1" ]; then
# Put back the original value
xdg-mime default "$orig" "$MIME"
exit_failure_operation_failed
......@@ -203,7 +203,13 @@ resolve_kde_browser_desktop()
read_kde_browser()
{
read_kde_config kdeglobals General BrowserApplication
ret=`read_kde_config kdeglobals General BrowserApplication`
if [ -z "$ret" ]; then
# since Plasma >= 5.19
ret=`get_browser_mime "x-scheme-handler/http"`
fi
echo $ret
}
get_browser_kde()
......@@ -252,7 +258,13 @@ check_browser_kde()
set_browser_kde()
{
set_browser_mime "$1" || return
# Set the default browser.
for protocol in http https; do
set_browser_mime "$1" "x-scheme-handler/$protocol" || return
done
# Plasma < 5.19
set_browser_mime "$1" "text/html" || return
if [ x"${KDE_SESSION_VERSION}" = x"5" ]; then
kwriteconfig5 --file kdeglobals --group General --key BrowserApplication "$1"
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment