diff -r ./xdg-utils.orig/scripts/xdg-email.in ./xdg-utils.new/scripts/xdg-email.in 135a136,157 > open_tde() > { > > local command=tdemailservice > > if which $command >/dev/null 2>&1; then > DEBUG 1 "Running $command \"$1\"" > # TDE uses locale's encoding when decoding the URI, > # so set it to UTF-8 > LC_ALL=C.UTF-8 $command "$1" > else > DEBUG 1 "$command missing; trying generic mode instead." > open_generic "$1" > fi > > if [ $? = 0 ]; then > exit_success > else > exit_failure_operation_failed > fi > } > 468a491,494 > ;; > > tde) > open_tde "${mailto}" diff -r ./xdg-utils.orig/scripts/xdg-mime.in ./xdg-utils.new/scripts/xdg-mime.in 40a41,45 > # FIXME ? tdebuildsycoca > if [ x"$DE" = x"tde" ] ; then > DEBUG 1 "Running kbuildsycoca5" > eval 'kbuildsycoca5'$xdg_redirect_output > fi 75a81,93 > info_tde() > { > > DEBUG 1 "Running tdefile \"$1\"" > tdefile "$1" 2> /dev/null | head -n 1 | cut -d "(" -f 2 | cut -d ")" -f 1 > > if [ $? -eq 0 ]; then > exit_success > else > exit_failure_operation_failed > fi > } > 239a258,313 > make_default_tde() > { > # $1 is vendor-name.desktop > # $2 is mime/type > # > # On TDE, add to $TDE_CONFIG_PATH/profilerc: > # [$2 - 1] > # Application=$1 > # > # Remove all [$2 - *] sections, or even better, > # renumber [$2 - *] sections and remove duplicate > # > > vendor="$1" > mimetype="$2" > > default_dir=`tde-config --path config 2> /dev/null | cut -d ':' -f 1` > default_file="$default_dir/profilerc" > > if [ -z "$default_dir" ]; then > DEBUG 2 "make_default_tde: No tde runtime detected" > return > fi > DEBUG 2 "make_default_tde $vendor $mimetype" > DEBUG 1 "Updating $default_file" > mkdir -p "$default_dir" > [ -f "$default_file" ] || touch "$default_file" > > awk -v application="$vendor" -v mimetype="$mimetype" ' > BEGIN { > header_start="[" mimetype " - " > suppress=0 > } > { > if (index($0, header_start) == 1 ) > suppress=1 > else > if (/^\[/) { suppress=0 } > > if (!suppress) { > print $0 > } > } > END { > print "" > print "[" mimetype " - 1]" > print "Application=" application > print "AllowAsDefault=true" > print "GenericServiceType=Application" > print "Preference=1" > print "ServiceType=" mimetype > } > ' "$default_file" > "${default_file}.new" && mv "${default_file}.new" "$default_file" > > } > 465a540,560 > defapp_tde() > { > MIME="$1" > > KTRADER=`which tdetradertest 2> /dev/null` > > if [ -n "$KTRADER" ] ; then > DEBUG 1 "Running TDE trader query \"$MIME\" mimetype and \"Application\" servicetype" > trader_result=`$KTRADER "$MIME" Application 2>/dev/null \ > | grep -E "^DesktopEntryPath : |\.desktop$" | head -n1 | sed "s/^DesktopEntryPath : '\(.*\.desktop\)'\$/\1/"` > if [ -n "$trader_result" ] ; then > basename "$trader_result" > exit_success > else > exit_failure_operation_failed > fi > else > defapp_generic "$1" > fi > } > 577a673 > make_default_tde "$filename" "$mimetype" 596a693,696 > tde) > info_tde "$filename" > ;; > 613a714,717 > ;; > > tde) > defapp_tde "$mimetype" diff -r ./xdg-utils.orig/scripts/xdg-open.in ./xdg-utils.new/scripts/xdg-open.in 144a145,156 > open_tde() > { > > kfmclient exec "$1" > > if [ $? -eq 0 ]; then > exit_success > else > exit_failure_operation_failed > fi > } > 495a508,511 > ;; > > tde) > open_tde "$url" diff -r ./xdg-utils.orig/scripts/xdg-screensaver.in ./xdg-utils.new/scripts/xdg-screensaver.in 96a97,99 > tde) > screensaver_tde "$1" > ;; 330a334,382 > { > case "$1" in > suspend) > dcop kdesktop KScreensaverIface enable false > /dev/null > result=$? > ;; > > resume) > dcop kdesktop KScreensaverIface configure > /dev/null > result=$? > ;; > > activate) > dcop kdesktop KScreensaverIface save > /dev/null > result=$? > ;; > > lock) > dcop kdesktop KScreensaverIface lock > /dev/null > result=$? > ;; > > reset) > # Turns the screensaver off right now > dcop kdesktop KScreensaverIface quit > /dev/null > result=$? > ;; > > status) > status=`dcop kdesktop KScreensaverIface isEnabled` > result=$? > if [ x"$status" = "xtrue" ]; then > echo "enabled" > elif [ x"$status" = "xfalse" ]; then > echo "disabled" > else > echo "ERROR: kdesktop KScreensaverIface isEnabled returned '$status'" >&2 > return 1 > fi > ;; > > *) > echo "ERROR: Unknown command '$1'" >&2 > return 1 > ;; > esac > } > > screensaver_tde() diff -r ./xdg-utils.orig/scripts/xdg-settings.in ./xdg-utils.new/scripts/xdg-settings.in 105a106,112 > > if [ "$DE" = tde -a -z "$XDG_MIME_FIXED" ]; then > ktradertest text/html Application > /dev/null 2>&1 > # Only do this once, as we only need it once. > XDG_MIME_FIXED=yes > fi > 170a178,195 > > # {{{ TDE utilities > > read_tde_config() > { > configfile="$1" > configsection="$2" > configkey="$3" > > application="`kreadconfig --file $configfile --group $configsection --key $configkey`" > > if [ x"$application" != x ]; then > echo "$application" > fi > } > > # }}} TDE utilities > 255a281,365 > > # {{{ TDE > > # Resolves the TDE browser setting to a binary: if prefixed with !, simply removes it; > # otherwise, uses desktop_file_to_binary to get the binary out of the desktop file. > resolve_tde_browser() > { > [ -z "$browser" ] && return > case "$browser" in > !*) > echo "${browser#!}" > ;; > *) > desktop_file_to_binary "$browser" > ;; > esac > } > > # Does the opposite of resolve_tde_browser: if prefixed with !, tries to find a desktop > # file corresponding to the binary, otherwise just returns the desktop file name. > resolve_tde_browser_desktop() > { > [ -z "$browser" ] && return > case "$browser" in > !*) > desktop="`binary_to_desktop_file "${browser#!}"`" > basename "$desktop" > ;; > *) > echo "$browser" > ;; > esac > } > > read_tde_browser() > { > read_tde_config kdeglobals General BrowserApplication > } > > get_browser_tde() > { > browser="`read_tde_browser`" > if [ x"$browser" = x ]; then > # No explicit default browser; TDE will use the MIME type text/html. > get_browser_mime > else > resolve_tde_browser_desktop > fi > } > > check_browser_tde() > { > check="`desktop_file_to_binary "$1"`" > if [ -z "$check" ]; then > echo no > exit_success > fi > browser="`read_tde_browser`" > binary="`resolve_tde_browser`" > # Because TDE will use the handler for MIME type text/html if this value > # is empty, we allow either the empty string or a match to $check here. > if [ x"$binary" != x -a x"$binary" != x"$check" ]; then > echo no > exit_success > fi > browser="`get_browser_mime`" > binary="`desktop_file_to_binary "$browser"`" > if [ x"$binary" != x"$check" ]; then > echo no > exit_success > fi > echo yes > exit_success > } > > set_browser_tde() > { > set_browser_mime "$1" || return > > kwriteconfig --file kdeglobals --group General --key BrowserApplication "$1" > > } > > # }}} TDE > 606a717,769 > > # {{{ TDE > > get_url_scheme_handler_tde() > { > if [ "$1" = "mailto" ]; then > handler="`read_tde_config emaildefaults PROFILE_Default EmailClient | first_word`" > echo "handler is $handler" > if [ x"$handler" != x ]; then > binary_to_desktop_file "$handler" > else > get_browser_mime "x-scheme-handler/$1" > fi > else > get_browser_mime "x-scheme-handler/$1" > fi > } > > check_url_scheme_handler_tde() > { > check="`desktop_file_to_binary "$2"`" > if [ -z "$check" ]; then > echo no > exit_success > fi > if [ x"$1" = "mailto" ]; then > binary="`read_tde_config emaildefaults PROFILE_Default EmailClient`" > if [ x"$binary" != x"$check" ]; then > echo no > exit_success > fi > fi > handler="`get_browser_mime x-scheme-handler/$1`" > binary="`desktop_file_to_binary "$handler"`" > if [ x"$binary" != x"$check" ]; then > echo no > exit_success > fi > echo yes > exit_success > } > > set_url_scheme_handler_tde() > { > 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" > fi > } > > # }}} KDE > 840a1004,1007 > ;; > > tde) > dispatch_specific tde "$@" diff -r ./xdg-utils.orig/scripts/xdg-utils-common.in ./xdg-utils.new/scripts/xdg-utils-common.in 290a291,293 > Trinity) > DE=tde; > ;;