summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMéven Car <meven.car@enioka.com>2020-10-21 16:58:20 +0200
committerMéven Car <meven.car@enioka.com>2020-11-13 10:31:55 +0100
commitd11b33ec7f24cfb1546f6b459611d440013bdc72 (patch)
treec50eb5e3f535d6139ca9a41ae69ef7259f53c07a
parent9816ebb3e6fd9f23e993b8b7fcbd56f92d9c9197 (diff)
Fix xdg-settings support for default-web-browser for Plasma 5.19+198-xdg-desktop-menu-is-not-doing-it-right-or-the-documentation-lacks
-rwxr-xr-x[-rw-r--r--]scripts/xdg-settings.in18
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/xdg-settings.in b/scripts/xdg-settings.in
index 3781de8..ab18d3a 100644..100755
--- a/scripts/xdg-settings.in
+++ b/scripts/xdg-settings.in
@@ -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