plasma5: ktraderclient5, kreadconfig5, kwriteconfig5

This commit is contained in:
Rex Dieter 2014-09-22 15:31:19 -05:00
parent 0846cbbb74
commit f8065412fa
2 changed files with 124 additions and 1 deletions

View File

@ -0,0 +1,119 @@
From 345ef333025ba386494a7ca0bc1ccd91f319f926 Mon Sep 17 00:00:00 2001
From: Rex Dieter <rdieter@math.unl.edu>
Date: Mon, 22 Sep 2014 15:29:40 -0500
Subject: [PATCH 25/25] more plasma5: ktraderclient5, kreadconfig5,
kwriteconfig5
---
scripts/xdg-email.in | 9 +++++++--
scripts/xdg-mime.in | 18 ++++++++++++++----
scripts/xdg-settings.in | 20 +++++++++++++++++---
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
}
--
1.9.3

View File

@ -4,7 +4,7 @@
Summary: Basic desktop integration functions Summary: Basic desktop integration functions
Name: xdg-utils Name: xdg-utils
Version: 1.1.0 Version: 1.1.0
Release: 0.27.%{pre}%{?dist} Release: 0.28.%{pre}%{?dist}
URL: http://portland.freedesktop.org/ URL: http://portland.freedesktop.org/
%if 0%{?pre:1} %if 0%{?pre:1}
@ -41,6 +41,7 @@ Patch121: 0021-xdg-open-fixes-63153-keeping-the-path-as-URL.patch
Patch122: 0022-update-Changelog-for-recent-contributed-patches.patch Patch122: 0022-update-Changelog-for-recent-contributed-patches.patch
Patch123: 0023-make-release-distclean-targets-suck-less.patch Patch123: 0023-make-release-distclean-targets-suck-less.patch
Patch124: 0024-Initial-support-for-Plasma5.patch Patch124: 0024-Initial-support-for-Plasma5.patch
Patch125: 0025-more-plasma5-ktraderclient5-kreadconfig5-kwriteconfi.patch
BuildRequires: gawk BuildRequires: gawk
BuildRequires: xmlto text-www-browser BuildRequires: xmlto text-www-browser
@ -111,6 +112,9 @@ make install DESTDIR=%{buildroot}
%changelog %changelog
* Mon Sep 22 2014 Rex Dieter <rdieter@fedoraproject.org> 1.1.0-0.28.rc2
- plasma5: ktraderclient5, kreadconfig5, kwriteconfig5
* Mon Sep 22 2014 Rex Dieter <rdieter@fedoraproject.org> 1.1.0-0.27.rc2 * Mon Sep 22 2014 Rex Dieter <rdieter@fedoraproject.org> 1.1.0-0.27.rc2
- more upstream goodness, initial plasma5 support - more upstream goodness, initial plasma5 support