From 18645a50fe25064b42ba421e231869c6063705f7 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 22 Sep 2014 14:31:20 -0500 Subject: [PATCH 24/24] Initial support for Plasma5 ... largely thanks to Karol Herbst --- ChangeLog | 4 ++++ RELEASE_NOTES | 2 +- scripts/xdg-mime.in | 20 ++++++++++++-------- scripts/xdg-open.in | 19 +++++++++++-------- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index f90ba4e..077fb52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ === xdg-utils 1.1.x === + +2014-09-22 Rex Dieter + * Initial support for Plasma5 (largely thanks to Karol Herbst) + 2014-09-19 Rex Dieter * XFCE .desktop file created for browser selection is broken (BR56092) * Unnecessary filtering file:// for pcmanfm (BR63153) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 484b2b9..eee8ac5 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -2,7 +2,7 @@ Release notes for xdg-utils 1.1.0 ================================= This release includes: -* better support for GNOME3, KDE4, LXDE, MATE, XFCE +* better support for GNOME3, KDE4, Plasma5, LXDE, MATE, XFCE * initial support for generic methods (non toolkit-specific, experimental) * xdg-settings utility, a script to get various settings from the desktop environment diff --git a/scripts/xdg-mime.in b/scripts/xdg-mime.in index 474dc5d..b324be9 100644 --- a/scripts/xdg-mime.in +++ b/scripts/xdg-mime.in @@ -36,11 +36,7 @@ update_mime_database() detectDE if [ x"$DE" = x"kde" ] ; then DEBUG 1 "Running kbuildsycoca" - if [ x"$KDE_SESSION_VERSION" = x"4" ]; then - eval 'kbuildsycoca4'$xdg_redirect_output - else - eval 'kbuildsycoca'$xdg_redirect_output - fi + eval 'kbuildsycoca${KDE_SESSION_VERSION}'$xdg_redirect_output fi fi for x in `echo "$PATH:/opt/gnome/bin" | sed 's/:/ /g'`; do @@ -54,9 +50,17 @@ update_mime_database() info_kde() { - if [ x"$KDE_SESSION_VERSION" = x"4" ]; then - DEBUG 1 "Running kmimetypefinder \"$1\"" - kmimetypefinder "$1" 2>/dev/null | head -n 1 + if [ -n "${KDE_SESSION_VERSION}" ]; then + case "${KDE_SESSION_VERSION}" in + 4) + DEBUG 1 "Running kmimetypefinder \"$1\"" + kmimetypefinder "$1" 2>/dev/null | head -n 1 + ;; + 5) + DEBUG 1 "Running kmimetypefinder${KDE_SESSION_VERSION} \"$1\"" + kmimetypefinder${KDE_SESSION_VERSION} "$1" 2>/dev/null | head -n 1 + ;; + esac else DEBUG 1 "Running kfile \"$1\"" kfile "$1" 2> /dev/null | head -n 1 | cut -d "(" -f 2 | cut -d ")" -f 1 diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in index cc2fc9c..0145be3 100644 --- a/scripts/xdg-open.in +++ b/scripts/xdg-open.in @@ -81,15 +81,18 @@ open_darwin() open_kde() { - if kde-open -v 2>/dev/null 1>&2; then - kde-open "$1" + if [ -n "${KDE_SESSION_VERSION}" ]; then + case "${KDE_SESSION_VERSION}" in + 4) + kde-open "$1" + ;; + 5) + kde-open${KDE_SESSION_VERSION} "$1" + ;; + esac else - if [ x"$KDE_SESSION_VERSION" = x"4" ]; then - kfmclient openURL "$1" - else - kfmclient exec "$1" - kfmclient_fix_exit_code $? - fi + kfmclient exec "$1" + kfmclient_fix_exit_code $? fi if [ $? -eq 0 ]; then -- 1.9.3