summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRex Dieter <rdieter@math.unl.edu>2014-09-22 15:29:40 -0500
committerRex Dieter <rdieter@math.unl.edu>2014-09-22 15:29:40 -0500
commit345ef333025ba386494a7ca0bc1ccd91f319f926 (patch)
treec619edb9d9328be29291cbcd7b2a07e70349e53e
parent18645a50fe25064b42ba421e231869c6063705f7 (diff)
more plasma5: ktraderclient5, kreadconfig5, kwriteconfig5
-rw-r--r--scripts/xdg-email.in9
-rw-r--r--scripts/xdg-mime.in18
-rw-r--r--scripts/xdg-settings.in20
3 files changed, 38 insertions, 9 deletions
diff --git a/scripts/xdg-email.in b/scripts/xdg-email.in
index e68425c..c8909d0 100644
--- a/scripts/xdg-email.in
+++ b/scripts/xdg-email.in
@@ -85,8 +85,13 @@ run_thunderbird()
open_kde()
{
local client kde_email_profile_name
- kde_email_profile_name=`kreadconfig --file emaildefaults --group Defaults --key Profile`
- client=`kreadconfig --file emaildefaults --group PROFILE_"$kde_email_profile_name" --key EmailClient | cut -d ' ' -f 1`
+ if [ x"${KDE_SESSION_VERSION}" = x"5" ]; then
+ kde_email_profile_name=`kreadconfig5 --file emaildefaults --group Defaults --key Profile`
+ client=`kreadconfig5 --file emaildefaults --group PROFILE_"$kde_email_profile_name" --key EmailClient | cut -d ' ' -f 1`
+ else
+ kde_email_profile_name=`kreadconfig --file emaildefaults --group Defaults --key Profile`
+ client=`kreadconfig --file emaildefaults --group PROFILE_"$kde_email_profile_name" --key EmailClient | cut -d ' ' -f 1`
+ fi
echo $client | grep thunderbird > /dev/null 2>&1
if [ $? -eq 0 ] ; then
run_thunderbird "$client" "$1"
diff --git a/scripts/xdg-mime.in b/scripts/xdg-mime.in
index b324be9..0290d77 100644
--- a/scripts/xdg-mime.in
+++ b/scripts/xdg-mime.in
@@ -398,10 +398,20 @@ defapp_generic()
defapp_kde()
{
MIME="$1"
- if [ x"$KDE_SESSION_VERSION" = x"4" ]; then
- KTRADER=`which ktraderclient 2> /dev/null`
- MIMETYPE="--mimetype"
- SERVICETYPE="--servicetype"
+
+ if [ -n "${KDE_SESSION_VERSION}" ]; then
+ case "${KDE_SESSION_VERSION}" in
+ 4)
+ KTRADER=`which ktraderclient 2> /dev/null`
+ MIMETYPE="--mimetype"
+ SERVICETYPE="--servicetype"
+ ;;
+ 5)
+ KTRADER=`which ktraderclient${KDE_SESSION_VERSION} 2> /dev/null`
+ MIMETYPE="--mimetype"
+ SERVICETYPE="--servicetype"
+ ;;
+ esac
else
KTRADER=`which ktradertest 2> /dev/null`
fi
diff --git a/scripts/xdg-settings.in b/scripts/xdg-settings.in
index 460ffc9..20a9f94 100644
--- a/scripts/xdg-settings.in
+++ b/scripts/xdg-settings.in
@@ -146,10 +146,15 @@ read_kde_config()
configfile="$1"
configsection="$2"
configkey="$3"
- application="`kreadconfig --file $configfile --group $configsection --key $configkey`"
+ if [ x"${KDE_SESSION_VERSION}" = x"5" ]; then
+ application="`kreadconfig5 --file $configfile --group $configsection --key $configkey`"
+ else
+ application="`kreadconfig --file $configfile --group $configsection --key $configkey`"
+ fi
if [ x"$application" != x ]; then
echo "$application"
else
+ if [ x"${KDE_SESSION_VERSION}" = x"4" ]; then
# kreadconfig in KDE 4 may not notice Key[$*]=... localized settings, so
# check by hand if it didn't find anything (oddly kwriteconfig works
# fine though).
@@ -158,6 +163,7 @@ read_kde_config()
[ ! -f "$configfile_path" ] && return
# This will only take the first value if there is more than one.
grep "^$configkey"'\[$[^]=]*\]=' "$configfile_path" | head -n 1 | cut -d= -f 2-
+ fi
fi
}
@@ -239,7 +245,11 @@ check_browser_kde()
set_browser_kde()
{
set_browser_mime "$1" || return
- kwriteconfig --file kdeglobals --group General --key BrowserApplication "$1"
+ if [ x"${KDE_SESSION_VERSION}" = x"5" ]; then
+ kwriteconfig5 --file kdeglobals --group General --key BrowserApplication "$1"
+ else
+ kwriteconfig --file kdeglobals --group General --key BrowserApplication "$1"
+ fi
}
# }}} KDE
@@ -516,7 +526,11 @@ set_url_scheme_handler_kde()
set_browser_mime "$2" "x-scheme-handler/$1" || return
if [ "$1" = "mailto" ]; then
binary="`desktop_file_to_binary "$2"`"
- kwriteconfig --file emaildefaults --group PROFILE_Default --key EmailClient "$binary"
+ if [ x"${KDE_SESSION_VERSION}" = x"5" ]; then
+ kwriteconfig5 --file emaildefaults --group PROFILE_Default --key EmailClient "$binary"
+ else
+ kwriteconfig --file emaildefaults --group PROFILE_Default --key EmailClient "$binary"
+ fi
fi
}