shell/source/unix/misc/senddoc.sh |   60 +++++---------------------------------
 1 file changed, 8 insertions(+), 52 deletions(-)

New commits:
commit 8e7a3669dd86f86325b3012abc657b5d4665374d
Author: David Steele <dste...@gmail.com>
Date:   Tue Oct 16 19:11:37 2012 -0400

    Combine senddoc null and default cases for better mailer selection.

diff --git a/shell/source/unix/misc/senddoc.sh 
b/shell/source/unix/misc/senddoc.sh
index 5a755d7..0ff1594 100644
--- a/shell/source/unix/misc/senddoc.sh
+++ b/shell/source/unix/misc/senddoc.sh
@@ -369,62 +369,18 @@ case `basename "$MAILER" | sed 's/-.*$//'` in
         /usr/bin/open -a "${MAILER}" ${ATTACH}
         ;;
 
-    "")
-
-        # DESKTOP_LAUNCH, see 
http://freedesktop.org/pipermail/xdg/2004-August/004489.html
-        if [ -n "$DESKTOP_LAUNCH" ]; then
-            while [ "$1" != "" ]; do
-                case $1 in
-                    --to)
-                        if [ "${TO}" != "" ]; then
-                            MAILTO="${MAILTO:-}${MAILTO:+&}to=$2"
-                        else
-                            TO="$2"
-                        fi
-                        shift
-                        ;;
-                    --cc)
-                        MAILTO="${MAILTO:-}${MAILTO:+&}cc="`echo "$2" | 
${URI_ENCODE}`
-                        shift
-                        ;;
-                    --bcc)
-                        MAILTO="${MAILTO:-}${MAILTO:+&}bcc="`echo "$2" | 
${URI_ENCODE}`
-                        shift
-                        ;;
-                    --subject)
-                        MAILTO="${MAILTO:-}${MAILTO:+&}subject="`echo "$2" | 
${URI_ENCODE}`
-                        shift
-                        ;;
-                    --body)
-                        MAILTO="${MAILTO:-}${MAILTO:+&}body="`echo "$2" | 
${URI_ENCODE}`
-                        shift
-                        ;;
-                    --attach)
-                        MAILTO="${MAILTO:-}${MAILTO:+&}attachment="`echo "$2" 
| ${URI_ENCODE}`
-                        shift
-                        ;;
-                    *)
-                        ;;
-                esac
-                shift;
-            done
-
-            MAILTO="mailto:${TO}?${MAILTO}";
-            ${DESKTOP_LAUNCH} "${MAILTO}" &
-        else
-            echo "Could not determine a mail client to use."
-            exit 2
-        fi
-        ;;
-
     *)
-        # LO is configured to use something we do not recognize.
+
+        # LO is configured to use something we do not recognize, or is not 
configured.
         # Try to be smart, and send the mail anyway, if we have the
         # possibility to do so.
 
-        if [ -n "$KDE_FULL_SESSION" -a -x /usr/bin/kde-open ] ; then
+        if [ -n "$DESKTOP_LAUNCH" ]; then
+            # 
http://lists.freedesktop.org/pipermail/xdg/2004-August/002873.html
+            MAILER=${DESKTOP_LAUNCH}
+        elif [ -n "$KDE_FULL_SESSION" -a -x /usr/bin/kde-open ] ; then
             MAILER=/usr/bin/kde-open
-        elif [ -x /usr/bin/gnome-open ] ; then
+        elif [ -n "$GNOME_DESKTOP_SESSION_ID" -a -x /usr/bin/gnome-open ] ; 
then
             MAILER=/usr/bin/gnome-open
         elif [ -x /usr/bin/xdg-open ] ; then
             MAILER=/usr/bin/xdg-open
@@ -460,7 +416,7 @@ case `basename "$MAILER" | sed 's/-.*$//'` in
                     shift
                     ;;
                 --attach)
-                    MAILTO="${MAILTO:-}${MAILTO:+&}attach="`echo "file://$2" | 
${URI_ENCODE}`
+                    MAILTO="${MAILTO:-}${MAILTO:+&}attachment="`echo 
"file://$2" | ${URI_ENCODE}`
                     shift
                     ;;
                 *)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to